From 64b7cb139528efca63d36f647972a620bdff2a03 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 25 May 2015 02:10:11 +0900 Subject: [PATCH 01/16] Create build script for mac app --- Lambda/build-mac-app.sh | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 Lambda/build-mac-app.sh diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh new file mode 100755 index 0000000..23c2dac --- /dev/null +++ b/Lambda/build-mac-app.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +APP_NAME="LambdaMagica.app" +CONTENTS=${APP_NAME}/Contents +EXECUTABLE=${CONTENTS}/MacOS/run.sh + +ant jar + +mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/ + +cat <<'EOF' > ${EXECUTABLE} +#!/bin/sh +DIR=`dirname $0` +java -jar $DIR/lm.jar & +EOF + +chmod +x ${EXECUTABLE} + +cp lambda-magica/lm.jar ${CONTENTS}/MacOS + +cat < ${APP_NAME}/Contents/Info.plist + + + + + CFBundleExecutable + run.sh + CFBundleIconFile + + CFBundleIdentifier + + CFBundleDisplayName + LambdaMagica + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + LambdaMagica + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright (C) YuukiARIA + + +EOF \ No newline at end of file From d36df4a1b149bdd0356bdf3a8b402758b5908548 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 25 May 2015 02:11:07 +0900 Subject: [PATCH 02/16] Fix script --- Lambda/build-mac-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 23c2dac..1344b7c 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -6,7 +6,7 @@ EXECUTABLE=${CONTENTS}/MacOS/run.sh ant jar -mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/ +mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh From ddac55d47a2b42996e9185a0e24136685aa897f6 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 25 May 2015 10:22:58 +0900 Subject: [PATCH 03/16] Fix unclosed tag --- Lambda/build-mac-app.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 1344b7c..8449334 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -23,7 +23,7 @@ cat < ${APP_NAME}/Contents/Info.plist - CFBundleExecutable + CFBundleExecutable run.sh CFBundleIconFile @@ -47,4 +47,4 @@ cat < ${APP_NAME}/Contents/Info.plist Copyright (C) YuukiARIA -EOF \ No newline at end of file +EOF From a038566dadca7d061339121cab33bbf4f2d98111 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 25 May 2015 13:09:08 +0900 Subject: [PATCH 04/16] Enable apple.laf.useScreenMenuBar --- Lambda/build-mac-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 8449334..2d88878 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -11,7 +11,7 @@ mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh DIR=`dirname $0` -java -jar $DIR/lm.jar & +java -Dapple.laf.useScreenMenuBar=true -jar $DIR/lm.jar & EOF chmod +x ${EXECUTABLE} From b2faaabbc01797ee854b6a97488069e518d60084 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 25 May 2015 16:42:18 +0900 Subject: [PATCH 05/16] Add -Xdock:name option --- Lambda/build-mac-app.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 2d88878..c6f47e4 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -11,7 +11,7 @@ mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh DIR=`dirname $0` -java -Dapple.laf.useScreenMenuBar=true -jar $DIR/lm.jar & +java -Xdock:name="Lambda * Magica" -Dapple.laf.useScreenMenuBar=true -jar $DIR/lm.jar & EOF chmod +x ${EXECUTABLE} From a266c01df584f65b61afbcdbc1794c164a282eed Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sat, 24 Oct 2015 22:37:47 +0900 Subject: [PATCH 06/16] Pass dir path of .app as 'user.dir' --- Lambda/build-mac-app.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index c6f47e4..e5cc528 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -11,7 +11,8 @@ mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh DIR=`dirname $0` -java -Xdock:name="Lambda * Magica" -Dapple.laf.useScreenMenuBar=true -jar $DIR/lm.jar & +APP_ROOT=${DIR}/../../.. +java -Xdock:name="Lambda * Magica" -Dapple.laf.useScreenMenuBar=true -Duser.dir=${APP_ROOT} -jar $DIR/lm.jar & EOF chmod +x ${EXECUTABLE} From 9af2a76558a9a8e81c8d688fa448ee567251b393 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 17:54:32 +0900 Subject: [PATCH 07/16] Revise launch script --- Lambda/build-mac-app.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index e5cc528..e1ef8e6 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -12,7 +12,11 @@ cat <<'EOF' > ${EXECUTABLE} #!/bin/sh DIR=`dirname $0` APP_ROOT=${DIR}/../../.. -java -Xdock:name="Lambda * Magica" -Dapple.laf.useScreenMenuBar=true -Duser.dir=${APP_ROOT} -jar $DIR/lm.jar & +java \ + -Xdock:name="LambdaMagica" \ + -Dapple.laf.useScreenMenuBar=true \ + -Duser.dir="${APP_ROOT}" \ + -jar ${DIR}/lm.jar & EOF chmod +x ${EXECUTABLE} From ddd247f5a33b85725b083b7c31c207b6807f3b89 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 18:06:25 +0900 Subject: [PATCH 08/16] Fix path --- Lambda/build-mac-app.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index e1ef8e6..bf2ff68 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -10,8 +10,8 @@ mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh -DIR=`dirname $0` -APP_ROOT=${DIR}/../../.. +DIR=$(cd `dirname $0`; pwd) +APP_ROOT=$(cd ${DIR}/../../..; pwd) java \ -Xdock:name="LambdaMagica" \ -Dapple.laf.useScreenMenuBar=true \ From 6728d93ec41bf935df722db80851d09b64f98d53 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 20:03:29 +0900 Subject: [PATCH 09/16] Fix path variables --- Lambda/build-mac-app.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index bf2ff68..863bd82 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -1,7 +1,11 @@ #!/bin/sh -APP_NAME="LambdaMagica.app" -CONTENTS=${APP_NAME}/Contents +CD=$(cd `dirname $0`; pwd) + +OUTPUT_DIR=${CD}/product +APP_ROOT=${OUTPUT_DIR}/LambdaMagica.app + +CONTENTS=${APP_ROOT}/Contents EXECUTABLE=${CONTENTS}/MacOS/run.sh ant jar @@ -23,7 +27,7 @@ chmod +x ${EXECUTABLE} cp lambda-magica/lm.jar ${CONTENTS}/MacOS -cat < ${APP_NAME}/Contents/Info.plist +cat < ${CONTENTS}/Info.plist From f012971784cd53496cd454c8e94c5e42c0ff3aa9 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 22:07:03 +0900 Subject: [PATCH 10/16] Rename variable --- Lambda/build-mac-app.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 863bd82..e1b3b7d 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -14,13 +14,13 @@ mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cat <<'EOF' > ${EXECUTABLE} #!/bin/sh -DIR=$(cd `dirname $0`; pwd) -APP_ROOT=$(cd ${DIR}/../../..; pwd) +CD=$(cd `dirname $0`; pwd) +APP_ROOT=$(cd ${CD}/../../..; pwd) java \ -Xdock:name="LambdaMagica" \ -Dapple.laf.useScreenMenuBar=true \ -Duser.dir="${APP_ROOT}" \ - -jar ${DIR}/lm.jar & + -jar ${CD}/lm.jar & EOF chmod +x ${EXECUTABLE} From da2be0ae4e08cf7ca1ee481fff858a23f3b92ee7 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 22:41:16 +0900 Subject: [PATCH 11/16] Export Info.plist and run.sh --- Lambda/assets/osx/Info.plist | 28 ++++++++++++++++++++++++++++ Lambda/assets/osx/run.sh | 8 ++++++++ 2 files changed, 36 insertions(+) create mode 100755 Lambda/assets/osx/Info.plist create mode 100755 Lambda/assets/osx/run.sh diff --git a/Lambda/assets/osx/Info.plist b/Lambda/assets/osx/Info.plist new file mode 100755 index 0000000..c0ea50b --- /dev/null +++ b/Lambda/assets/osx/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleExecutable + run.sh + CFBundleIconFile + + CFBundleIdentifier + + CFBundleDisplayName + LambdaMagica + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + LambdaMagica + CFBundlePackageType + APPL + CFBundleShortVersionString + + CFBundleSignature + ???? + CFBundleVersion + 1 + NSHumanReadableCopyright + Copyright (C) YuukiARIA + + diff --git a/Lambda/assets/osx/run.sh b/Lambda/assets/osx/run.sh new file mode 100755 index 0000000..fc6d883 --- /dev/null +++ b/Lambda/assets/osx/run.sh @@ -0,0 +1,8 @@ +#!/bin/sh +CD=$(cd `dirname $0`; pwd) +APP_ROOT=$(cd ${CD}/../../..; pwd) +java \ + -Xdock:name="LambdaMagica" \ + -Dapple.laf.useScreenMenuBar=true \ + -Duser.dir="${APP_ROOT}" \ + -jar ${CD}/lm.jar & From 36429326a71f3f461ee9728228e270cb343c6458 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 22:41:57 +0900 Subject: [PATCH 12/16] Revise build-mac-app script to use assets --- Lambda/build-mac-app.sh | 44 ++--------------------------------------- 1 file changed, 2 insertions(+), 42 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index e1b3b7d..01fec75 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -12,48 +12,8 @@ ant jar mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources -cat <<'EOF' > ${EXECUTABLE} -#!/bin/sh -CD=$(cd `dirname $0`; pwd) -APP_ROOT=$(cd ${CD}/../../..; pwd) -java \ - -Xdock:name="LambdaMagica" \ - -Dapple.laf.useScreenMenuBar=true \ - -Duser.dir="${APP_ROOT}" \ - -jar ${CD}/lm.jar & -EOF - +cp assets/osx/run.sh ${EXECUTABLE} chmod +x ${EXECUTABLE} cp lambda-magica/lm.jar ${CONTENTS}/MacOS - -cat < ${CONTENTS}/Info.plist - - - - - CFBundleExecutable - run.sh - CFBundleIconFile - - CFBundleIdentifier - - CFBundleDisplayName - LambdaMagica - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - LambdaMagica - CFBundlePackageType - APPL - CFBundleShortVersionString - - CFBundleSignature - ???? - CFBundleVersion - 1 - NSHumanReadableCopyright - Copyright (C) YuukiARIA - - -EOF +cp assets/osx/Info.plist ${CONTENTS} From 75b3ecdc15961b5f7963914ad6858c4f003af90d Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Sun, 25 Oct 2015 22:43:42 +0900 Subject: [PATCH 13/16] Add .DS_Store to toplevel .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e43b0f9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.DS_Store From 9642315324cbbe6b69a4eaa0ef830505434e13dd Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 26 Oct 2015 01:32:09 +0900 Subject: [PATCH 14/16] Remove 'ant jar' from build-mac-app script --- Lambda/build-mac-app.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 01fec75..3ab2f35 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -2,18 +2,22 @@ CD=$(cd `dirname $0`; pwd) +JAR=${CD}/lambda-magica/lm.jar +if [ ! -e ${JAR} ]; then + echo "Error: lm.jar not found. Run 'ant jar' first." + exit 1 +fi + OUTPUT_DIR=${CD}/product APP_ROOT=${OUTPUT_DIR}/LambdaMagica.app CONTENTS=${APP_ROOT}/Contents EXECUTABLE=${CONTENTS}/MacOS/run.sh -ant jar - mkdir -p ${CONTENTS}/MacOS ${CONTENTS}/Resources cp assets/osx/run.sh ${EXECUTABLE} chmod +x ${EXECUTABLE} -cp lambda-magica/lm.jar ${CONTENTS}/MacOS +cp ${JAR} ${CONTENTS}/MacOS cp assets/osx/Info.plist ${CONTENTS} From 3f2592016d8cc68382595f4ece6e7102b7154013 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 26 Oct 2015 01:41:44 +0900 Subject: [PATCH 15/16] Delete existing LambdaMagica.app before building --- Lambda/build-mac-app.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Lambda/build-mac-app.sh b/Lambda/build-mac-app.sh index 3ab2f35..ccc2c38 100755 --- a/Lambda/build-mac-app.sh +++ b/Lambda/build-mac-app.sh @@ -11,6 +11,11 @@ fi OUTPUT_DIR=${CD}/product APP_ROOT=${OUTPUT_DIR}/LambdaMagica.app +if [ -e ${APP_ROOT} ]; then + echo "Deleting existing ${APP_ROOT}" + rm -r ${APP_ROOT} +fi + CONTENTS=${APP_ROOT}/Contents EXECUTABLE=${CONTENTS}/MacOS/run.sh From 2e8c997803bfdde07b37b3b74df41b743a1e1236 Mon Sep 17 00:00:00 2001 From: YuukiARIA Date: Mon, 26 Oct 2015 03:08:04 +0900 Subject: [PATCH 16/16] Add ant tasks for building mac osx package --- Lambda/build.xml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Lambda/build.xml b/Lambda/build.xml index 613516d..0c6edb0 100644 --- a/Lambda/build.xml +++ b/Lambda/build.xml @@ -18,6 +18,7 @@ + @@ -60,6 +61,10 @@ + + + + @@ -74,6 +79,24 @@ + + + + + + + + + + + + + + + + + +