Skip to content

Commit

Permalink
compile the stub launcher for macOS 10.15 Catalina
Browse files Browse the repository at this point in the history
  • Loading branch information
tofi86 committed Jul 13, 2020
1 parent eba08c2 commit 3f4c935
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/build/mac-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,22 @@ set -e
# build file paths
APP_PATH="${MVN_BUILDDIR}/${APP_NAME}.app"
DMG_PATH="${MVN_BUILDDIR}/${APP_NAME}.dmg"
STUB_PATH="${APP_PATH}/Contents/MacOS/universalJavaApplicationStub"


# update App Info.plist with an additional key
/usr/libexec/PlistBuddy -c "Add :NSAppleEventsUsageDescription string There was an error while launching ${APP_NAME_LONG}. Please click OK to display a dialog with more information or cancel and view the syslog for details." \
"${APP_PATH}/Contents/Info.plist"


# compile the universalJavaApplicationStub shell script to binary with 'shc'
# https://github.com/tofi86/universalJavaApplicationStub/issues/85#issuecomment-651986038
which shc || ( brew install shc )
shc -r -f "${STUB_PATH}"
rm "${STUB_PATH}" "${STUB_PATH}.x.c"
mv "${STUB_PATH}.x" "${STUB_PATH}"


# codesign the Mac App
/usr/bin/codesign --force --verbose --options runtime --sign "${APPLE_SIGN_ID}" "${APP_PATH}"
# verify the signature
Expand Down

0 comments on commit 3f4c935

Please sign in to comment.