root/release-kits/mark2/ant-scripts/wrap.xml @ 19510

Revision 19510, 3.2 KB (checked in by oranfry, 10 years ago)

main release kits now create their own cdrom installers and wrap them

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="mark2-wrap" default="wrap">
3
4    <target name="wrap">
5
6        <!-- create products directory -->
7        <mkdir dir="products"/>
8
9        <!-- create and setup the build directory -->
10        <delete dir="${basedir}/wrapped-installer"/>
11        <mkdir dir="${basedir}/wrapped-installer"/>
12
13        <!-- create app for main installer -->
14            <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app"><fileset dir="${mark2.home}/mac/Wrapper.app"/></copy>
15            <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources" file="${mark2.home}/greenstone2/icon/icon.icns"/>
16            <chmod file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
17
18            <!-- copy bundled files -->
19            <copy todir="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Resources/Java" file="${basedir}/installer/Greenstone-${version}-MacOS-${processor}.jar"/>
20
21            <!-- substitute in real values -->
22            <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@jar@" replacement="Greenstone-${version}-MacOS-${processor}.jar"/>
23            <rsr file="${basedir}/wrapped-installer/Greenstone${version}.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
24
25
26        <!-- create app for cdrom installer -->
27            <copy todir="${basedir}/products/cdrom.app"><fileset dir="${mark2.home}/mac/Wrapper.app"/></copy>
28            <copy todir="${basedir}/products/cdrom.app/Contents/Resources" file="${mark2.home}/greenstone2/icon/icon.icns"/>
29            <chmod file="${basedir}/products/cdrom.app/Contents/MacOS/JavaApplicationStub" perm="ug+x"/>
30
31            <!-- copy bundled files -->
32            <copy todir="${basedir}/products/cdrom.app/Contents/Resources/Java" file="${basedir}/installer/cdrom.jar"/>
33
34            <!-- substitute in real values -->
35            <rsr file="${basedir}/products/cdrom.app/Contents/Info.plist" pattern="@jar@" replacement="cdrom.jar"/>
36            <rsr file="${basedir}/products/cdrom.app/Contents/Info.plist" pattern="@version@" replacement="${version}"/>
37
38        <!-- wrap main app in a dmg -->
39
40        <!-- get size of app -->
41        <exec executable="du" dir="${basedir}/wrapped-installer" outputproperty="app.du"><arg line="-ks Greenstone${version}.app"/></exec>
42        <echo>app.du: ${app.du}</echo>
43        <exec executable="sed" inputstring="${app.du}" outputproperty="app.size"><arg line="-e 's/^\([0-9]*\).*$/\1/g'"/></exec>
44        <echo>app.size: ${app.size}</echo>
45        <math result="dmg.size" operand1="${app.size}" operation="+" operand2="${dmg.overhead}" datatype="int"/>
46        <echo>dmg.size: ${dmg.size}</echo>
47
48
49        <!-- create disk image -->
50        <property name="dmg.name" value="Greenstone-${version}-MacOS-${processor}"/>
51        <exec dir="${basedir}/products" executable="hdiutil"><arg line="create -ov -size ${dmg.size}k -fs HFS+ -volname ${dmg.name} ${dmg.name}.dmg"/></exec>
52        <!-- mount it -->
53        <exec executable="hdiutil" dir="${basedir}/products"><arg line="attach ${dmg.name}.dmg"/></exec>
54        <!-- copy file into it -->
55        <exec executable="cp"><arg line="-r ${basedir}/wrapped-installer/Greenstone${version}.app /Volumes/${dmg.name}"/></exec>
56        <!-- unmount it-->
57        <exec executable="hdiutil"><arg line="detach /Volumes/${dmg.name}"/></exec>
58    </target>
59
60</project>
Note: See TracBrowser for help on using the browser.