1 #!/bin/bash
   2 
   3 if [ -z ${JAVA_HOME} ]; then
   4   echo "Error: set JAVA_HOME"
   5   exit
   6 fi
   7 

   8 VERSION=1.2
   9 MAC_APPSTORE_ARGS=""
  10 
  11 # Argument parsing.
  12 ARGS=()
  13 for i in "$@"; do
  14   if [[ "$i" == "--MacAppStore" ]]; then
  15     MAC_APPSTORE_ARGS="-BappVersion=${VERSION} -Bmac.CFBundleIdentifier=com.oratest.minesweeper -Bmac.category=\"public.app-category.games\" -Bmac.CFBundleVersion=${VERSION}"
  16   else
  17     ARGS+=("\"$i\"")
  18   fi
  19 done
  20 
  21 echo $MAC_APPSTORE_ARGS
  22 
  23 JAVA=${JAVA_HOME}/bin/java
  24 JAVAC=${JAVA_HOME}/bin/javac
  25 JAVAPACKAGER=${JAVA_HOME}/bin/javapackager
  26 JMODS=${JAVA_HOME}/jmods
  27 JAR=${JAVA_HOME}/bin/jar
  28 MODULES=${JAVA_HOME}/jmods
  29 
  30 rm -rf output
  31 mkdir output
  32 
  33 # Generate ICNS file
  34 PLATFORM=`bash ../whichplatform.sh`
  35 ICON="";
  36 
  37 if [[ $PLATFORM == "MAC" ]]; then
  38   mkdir build
  39   bash ../pngtoicns.sh build/dist/minesweeperfx/resources/MinesweeperFX.png build/MinesweeperFX
  40   ICON="-Bicon.icns=build/MinesweeperFX.icns"
  41 fi
  42 
  43 # Generate app bundle
  44 eval ${JAVAPACKAGER} $(IFS=$' '; echo "${ARGS[*]}") \
  45   -deploy \
  46   -v \
  47   -outdir output \
  48   -name MinesweeperFX \
  49   $ICON \
  50   -native image \
  51   -BsignBundle=false -Bversion=9.0 \
  52   -Bmac.dmg.simple=true \
  53   --module MinesweeperFX/minesweeperfx.MinesweeperFX \
  54   --module-path modules \
  55   -BapplicationCategory=SomeCategory \
  56   ${MAC_APPSTORE_ARGS}
--- EOF ---