source: other-projects/expeditee-release-kits/kits/rke/ant-scripts/create-installer.xml@ 28741

Last change on this file since 28741 was 28717, checked in by ak19, 10 years ago

jts21 - Removed unused installer targets and variables, renamed some java variables, made installing a JRE an optional installation component

File size: 7.7 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="create-installer">
3
4 <target name="create-installer">
5
6 <!-- create installer directory -->
7 <mkdir dir="installer/classes"/>
8
9 <!-- insert the installer descriptors -->
10 <copy todir="installer" overwrite="true">
11 <fileset dir="${rk.home}/kits/${rk.name}/installer" includes="antinstall-config.xml,build.xml"/>
12 </copy>
13
14 <!-- insert the language bundle -->
15 <native2ascii
16 implementation="sun"
17 encoding="UTF-8"
18 src="${rk.home}/shared/core/language-strings"
19 dest="${basedir}/installer/classes/resources"/>
20
21 <!-- insert core, rk-specific and os-specific installer classes -->
22 <copy todir="${basedir}/installer/classes" overwrite="true">
23 <fileset dir="${rk.home}/shared/core/installer-classes" erroronmissingdir="false"/>
24 <fileset dir="${rk.home}/kits/${rk.name}/installer-classes" erroronmissingdir="false"/>
25 <fileset dir="${rk.home}/shared/${rk.os}/installer-classes" erroronmissingdir="false"/>
26 </copy>
27
28 <!-- insert the licence -->
29 <copy file="${rk.home}/kits/${rk.name}/docs/LICENSE.txt" todir="${basedir}/installer/classes" overwrite="true"/>
30
31 <!-- insert greenstone's ant tasks -->
32 <unjar src="${rk.home}/shared/core/ant-tasks/greenstone/anttasks.jar" dest="installer/classes"/>
33
34 <!-- insert antelope tasks -->
35 <unjar src="${rk.home}/shared/core/ant-tasks/antelope/AntelopeTasks_3.4.2.jar" dest="installer/classes"/>
36
37 <!-- Include lib/crypt.class for both releasekit2 and 3 (rk2 and rk3)
38 since we need it to encrypt the admin password -->
39 <unjar src="${rk.home}/shared/core/lib/crypt.jar" dest="${basedir}/installer/classes">
40 <patternset><include name="**/*.class"/></patternset>
41 </unjar>
42
43 <!-- (windows only) -->
44 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
45 <!-- insert 7za.exe tool -->
46 <copy todir="installer/classes" overwrite="true" file="${rk.home}/shared/windows/7za/7za.exe"/>
47
48 <!-- insert roxes and orangevolt for windows tricks in ant -->
49 <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/roxes-win32forjava-1.1.1.jar" dest="installer/classes"/>
50 <unjar src="${rk.home}/shared/core/ant-tasks/orangevolt/orangevolt-ant-tasks-1.3.8.jar" dest="installer/classes"/>
51
52 <!-- (linux and mac only) -->
53 <else><if><bool><or><equals arg1="${rk.os}" arg2="linux"/><equals arg1="${rk.os}" arg2="mac"/></or></bool>
54 <!-- insert 7zip ant task -->
55 <unjar src="${rk.home}/shared/core/ant-tasks/7z-ant/7z.jar" dest="installer/classes"/>
56
57 </if></else></if>
58
59 <!-- clean up meta directory -->
60 <delete dir="installer/classes/META-INF"/>
61
62 <!-- calculate the size of: core -->
63 <length property="component.bytesize.core" mode="all"><fileset file="${basedir}/components/core.comp"/></length>
64 <math result="component.megabytesize.core" operand1="${component.bytesize.core}" operation="/" operand2="1048576" datatype="int"/>
65 <property name="component.size.core" value="${component.megabytesize.core} MB"/>
66
67 <!-- calculate the size of: jre -->
68 <math result="component.megabytesize.java" operand1="${component.bytesize.java}" operation="/" operand2="1048576" datatype="int"/>
69 <property name="component.size.java" value="${component.megabytesize.java} MB"/>
70
71
72 <echo>**** OS: ${rk.os}</echo>
73
74 <!-- make the installer descriptors relevant to the current os -->
75 <dcff file="installer/antinstall-config.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
76 <dcff file="installer/build.xml" startTag="&lt;!--\s*if\s*(?!.*${rk.os})[^ ]+\s*--&gt;" endTag="&lt;!--\s*/if\s*--&gt;" />
77
78 <!-- put the concrete values of things in the config -->
79 <rsr>
80 <fileset dir="${basedir}/installer" includes="*.xml"/>
81 <job pattern="@projectname@" replacement="${projectname}"/>
82 <job pattern="@version@" replacement="${version}${version-extra}"/>
83 <job pattern="@component.size.core@" replacement="${component.size.core}"/>
84 <job pattern="@component.size.java@" replacement="${component.size.java}"/>
85 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
86 <job pattern="@java.extracted@" replacement="${java.extracted}"/>
87
88 </rsr>
89
90 <!-- If this is a FLAX installer then we need to change a few things -->
91 <if><bool><equals arg1="${forward.install.flax}" arg2="true"/></bool>
92 <dcff file="installer/build.xml" startTag="&lt;!-- NO FLAX START --&gt;" endTag="&lt;!-- NO FLAX END --&gt;" />
93 <dcff file="installer/antinstall-config.xml" startTag="&lt;!-- NO FLAX START --&gt;" endTag="&lt;!-- NO FLAX END --&gt;" />
94 <else>
95 <dcff file="installer/build.xml" startTag="&lt;!-- FLAX START --&gt;" endTag="&lt;!-- FLAX END --&gt;" />
96 <dcff file="installer/antinstall-config.xml" startTag="&lt;!-- FLAX START --&gt;" endTag="&lt;!-- FLAX END --&gt;" />
97 </else>
98 </if>
99
100 <!-- If we don't want GLI/GEMS -->
101 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false" /></bool>
102 <dcff file="installer/build.xml" startTag="&lt;!-- GLI START --&gt;" endTag="&lt;!-- GLI END --&gt;" />
103 </if>
104
105 <!-- put the concrete values of things in the text -->
106 <rsr>
107 <fileset dir="${basedir}/installer/classes/resources" includes="*.properties"/>
108 <job pattern="@projectname@" replacement="${projectname}"/>
109 <job pattern="@version@" replacement="${version}${version-extra}"/>
110 <job pattern="@version.major@" replacement="${version.major}"/>
111 <job pattern="@java.min.version@" replacement="${java.min.version}"/>
112 <job pattern="@bundled.version.windows-java@" replacement="${bundled.version.windows-java}"/>
113 <job pattern="@bundled.version.linux-java@" replacement="${bundled.version.linux-java}"/>
114 </rsr>
115
116 <!-- now ready to run "compile-*-installer" targets -->
117
118 <antcall target="compile-binary-installer"/>
119
120 </target>
121
122 <target name="compile-binary-installer">
123
124 <!-- strip out lines for the cdrom installer -->
125 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-binary.xml" overwrite="true"/>
126 <dcff file="installer/antinstall-config-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
127 <copy file="installer/build.xml" tofile="installer/build-binary.xml" overwrite="true"/>
128 <dcff file="installer/build-binary.xml" startTag=".*&lt;!-- start cdrom --&gt;.*" endTag=".*&lt;!-- end cdrom --&gt;.*" />
129
130 <!-- create installer jar with ant-installer's ant task -->
131 <installer file="installer/${projectname}-${version}${version-extra}-${os.suffix}.jar"
132 compress="true"
133 extractType="NonExtractor"
134 installConfig="installer/antinstall-config-binary.xml"
135 buildFile="installer/build-binary.xml"
136 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
137 antLib="${ant.home}/lib"
138 validateConfig="true"
139 icons="bluecurve">
140
141 <zipfileset dir="installer/classes" includes="**/*" />
142 <zipfileset dir="components" includes="*.lzma"/>
143 </installer>
144
145 </target>
146
147 <target name="compile-cdrom-installer">
148
149 <!-- strip out lines for the binary(web) installer -->
150 <copy file="installer/antinstall-config.xml" tofile="installer/antinstall-config-cdrom.xml"/>
151 <dcff file="installer/antinstall-config-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
152 <copy file="installer/build.xml" tofile="installer/build-cdrom.xml"/>
153 <dcff file="installer/build-cdrom.xml" startTag=".*&lt;!-- start web --&gt;.*" endTag=".*&lt;!-- end web --&gt;.*" />
154
155 <installer file="installer/cdrom.jar"
156 compress="true"
157 extractType="NonExtractor"
158 installConfig="installer/antinstall-config-cdrom.xml"
159 buildFile="installer/build-cdrom.xml"
160 antInstallLib="${rk.home}/shared/core/ant-installer/lib"
161 antLib="${ant.home}/lib"
162 validateConfig="true"
163 icons="bluecurve">
164
165 <zipfileset dir="installer/classes" includes="**/*" />
166 </installer>
167
168 </target>
169
170</project>
Note: See TracBrowser for help on using the repository browser.