+++ /dev/null
-#!/usr/bin/env bash
-
-# perform a dev build and install on local macOS machine
-APP=""
-INSTALLERVOL=""
-APPLICATIONS=/Applications
-CHANNEL="LOCAL"
-DMG=build/install4j/11/Jalview_Local-TEST-macos-java_11.dmg
-GRADLE=""
-APPBASEOVERRIDEARG=""
-BUILDID=MACOS-AARCH64-DMG
-CLEAN="clean"
-JAVA=11
-x=$(grep jalview.version= RELEASE)
-VERSION=${x#*=}
-
-while getopts ":i:n:a:c:d:go:b:j:l" opt; do
- case ${opt} in
- i)
- INSTALLERVOL="${OPTARG}"
- ;;
- n)
- APP="${OPTARG}"
- ;;
- a)
- APPLICATIONS="${OPTARG}"
- ;;
- c)
- CHANNEL="${OPTARG}"
- ;;
- d)
- DMG="${OPTARG}"
- ;;
- g)
- GRADLE=1
- ;;
- o)
- APPBASEOVERRIDEARG="-Pgetdown_appbase_override=${OPTARG}"
- ;;
- b)
- BUILDID="${OPTARG}"
- ;;
- j)
- JAVA="${OPTARG}"
- ;;
- l)
- CLEAN=""
- ;;
- ?)
- echo "Invalid option -${OPTARG}"
- exit 1;
- ;;
- esac
-done
-
-if [ -z $APP ]; then
- ARCH=x64
- if [ $(uname -m) = "arm64" ]; then
- ARCH=aarch64
- fi
- OS=macos
- case $(uname -o) in
- Darwin)
- OS=macos
- ;;
- Windows)
- OS=windows
- ;;
- Linux)
- OS=linux
- ;;
- *)
- OS=unix
- ;;
- esac
- case ${CHANNEL} in
- DEVELOP)
- APP="Jalview Develop"
- DMG="build/install4j/11/${APP// /_}-${VERSION//\./_}-d$(date +%Y%m%d)-${OS}-${ARCH}-java_${JAVA}.dmg"
- ;;
- TEST-RELEASE)
- APP="Jalview Test"
- DMG="build/install4j/11/${APP// /_}-${VERSION//\./_}-test-${OS}-${ARCH}-java_${JAVA}.dmg"
- ;;
- RELEASE)
- APP="Jalview"
- DMG="build/install4j/11/${APP// /_}-${VERSION//\./_}-${OS}-${ARCH}-java_${JAVA}.dmg"
- ;;
- *)
- APP="Jalview Local"
- DMG=build/install4j/11/${APP// /_}-TEST-macos-java_11.dmg
- ;;
- esac
-fi
-WC=""
-if [ -z $INSTALLERVOL ]; then
- INSTALLERVOL="Install ${APP}"
- WC="*"
-fi
-
-if [ "${GRADLE}" = 1 ]; then
- echo "Running: gradle ${CLEAN} installers -PCHANNEL="${CHANNEL}" -Pinstall4j_build_ids="${BUILDID}" ${APPBASEOVERRIDEARG} -PJAVA_VERSION=${JAVA}"
- gradle ${CLEAN} installers -PCHANNEL="${CHANNEL}" -Pinstall4j_build_ids="${BUILDID}" ${APPBASEOVERRIDEARG} -PJAVA_VERSION=${JAVA}
-else
- echo "Not running gradle installers"
-fi
-
-if [ $? = 0 ]; then
- if [ -e "/Volumes/$INSTALLERVOL" ]; then
- hdiutil detach "/Volumes/$INSTALLERVOL"
- fi
- if [ -e "$DMG" ]; then
- open $DMG
- else
- echo "No DMG file '$DMG'" 1>&2
- exit 2
- fi
- echo "Mounting '$DMG' at /Volumes"
- N=0
- MOUNTEDAPP="/Volumes/$INSTALLERVOL$WC/$APP.app"
- echo "Waiting for '$MOUNTEDAPP' to appear"
- while [ "$(ls -1 "/Volumes/$INSTALLERVOL"$WC"/$APP.app" 2>/dev/null)" = "" ]; do
- echo -n "."
- N=$(( N+1 ))
- if [ $N = 40 ]; then
- echo ""
- echo "Looks like something wrong with the DMG '$DMG'"
- exit 4
- fi
- sleep 0.1
- done
- INSTALLERVOL="$(ls -1d "/Volumes/Install Jalview Develop "* 2>/dev/null | head -1)"
- INSTALLERVOL=${INSTALLERVOL%/}
- INSTALLERVOL=${INSTALLERVOL#/Volumes/}
- MOUNTEDAPP="/Volumes/$INSTALLERVOL/$APP.app"
- echo ""
-else
- echo "Problem with gradle build: exit code $?"
- exit 3
-fi
-
-if [ -e "$MOUNTEDAPP" ]; then
- echo "Removing '$APPLICATIONS/$APP.app'"
- /bin/rm -r "$APPLICATIONS/$APP.app"
- echo "Syncing '$MOUNTEDAPP' to '$APPLICATIONS/'"
- rsync -avh "$MOUNTEDAPP" "$APPLICATIONS/"
- echo "Unmounting '/Volumes/$INSTALLERVOL'"
- hdiutil detach "/Volumes/$INSTALLERVOL"
-fi