source: release-kits/mark2/ant-scripts/wrap.xml@ 20641

Last change on this file since 20641 was 20641, checked in by oranfry, 15 years ago

allowed automatic setting of os.suffix to happen properly and made mark2 wrap script usethat property

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