/
installer.xml
220 lines (190 loc) · 8.67 KB
/
installer.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================= -->
<!-- eXist build file : Build installer -->
<!-- ======================================================================= -->
<project basedir="../.." default="installer" name="Build installer">
<description>Build installer</description>
<!-- import common targets -->
<import file="../../build.xml"/>
<import file="../../build/scripts/macosx.xml"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="tools/ant/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<property name="apps.dir" value="installer/apps"/>
<property name="installer.scripts" value="installer/scripts"/>
<property name="installer.mac.icon" value="${installer.scripts}/icon.icns"/>
<property file="installer/apps.properties"/>
<target name="commandline-installer">
<!--ant antfile="build.xml" dir="tools/izpack"/-->
</target>
<target name="macosx" depends="install-appbundler">
<taskdef
name="bundleapp"
classname="com.oracle.appbundler.AppBundlerTask"
classpath="${appbundler.jar}" />
<bundleapp
outputdirectory="${installer.scripts}"
name="eXist-db"
displayname="eXist-db"
identifier="org.exist.start.Main"
mainclassname="org.exist.start.Main"
shortversion="${project.version.numeric}"
icon="${installer.mac.icon}">
<classpath file="start.jar"/>
<option value="-Dexist.home=$APP_ROOT/.."/>
</bundleapp>
</target>
<target depends="all,samples,xars,copy_scripts,macosx" name="prepare-installer">
<path id="izpackdeps">
<fileset dir="${izpack.dir}/lib/">
<include name="*.jar"/>
</fileset>
</path>
<taskdef name="izpack" classname="com.izforge.izpack.ant.IzPackTask">
<classpath refid="izpackdeps" />
</taskdef>
<tstamp/>
<delete dir="${jetty.dir}/work/Jetty__8080__exist"/>
<touch file="webapp/WEB-INF/logs/exist.log"/>
<touch file="webapp/WEB-INF/logs/xmldb.log"/>
</target>
<target name="clean-installer-xars-dir" description="Remove installer apps.dir directory">
<delete dir="${apps.dir}"/>
</target>
<target name="download-xars" description="Download xars to include in installer" depends="clean-installer-xars-dir">
<mkdir dir="${apps.dir}"/>
<echo message="Downloading xar packages to include in installer ..."/>
<foreach list="${apps}" target="download-xar" param="xar"></foreach>
<move todir="${apps.dir}">
<fileset dir="${apps.dir}">
<include name="shared*.xar"/>
</fileset>
<mapper type="glob" from="*" to="00*"/>
</move>
</target>
<target name="download-xar">
<taskdef name="fetch" classname="nl.ow.dilemma.ant.fetch.FetchTask">
<classpath>
<pathelement location="tools/ant/lib/asocat-exist.jar"/>
</classpath>
</taskdef>
<fetch dest="${apps.dir}" url="${apps.repo}/pkg.zip?abbrev=${xar}&zip=yes"
failonerror="false" maxtime="120">
<patternset>
<include name="**/*.xar"/>
</patternset>
</fetch>
</target>
<target name="xars" depends="download-xars" description="Scan apps directory and include all .xar files into installer">
<echo message="Processing xar packages ..."/>
<foreach target="process-xar" param="app">
<path>
<fileset dir="${apps.dir}">
<include name="*.xar"/>
</fileset>
</path>
</foreach>
<path id="descriptors">
<fileset dir="${apps.dir}">
<include name="*.xml"/>
</fileset>
</path>
<pathconvert pathsep=";" refid="descriptors" property="apps.list"/>
<delete file="installer/install.xml" failonerror="false"/>
<xslt basedir="installer" in="installer/install.xml.tmpl"
out="installer/install.xml"
style="install.xsl" classpathref="classpath.core"
processor="trax">
<classpath>
<fileset dir="lib/endorsed">
<include name="saxon*.jar"/>
</fileset>
</classpath>
<param name="apps" expression="${apps.list}"/>
<param name="project-name" expression="${project.name}"/>
<param name="project-version" expression="${project.version}"/>
</xslt>
</target>
<target name="process-xar">
<propertyregex property="app.name" regexp="^.*/([^/]+).xar$"
input="${app}" select="\1"/>
<echo message="Processing application package: ${app.name}"/>
<unjar dest="${apps.dir}" src="${app}">
<patternset>
<include name="expath-pkg.xml"/>
</patternset>
</unjar>
<move file="${apps.dir}/expath-pkg.xml" tofile="${apps.dir}/${app.name}.xml"/>
</target>
<target depends="prepare-installer,launcher-exe,commandline-installer" name="installer" description="Create installer">
<echo message="Calling IzPack to create installer ..."/>
<property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.jar"/>
<izpack input="installer/install.xml"
output="${inst-jar}"
basedir="." izPackDir="${izpack.dir}"
compression="bzip2"
compressionlevel="9"
installerType="standard"/>
<!--mkdir dir="installer/temp"/>
<tstamp/>
<unjar src="${inst-jar}"
dest="installer/temp"/>
<delete>
<fileset dir="installer/temp">
<include name="META-INF/EXIST.*"/>
</fileset>
</delete>
<delete file="${inst-jar}"/>
<jar destfile="${inst-jar}"
basedir="installer/temp" compress="yes" update="yes">
<manifest>
<attribute name="Main-Class" value="com.izforge.izpack.installer.Installer"/>
</manifest>
</jar>
<delete dir="installer/temp"/-->
</target>
<target name="launcher-exe" description="Create .exe for launcher">
<!--taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<echo message="${git.commit}"/>
<launch4j configFile="installer/launch4j-start.xml" fileVersion="${project.version.numeric}.${git.commit}"
txtFileVersion="${project.version}-rev${git.commit}"
productVersion="${project.version.numeric}.${git.commit}"/-->
</target>
<target depends="installer" name="installer-exe" description="Create .exe from installer">
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar" />
<property name="inst-jar" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.jar"/>
<property name="inst-exe" value="installer/${project.name}-setup-${project.version}-rev${git.commit}.exe"/>
<launch4j configFile="installer/launch4j.xml" jar="${inst-jar}"
outfile="${inst-exe}" fileVersion="${project.version.numeric}.${git.commit}"
txtFileVersion="${project.version}-rev${git.commit}"
productVersion="${project.version.numeric}.${git.commit}"/>
</target>
<target name="copy_scripts">
<filter filtersfile="installer/scripts/scripts.properties" />
<copy todir="installer/scripts" filtering="true" overwrite="true">
<fileset dir="bin">
<include name="*.sh"/>
<exclude name="run.sh"/>
<include name="*.bat"/>
<exclude name="run.bat"/>
</fileset>
</copy>
</target>
<target name="extract-apps">
<mkdir dir="installer/temp"/>
<unzip dest="installer/temp">
<fileset dir="installer/apps">
<include name="*.xar"/>
</fileset>
<patternset>
<include name="expath-pkg.xml"/>
</patternset>
</unzip>
</target>
</project>