1 #!/bin/bash
   2 
   3 if [ -z ${JAVA_HOME} ]; then
   4   echo "Error: set JAVA_HOME"
   5   exit
   6 fi
   7 
   8 PLATFORM=`bash ../whichplatform.sh`
   9 VERSION=1.2
  10 MAC_APPSTORE_ARGS=""
  11 
  12 # Argument parsing.
  13 ARGS=()
  14 for i in "$@"; do
  15   if [[ "$i" == "--MacAppStore" ]]; then
  16     MAC_APPSTORE_ARGS="-BappVersion=${VERSION} -Bmac.CFBundleIdentifier=com.oratest.minesweeper -Bmac.category=\"public.app-category.games\" -Bmac.CFBundleVersion=${VERSION}"
  17   else
  18     ARGS+=("\"$i\"")
  19   fi
  20 done
  21 
  22 echo $MAC_APPSTORE_ARGS
  23 
  24 JAVA=${JAVA_HOME}/bin/java
  25 JAVAC=${JAVA_HOME}/bin/javac
  26 JAVAPACKAGER=${JAVA_HOME}/bin/javapackager
  27 JMODS=${JAVA_HOME}/jmods
  28 JAR=${JAVA_HOME}/bin/jar
  29 MODULES=${JAVA_HOME}/jmods
  30 
  31 rm -rf output
  32 mkdir output
  33 
  34 # Generate ICNS file

  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 \
  51   -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 ---