From: Ben Soares Date: Tue, 18 Jun 2024 22:52:25 +0000 (+0100) Subject: JAL-3631 macos dev install script incorporated into dev_install.sh X-Git-Tag: Release_2_11_4_0~24^2~30 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4ff34511d5c6dca2db76db9a12ed7d158bc02d66;p=jalview.git JAL-3631 macos dev install script incorporated into dev_install.sh --- diff --git a/utils/dev_macos_install.sh b/utils/dev_macos_install.sh deleted file mode 100755 index 1e6885a..0000000 --- a/utils/dev_macos_install.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/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