Skip to content

Added macOS application bundle build target #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Miscellaneous:
- Generated X.509 certificates are now version 3 ones.
- Bundled Bouncy Castle jars upgraded to version 1.58; 1.56 is the new
minimum required version.
- Portecle is now also distributed as unsigned macOS application bundle

New in Portecle 1.10 (2016-02-04):
----------------------------------
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ If you wish to manage the jar locations yourself, use Java's `-cp`
option for that, and `net.sf.portecle.FPortecle` as the class to
launch.

### macOS Application Bundle

As of v1.11 a macOS application bundle is available and provides an
alternative way to run Portecle on your Mac. Unzip `portecle.app.zip` and
CTRL-Right-Click on the extracted Portecle.app bundle. macOS will warn you
about the fact that the bundle is not signed but allows you to run it
anyway (this procedure is only required the first time you run Protecle).

### Experimental Features

Portecle releases may contain experimental features that are not
Expand Down
26 changes: 25 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,30 @@
fullpath="portecle-${version}/bcpkix.jar" />
</p:zip>
</target>

<target name="macdist" depends="jar"
description="Builds the Portecle application bundle for macOS">
<mkdir dir="${dist}" />
<p:zip destfile="${dist}/portecle-${version}.app.zip">
<zipfileset prefix="Portecle.app"
dir="${root}" includes="README.md,LICENSE.txt,NEWS.txt" />
<zipfileset prefix="Portecle.app/Contents"
dir="${src}/etc" includes="Info.plist" />
<zipfileset prefix="Portecle.app/Contents/MacOS"
dir="${src}/etc" filemode="755" includes="JavaAppLauncher" />
<zipfileset prefix="Portecle.app/Contents/Resources"
dir="${lib}" includes="LICENSE.bouncycastle.txt" />
<zipfileset prefix="Portecle.app/Contents/Resources/en.lproj"
dir="${src}/etc" includes="Localizable.strings" />
<zipfileset prefix="Portecle.app/Contents/Resources"
dir="${src}/icons" includes="icns/portecle*.*" />
<zipfileset prefix="Portecle.app/Contents/Java" file="${build}/${jar}" />
<zipfileset file="${bcprov.jar}"
fullpath="Portecle.app/Contents/Java/bcprov.jar" />
<zipfileset file="${bcpkix.jar}"
fullpath="Portecle.app/Contents/Java/bcpkix.jar" />
</p:zip>
</target>

<target name="srcdist"
description="Builds the Portecle source distribution">
Expand All @@ -287,7 +311,7 @@
</p:zip>
</target>

<target name="dist" depends="srcdist,bindist"
<target name="dist" depends="srcdist,bindist,macdist"
description="Builds Portecle distributions" />

<target name="all" depends="dist,javadoc"
Expand Down
66 changes: 66 additions & 0 deletions src/etc/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<?xml version="1.0" ?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>

<key>CFBundleExecutable</key>
<string>JavaAppLauncher</string>

<key>CFBundleIconFile</key>
<string>icns/portecle.icns</string>

<key>CFBundleIdentifier</key>
<string>net.sf.portecle</string>

<key>CFBundleDisplayName</key>
<string>Portecle</string>

<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>

<key>CFBundleName</key>
<string>Portecle</string>

<key>CFBundlePackageType</key>
<string>APPL</string>

<key>NSPrincipalClass</key>
<string>NSApplication</string>

<key>NSHighResolutionCapable</key>
<string>True</string>

<key>CFBundleSignature</key>
<string>????</string>

<key>CFBundleVersion</key>
<string>1.11</string>

<key>NSHumanReadableCopyright</key>
<string>Copyright © 2004 Wayne Grant, 2004 Mark Majczyk,
2004-2017 Ville Skyttä

Portecle is licensed under GNU GPLv2 and comes with ABSOLUTELY NO WARRANTY.

</string>

<key>JVMVersion</key>
<string>1.7+</string>

<key>JVMMainClassName</key>
<string>net.sf.portecle.FPortecle</string>

<key>JVMOptions</key>
<array>
<string>-Dapple.laf.useScreenMenuBar=true</string>
<string>-Duser.dir=$APP_ROOT/Contents</string>
<string>-Xdock:name=Portecle</string>
</array>

<key>JVMArguments</key>
<array/>

</dict>
</plist>
Binary file added src/etc/JavaAppLauncher
Binary file not shown.
3 changes: 3 additions & 0 deletions src/etc/Localizable.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"JRELoadError" = "Unable to load Java Runtime Environment.";
"MainClassNameRequired" = "Main class name is required.";
"JavaDirectoryNotFound" = "Unable to enumerate Java directory contents.";
Binary file added src/icons/icns/portecle-alt1.icns
Binary file not shown.
Binary file added src/icons/icns/portecle-alt2.icns
Binary file not shown.
Binary file added src/icons/icns/portecle-alt3.icns
Binary file not shown.
Binary file added src/icons/icns/portecle.icns
Binary file not shown.