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

Revision 18500, 2.3 KB (checked in by oranfry, 11 years ago)

changing release kits to put all products in a products directory

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