Skip to content

Commit

Permalink
Update macosx launcher scripts to use Oracle's appbundler for Java 7.…
Browse files Browse the repository at this point in the history
… Apple's bundler supports Java 6 only.
  • Loading branch information
wolfgangmm committed Sep 23, 2013
1 parent 6a57465 commit 4120837
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 77 deletions.
36 changes: 26 additions & 10 deletions build/scripts/installer.xml
Expand Up @@ -9,21 +9,43 @@


<!-- import common targets --> <!-- import common targets -->
<import file="../../build.xml"/> <import file="../../build.xml"/>

<import file="../../build/scripts/macosx.xml"/>

<taskdef resource="net/sf/antcontrib/antcontrib.properties"> <taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath> <classpath>
<pathelement location="tools/ant/lib/ant-contrib-1.0b3.jar"/> <pathelement location="tools/ant/lib/ant-contrib-1.0b3.jar"/>
</classpath> </classpath>
</taskdef> </taskdef>


<property name="apps.dir" value="installer/apps"/> <property name="apps.dir" value="installer/apps"/>
<property name="installer.scripts" value="installer/scripts"/>
<property name="installer.mac.icon" value="${installer.scripts}/icon.icns"/>

<property file="installer/apps.properties"/> <property file="installer/apps.properties"/>


<target name="commandline-installer"> <target name="commandline-installer">
<!--ant antfile="build.xml" dir="tools/izpack"/--> <!--ant antfile="build.xml" dir="tools/izpack"/-->
</target> </target>


<target depends="all,samples,xars,copy_scripts" name="prepare-installer"> <target name="macosx" depends="install-appbundler">
<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${appbundler.jar}" />
<bundleapp
outputdirectory="${installer.scripts}"
name="eXist-db"
displayname="eXist-db"
identifier="org.exist.start.Main"
mainclassname="org.exist.start.Main"
shortversion="${project.version.numeric}"
icon="${installer.mac.icon}">
<classpath file="start.jar"/>
<option value="-Dexist.home=$APP_ROOT/.."/>
</bundleapp>
</target>

<target depends="all,samples,xars,copy_scripts,macosx" name="prepare-installer">
<path id="izpackdeps"> <path id="izpackdeps">
<fileset dir="${izpack.dir}/lib/"> <fileset dir="${izpack.dir}/lib/">
<include name="*.jar"/> <include name="*.jar"/>
Expand All @@ -38,14 +60,6 @@
<delete dir="${jetty.dir}/work/Jetty__8080__exist"/> <delete dir="${jetty.dir}/work/Jetty__8080__exist"/>
<touch file="webapp/WEB-INF/logs/exist.log"/> <touch file="webapp/WEB-INF/logs/exist.log"/>
<touch file="webapp/WEB-INF/logs/xmldb.log"/> <touch file="webapp/WEB-INF/logs/xmldb.log"/>
<copy file="installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl"
tofile="installer/scripts/eXist-db.mac/Contents/Info.plist" filtering="true"
overwrite="true">
<filterset>
<filter token="vmoptions" value=""/>
<filter token="classpath" value="$APP_PACKAGE/.."/>
</filterset>
</copy>
</target> </target>


<target name="clean-installer-xars-dir" description="Remove installer apps.dir directory"> <target name="clean-installer-xars-dir" description="Remove installer apps.dir directory">
Expand Down Expand Up @@ -131,6 +145,8 @@
<izpack input="installer/install.xml" <izpack input="installer/install.xml"
output="${inst-jar}" output="${inst-jar}"
basedir="." izPackDir="${izpack.dir}" basedir="." izPackDir="${izpack.dir}"
compression="bzip2"
compressionlevel="9"
installerType="standard"/> installerType="standard"/>


<!--mkdir dir="installer/temp"/> <!--mkdir dir="installer/temp"/>
Expand Down
74 changes: 51 additions & 23 deletions build/scripts/macosx.xml
Expand Up @@ -4,7 +4,7 @@
<!-- Call target "dmg" to create dmg file --> <!-- Call target "dmg" to create dmg file -->
<!-- ======================================================================= --> <!-- ======================================================================= -->
<!-- $Id$ --> <!-- $Id$ -->
<project basedir="../.." default="dmg" name="Mac OS App"> <project basedir="../.." default="all" name="Mac OS App">


<description>Build installer</description> <description>Build installer</description>


Expand All @@ -15,31 +15,51 @@
<property name="app.dir" value="${dist}/eXist-db.app"/> <property name="app.dir" value="${dist}/eXist-db.app"/>
<property name="app.resources" value="${app.dir}/Contents/Resources"/> <property name="app.resources" value="${app.dir}/Contents/Resources"/>
<property name="app.exist" value="${app.resources}/eXist-db"/> <property name="app.exist" value="${app.resources}/eXist-db"/>
<property name="app.icon" value="installer/scripts/icon.icns"/>
<property name="codesign.identity" value="Lars Windauer"/>
<property name="appbundler.jar" value="${tools.ant}/lib/appbundler-1.0.jar"/>
<property name="appbundler.url" value="http://java.net/downloads/appbundler/appbundler-1.0.jar"/>


<target name="package" depends="jar,create-skeleton,copy-all"/> <available property="appbundler.available" file="${appbundler.jar}"/>

<target name="app" description="Build Mac OS X dmg (unsigned)" depends="bundle,copy-all,dmg"/>

<target name="app-signed" description="Build Mac OS X dmg (signed)" depends="bundle,copy-all,codesign,dmg"/>

<target name="install-appbundler" unless="appbundler.available">
<taskdef name="fetch" classname="nl.ow.dilemma.ant.fetch.FetchTask">
<classpath>
<pathelement location="${tools.ant}/lib/asocat-exist.jar"/>
</classpath>
</taskdef>

<fetch dest="${tools.ant}/lib" url="${appbundler.url}"
failonerror="false" maxtime="120"/>
</target>

<target name="bundle" depends="prepare">
<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${appbundler.jar}" />
<bundleapp
outputdirectory="${dist}"
name="eXist-db"
displayname="eXist-db"
identifier="org.exist.start.Main"
mainclassname="org.exist.start.Main"
shortversion="${project.version.numeric}"
icon="${app.icon}">
<classpath file="start.jar"/>
<option value="-Dexist.home=$APP_ROOT/Contents/Resources/eXist-db"/>
</bundleapp>
</target>


<target name="prepare" depends="xars"> <target name="prepare" depends="install-appbundler,xars">
<delete failonerror="false" dir="${app.dir}"/> <delete failonerror="false" dir="${app.dir}"/>
<mkdir dir="${dist}"/> <mkdir dir="${dist}"/>
</target> </target>


<target name="create-skeleton" depends="prepare">
<copy todir="${app.dir}">
<fileset dir="installer/scripts/eXist-db.mac">
<exclude name=".svn"/>
<exclude name="Info.plist.tmpl"/>
</fileset>
</copy>
<copy file="installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl"
tofile="${app.dir}/Contents/Info.plist" filtering="true" overwrite="true">
<filterset>
<filter token="vmoptions" value="-Dexist.home=$APP_PACKAGE/Contents/Resources/eXist-db"/>
<filter token="classpath" value="$APP_PACKAGE/Contents/Resources/eXist-db"/>
</filterset>
</copy>
<mkdir dir="${app.exist}"/>
</target>

<target name="copy-apps"> <target name="copy-apps">
<copy todir="${app.exist}/autodeploy"> <copy todir="${app.exist}/autodeploy">
<fileset dir="${basedir}/installer/apps"> <fileset dir="${basedir}/installer/apps">
Expand Down Expand Up @@ -73,7 +93,6 @@
<include name="exist-modules.jar"/> <include name="exist-modules.jar"/>
<include name="exist-fluent.jar"/> <include name="exist-fluent.jar"/>
<include name="start.jar"/> <include name="start.jar"/>
<include name="start.exe"/>
<include name="examples.jar"/> <include name="examples.jar"/>
<include name="mime-types.xml.tmpl"/> <include name="mime-types.xml.tmpl"/>
<include name="mime-types.xml"/> <include name="mime-types.xml"/>
Expand Down Expand Up @@ -124,7 +143,7 @@
<exclude name="jetty/tmp/*"/> <exclude name="jetty/tmp/*"/>
<exclude name="jetty/work/*"/> <exclude name="jetty/work/*"/>
<exclude name="ircbot/**"/> <exclude name="ircbot/**"/>
<include name="aspectj/**"/> <exclude name="aspectj/**"/>
<exclude name="izpack/**"/> <exclude name="izpack/**"/>
<exclude name="ant/lib/svnkit*.jar"/> <exclude name="ant/lib/svnkit*.jar"/>
<include name="jmx/**"/> <include name="jmx/**"/>
Expand Down Expand Up @@ -163,8 +182,17 @@
</chmod> </chmod>
</target> </target>


<target name="codesign" description="Codesign .app">
<exec executable="/usr/bin/codesign" os="Mac OS X" failonerror="true">
<arg value="-f"/>
<arg value="-s"/>
<arg value="${codesign.identity}"/>
<arg value="${app.dir}"/>
</exec>
</target>

<!-- Create a DMG - This only works on MacOSX (requires hdiutil) --> <!-- Create a DMG - This only works on MacOSX (requires hdiutil) -->
<target name="dmg" depends="package" description="Create a DMG package for MacOSX (only works on MacOSX)"> <target name="dmg" description="Create a DMG package for MacOSX (only works on MacOSX)">


<!-- Set this property value to your application name --> <!-- Set this property value to your application name -->
<property name="app.name" value="${project.name}"/> <property name="app.name" value="${project.name}"/>
Expand Down
8 changes: 4 additions & 4 deletions installer/install.xml.tmpl
Expand Up @@ -7,7 +7,7 @@
<requiresjdk>no</requiresjdk> <requiresjdk>no</requiresjdk>
<run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/> <run-privileged condition="izpack.windowsinstall.vista|izpack.windowsinstall.7"/>
<uninstaller name="uninstall.jar" path="$INSTALL_PATH"/> <uninstaller name="uninstall.jar" path="$INSTALL_PATH"/>
<!--pack200/--> <pack200/>
</info> </info>


<guiprefs height="510" resizable="yes" width="680"> <guiprefs height="510" resizable="yes" width="680">
Expand Down Expand Up @@ -150,7 +150,7 @@
<exclude name="ant/lib/javasvn*.jar"/> <exclude name="ant/lib/javasvn*.jar"/>
<include name="jetty/**"/> <include name="jetty/**"/>
<exclude name="jetty/logs/*"/> <exclude name="jetty/logs/*"/>
<exclude name="jetty/tmp/*"/> <exclude name="jetty/tmp/**"/>
<exclude name="jetty/work/*"/> <exclude name="jetty/work/*"/>
<exclude name="ircbot/**"/> <exclude name="ircbot/**"/>
<exclude name="ant/lib/svnkit*.jar"/> <exclude name="ant/lib/svnkit*.jar"/>
Expand Down Expand Up @@ -200,10 +200,10 @@
<include name="backup.bat"/> <include name="backup.bat"/>
</fileset> </fileset>


<fileset dir="installer/scripts/eXist-db.mac" targetdir="$INSTALL_PATH/eXist-db.app"> <fileset dir="installer/scripts/eXist-db.app" targetdir="$INSTALL_PATH/eXist-db.app">
<exclude name="**/.svn/"/> <exclude name="**/.svn/"/>
</fileset> </fileset>
<executable targetfile="$INSTALL_PATH/eXist-db.app/Contents/MacOS/JavaApplicationStub" <executable targetfile="$INSTALL_PATH/eXist-db.app/Contents/MacOS/JavaAppLauncher"
stage="never" os="unix"/> stage="never" os="unix"/>


<fileset dir="bin/functions.d" targetdir="$INSTALL_PATH/bin/functions.d"> <fileset dir="bin/functions.d" targetdir="$INSTALL_PATH/bin/functions.d">
Expand Down
39 changes: 0 additions & 39 deletions installer/scripts/eXist-db.mac/Contents/Info.plist.tmpl

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion installer/scripts/eXist-db.mac/Contents/PkgInfo

This file was deleted.

File renamed without changes.

0 comments on commit 4120837

Please sign in to comment.