root/release-kits/mark3/ant-scripts/create-installer.xml @ 16655

Revision 16655, 4.7 KB (checked in by oranfry, 12 years ago)

got mark3 working

Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="mark3-create-installer" default="create-installer">
3
4    <target name="create-installer">
5        <addressedcall target="setup-for-installer-creation"/>
6        <addressedcall target="compile-installer"/>
7    </target>
8
9    <target name="setup-for-installer-creation">
10        <if><bool><istrue value="${execute}"/></bool>
11
12            <!-- get the size of packages -->
13            <exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.tomcat"><arg line="-hs tomcat"/></exec>
14            <exec executable="sed" inputstring="${du.tomcat}" outputproperty="component.size.tomcat"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
15
16            <exec executable="du" dir="${basedir}/distribution/greenstone3/packages" outputproperty="du.ant"><arg line="-hs ant"/></exec>
17            <exec executable="sed" inputstring="${du.ant}" outputproperty="component.size.ant"><arg line="-e 's/^\(.*\)\s.*$/\1b/g'"/></exec>
18
19            <echo>Project Path: ${basedir}/distribution/greenstone3</echo>
20
21            <echo>Getting things ready to compile the installer</echo>
22            <mkdir dir="${basedir}/installer/resources"/>
23            <copy todir="${basedir}/installer" file="${mark3.home}/installer/antinstall-config.xml" overwrite="true" />
24            <copy todir="${basedir}/installer" file="${mark3.home}/installer/build.xml" overwrite="true" />
25            <copy todir="${basedir}/installer/classes" overwrite="true">
26                <fileset dir="${mark3.home}/greenstone3/installer-classes"/>
27                <fileset dir="${mark3.home}/ant-scripts/tasks/orans" includes="RegexSearchReplace.class" />
28            </copy>
29
30            <!-- put the concrete values of things in the config -->
31            <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@version@" replacement="${version}"/>
32            <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.linux-java@" replacement="${component.size.linux-java}"/>
33            <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.tomcat@" replacement="${component.size.tomcat}"/>
34            <rsr file="${basedir}/installer/antinstall-config.xml" pattern="@component.size.ant@" replacement="${component.size.ant}"/>
35
36            <rsr file="${basedir}/installer/build.xml" pattern="@java.min.version@" replacement="${java.min.version}"/>
37            <rsr file="${basedir}/installer/build.xml" pattern="@java.extracted@" replacement="${linux-java.extracted}"/>
38
39
40            <!-- put the concrete values of things in the text -->
41
42            <!-- default -->
43            <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@version@" replacement="${version}"/>
44            <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
45            <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
46            <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
47            <rsr file="${basedir}/installer/classes/resources/LanguagePack.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
48
49            <!-- chinese -->
50            <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@version@" replacement="${version}"/>
51            <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@java.min.version@" replacement="${java.min.version}"/>
52            <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.java@" replacement="${bundled.version.linux-java}"/>
53            <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.tomcat@" replacement="${bundled.version.tomcat}"/>
54            <rsr file="${basedir}/installer/classes/resources/LanguagePack_zh_CN.properties" pattern="@bundled.version.ant@" replacement="${bundled.version.ant}"/>
55
56        </if>
57    </target>
58
59    <target name="compile-installer">
60        <if><bool><istrue value="${execute}"/></bool>
61
62            <installer file="${basedir}/installer/Greenstone-${version}-MacOS-${processor}.jar"
63                    compress="true"
64                    extractType="NonExtractor"
65                    installConfig="${basedir}/installer/antinstall-config.xml"
66                    buildFile="${basedir}/installer/build.xml"
67                    antInstallLib="${mark3.home}/packages/ant-installer/lib"
68                    antLib="${mark3.home}/packages/ant/lib"
69                    validateConfig="true"
70                    failOnError="false"
71                    icons="bluecurve">
72
73                <!-- copy all the important files into the archive to be extracted for install -->
74                <zipfileset dir="${basedir}/installer/classes" includes="**/*" /> <!-- installer classes -->
75                <zipfileset dir="${basedir}/distribution/greenstone3" includes="**/*"/>
76
77            </installer>
78        </if>
79    </target>
80
81</project>
Note: See TracBrowser for help on using the browser.