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

Revision 19537, 3.7 KB (checked in by oranfry, 10 years ago)

work on creating the cdrom installers and putting them with the cdrom components

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