JAL-3449 Using tidied build.gradle and gradle.properties from Jalview-JS/develop
[jalview.git] / utils / dev_macos_install.sh
1 #!/usr/bin/env bash
2
3 # perform a dev build and install on local macOS machine
4 INSTALLERVOL="Jalview Installer"
5 APP=Jalview.app
6
7 APPLICATIONS=/Applications
8 CHANNEL=NOCHANNEL
9 DMG=build/install4j/1.8/Jalview-OFFLINE_macos-app_DEVELOPMENT-j8.dmg
10
11 if [ $1 != "nogradle" ]; then
12   gradle installers -Pgetdown_channel_name=NOCHANNEL -Pinstall4jMediaTypes=macosArchive -Pgetdown_local=true -Pdev=true
13 else
14   echo "Not running gradle installers"
15 fi
16
17 if [ $? = 0 ]; then
18   umount "/Volumes/$INSTALLERVOL"
19   if [ -e "$DMG" ]; then
20     open $DMG
21   else
22     echo "No DMG file '$DMG'" 1>&2
23     exit 1
24   fi
25   echo "Mounting '$DMG' at /Volumes"
26   N=0
27   while [ \! -e "/Volumes/$INSTALLERVOL/$APP" ]; do
28     if [ $(( N%1000 )) = 0 ]; then
29       echo -n "."
30     fi
31     N=$(( N+1 ))
32   done
33   echo ""
34 fi
35 if [ -e "/Volumes/$INSTALLERVOL/$APP" ]; then
36   /bin/rm -r "$APPLICATIONS/$APP"
37   rsync -avh "/Volumes/$INSTALLERVOL/$APP" "$APPLICATIONS/"
38   umount "/Volumes/$INSTALLERVOL"
39 fi