Skip to content

Commit

Permalink
Fixed macOS application
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernie Jenny committed Mar 31, 2017
1 parent 231a171 commit a8db106
Show file tree
Hide file tree
Showing 13 changed files with 75 additions and 61 deletions.
47 changes: 31 additions & 16 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,34 +66,46 @@
nbproject/build-impl.xml file.
-->


<taskdef name="macbundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="mac/appbundler-1.0.jar" />

<target name="run.macappbundler">
<macbundleapp outputdirectory="mac/"
name="Flex Projector"
displayname="Flex Projector"
identifier="${main.class}"
mainclassname="${main.class}"
icon="mac/icon.icns"
shortversion="1.0.2"
copyright="© Bernhard Jenny 2007–2017"
applicationCategory="public.app-category.graphics-design">
<classpath file="${dist.jar}" />
<option value="-Dapple.laf.useScreenMenuBar=true"/>
<option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
<option value="-Dapple.awt.application.name=Flex Projector"/>
<option value="-Xmx1000m"/>
</macbundleapp>
<zip destfile="mac/FlexProjectorMac.zip" level="9">
<zipfileset filemode="755" dir="mac/Flex Projector.app" prefix="Flex Projector.app" />
</zip>
</target>

<target name="-post-jar">

<!-- Combine all jar files into a single jar. -->
<jar compress="true" destfile="${dist.jar}" update="true">
<zipfileset src="lib/JMapProjLib.jar"/>
<zipfileset src="${libs.swing-layout.classpath}"/>
<zipfileset src="lib/jai_imageio.jar"/>
<zipfileset src="lib/MRJAdapter.jar"/>
<zipfileset src="lib/iText-2.1.3.jar"/>
<manifest>
<attribute value="${main.class}" name="Main-Class"/>
</manifest>
</jar>

<!-- Create a Mac OS X program: copy the jar file into the app bundle. -->
<copy overwrite="true" file="./dist/FlexProjector.jar"
tofile="./mac/Flex Projector.app/Contents/Resources/Java/FlexProjector.jar"/>

<!-- change the modification date of the Mac OS X app bundle. This does
not change the creation data unfortunately-->
<touch>
<fileset dir="./mac/Flex Projector.app/" casesensitive="yes"/>
</touch>

<zip destfile="./mac/FlexProjectorMac.zip" level="9">
<zipfileset filemode="755" dir="mac/Flex Projector.app" prefix="Flex Projector.app" />
</zip>

<!-- Zip jar file in dist folder -->
<zip destfile="FlexProjectorJar.zip">
<fileset dir="./dist/" includes="FlexProjector.jar"/>
Expand All @@ -110,7 +122,10 @@
<!-- Zip the generated exe file -->
<zip destfile="win/FlexProjectorWin.zip">
<fileset dir="." includes="win/FlexProjector.exe"/>
</zip>
</zip>

<antcall target="run.macappbundler"/>

</target>

<target name="-post-clean">
Expand Down
2 changes: 1 addition & 1 deletion build/built-jar.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Fri, 31 Mar 2017 11:34:31 +1100
#Fri, 31 Mar 2017 12:00:06 +1100


/Users/jennyb/Documents/Java/FlexProjector=
Binary file modified dist/FlexProjector.jar
Binary file not shown.
Binary file removed dist/lib/MRJAdapter.jar
Binary file not shown.
Binary file removed lib/MRJAdapter.jar
Binary file not shown.
79 changes: 40 additions & 39 deletions mac/Flex Projector.app/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -1,44 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<?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>CFBundleAllowMixedLocalizations</key>
<string>true</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleGetInfoString</key>
<string>Flex Projector © Bernhard Jenny 2007-2015</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Flex Projector</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>Java</key>
<dict>
<key>ClassPath</key>
<string>$JAVAROOT/FlexProjector.jar</string>
<key>JVMVersion</key>
<string>1.6*</string>
<key>MainClass</key>
<string>ika.app.Main</string>
<key>Properties</key>
<dict>
<key>apple.laf.useScreenMenuBar</key>
<string>true</string>
</dict>
<key>VMOptions</key>
<string>-Xms64m -Xmx2000m</string>
</dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>JavaAppLauncher</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>ika.app.Main</string>
<key>CFBundleDisplayName</key>
<string>Flex Projector</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Flex Projector</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSHumanReadableCopyright</key>
<string>© Bernhard Jenny 2007–2017</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.graphics-design</string>
<key>JVMMainClassName</key>
<string>ika.app.Main</string>
<key>JVMOptions</key>
<array>
<string>-Dapple.laf.useScreenMenuBar=true</string>
<string>-Dcom.apple.macos.useScreenMenuBar=true</string>
<string>-Dapple.awt.application.name=Flex Projector</string>
<string>-Xmx1000m</string>
</array>
<key>JVMArguments</key>
<array>
</array>
</dict>
</plist>

Binary file not shown.
Binary file not shown.
Binary file not shown.
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 mac/appbundler-1.0.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ file.reference.iText-2.1.3.jar=lib/iText-2.1.3.jar
file.reference.jai_imageio.jar=lib/jai_imageio.jar
file.reference.JMapProjLib.jar=lib/JMapProjLib.jar
file.reference.l2fprod-common-fontchooser.jar=lib/l2fprod-common-fontchooser.jar
file.reference.MRJAdapter.jar=lib/MRJAdapter.jar
includes=**
jar.archive.disabled=${jnlp.enabled}
jar.compress=false
jar.index=${jnlp.enabled}
javac.classpath=\
${file.reference.JMapProjLib.jar}:\
${file.reference.MRJAdapter.jar}:\
${file.reference.jai_imageio.jar}:\
${file.reference.l2fprod-common-fontchooser.jar}:\
${file.reference.iText-2.1.3.jar}:\
Expand Down
3 changes: 0 additions & 3 deletions src/ika/gui/MacWindowsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@

package ika.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import net.roydesign.mac.MRJAdapter;

/**
* Mac OS X specific code. Integrates a Java application to the standard Mac
Expand Down

0 comments on commit a8db106

Please sign in to comment.