1 | <?xml version="1.0" encoding="utf-8" ?>
|
---|
2 | <project name="mark2-wrap" default="wrap">
|
---|
3 |
|
---|
4 | <target name="wrap">
|
---|
5 | <if><bool><istrue value="${execute}"/></bool>
|
---|
6 |
|
---|
7 | <!-- create and setup the build directory -->
|
---|
8 | <delete dir="${basedir}/wrapped-installer"/>
|
---|
9 | <mkdir dir="${basedir}/wrapped-installer"/>
|
---|
10 | <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${mark2.home}/mac/Wrapper.app"/></copy>
|
---|
11 | <chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
|
---|
12 |
|
---|
13 | <!-- copy bundled files -->
|
---|
14 | <!--<copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${mark2.home}/linux/${linux-java.installer}"/>-->
|
---|
15 | <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-MacOS-x86.jar"/>
|
---|
16 |
|
---|
17 | <!-- substitute in real values -->
|
---|
18 | <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-MacOS-x86.jar"/>
|
---|
19 | <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
|
---|
20 |
|
---|
21 | <!-- get size of app -->
|
---|
22 | <exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
|
---|
23 | <echo>app.du: ${app.du}</echo>
|
---|
24 | <exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
|
---|
25 | <echo>app.size: ${app.size}</echo>
|
---|
26 | <math result="dmg.size" operand1="${app.size}" operation="+" operand2="2048" datatype="int"/>
|
---|
27 | <echo>dmg.size: ${dmg.size}</echo>
|
---|
28 |
|
---|
29 | <!-- create disk image -->
|
---|
30 | <exec dir="${basedir}/wrapped-installer" executable="hdiutil"><arg line="create -size ${dmg.size}k -fs HFS+ -volname Greenstone${version} Greenstone${version}.dmg"/></exec>
|
---|
31 | <!-- mount it -->
|
---|
32 | <exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="attach Greenstone${version}.dmg"/></exec>
|
---|
33 | <!-- copy file into it -->
|
---|
34 | <exec executable="cp" dir="${basedir}/wrapped-installer"><arg line="-r Greenstone${version}.app /Volumes/Greenstone${version}"/></exec>
|
---|
35 | <!-- unmount it-->
|
---|
36 | <exec executable="hdiutil" dir="${basedir}/wrapped-installer"><arg line="detach /Volumes/Greenstone${version}"/></exec>
|
---|
37 | </if>
|
---|
38 | </target>
|
---|
39 |
|
---|
40 | </project>
|
---|