This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
239 lines (185 loc) · 9.93 KB
/
build.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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<?xml version="1.0" encoding="UTF-8"?>
<!--
==============================================================================
=== This Ant build file is used to build the GeoNetwork opensource installers
===
=== Authors : Jeroen Ticheler <[email protected]>
=== Andrea Carboni <[email protected]>
==============================================================================
-->
<project name="geonetwork" default="installer" basedir=".">
<!-- =================================================================================== -->
<condition property="osys" value="macosx">
<os family="mac"/>
</condition>
<condition property="osys" value="win">
<os family="windows"/>
</condition>
<condition property="osys" value="unix">
<os family="unix"/>
</condition>
<!-- =================================================================================== -->
<property name="version" value="2.11.0" />
<property name="subVersion" value="SNAPSHOT" />
<property name="javaVersion" value="1.6.0" /> <!-- Minimum version required -->
<property name="jre_url" value="http://java.sun.com/javase/downloads" />
<property name="OS" value="Compiled on ${os.name} (${osys})" />
<property name="propsdir" value="../.props" />
<property name="ant.build.javac.target" value="1.5"/>
<property name="debugOn" value="on"/> <!-- on off true false yes no -->
<property name="thesaurusUrl" value="https://raw.github.com/geonetwork/util-gemet/master/thesauri" />
<!-- =================================================================================== -->
<taskdef name="izpack"
classpath="lib/standalone-compiler.jar"
classname="com.izforge.izpack.ant.IzPackTask"/>
<taskdef name="launch4j"
classname="net.sf.launch4j.ant.Launch4jTask"
classpath="launch4j/${osys}/launch4j.jar:launch4j/${osys}/lib/xstream.jar"/>
<!-- =================================================================================== -->
<target name="thesaurusDownload">
<mkdir dir ="../web/target/thesauri" />
<get src="${thesaurusUrl}/gemet.rdf"
dest="../web/target/thesauri/gemet.rdf" usetimestamp="true" />
<get src="${thesaurusUrl}/inspire-service-taxonomy.rdf"
dest="../web/target/thesauri/inspire-service-taxonomy.rdf" usetimestamp="true" />
<get src="${thesaurusUrl}/inspire-theme.rdf"
dest="../web/target/thesauri/inspire-theme.rdf" usetimestamp="true" />
</target>
<target name="inspireDbSettings">
<mkdir dir ="../web/target/inspire" />
<copy file="../web/target/geonetwork/WEB-INF/classes/setup/sql/data/data-db-default.sql" tofile="../web/target/inspire/data-db-default.sql" overwrite="true"/>
<replace file="../web/target/inspire/data-db-default.sql">
<replacefilter>
<replacetoken><![CDATA[INSERT INTO Settings VALUES (721,720,'enable','false');]]></replacetoken>
<replacevalue><![CDATA[INSERT INTO Settings VALUES (721,720,'enable','true');]]></replacevalue>
</replacefilter>
<replacefilter>
<replacetoken><![CDATA[INSERT INTO Settings VALUES (722,720,'enableSearchPanel','false');]]></replacetoken>
<replacevalue><![CDATA[INSERT INTO Settings VALUES (722,720,'enableSearchPanel','true');]]></replacevalue>
</replacefilter>
<replacefilter>
<replacetoken><![CDATA[INSERT INTO Settings VALUES (913,910,'enableInspireView','false');]]></replacetoken>
<replacevalue><![CDATA[INSERT INTO Settings VALUES (913,910,'enableInspireView','true');]]></replacevalue>
</replacefilter>
</replace>
</target>
<target name="inspireTarget" depends="thesaurusDownload,inspireDbSettings" />
<target name="setProperties">
<delete dir ="${propsdir}" />
<mkdir dir ="${propsdir}" />
<exec executable="git" dir=".." output="git.properties">
<arg value="remote" />
<arg value="-v" />
</exec>
<property prefix="git" file="git.properties"/>
<exec executable="git" dir=".." output="git2.properties">
<arg value="log" />
<arg value="--max-count=1" />
</exec>
<property prefix="git2" file="git2.properties"/>
<!-- Update the properties file -->
<propertyfile
file="../web/src/main/webapp/WEB-INF/server.prop"
comment="GeoNetwork opensource properties. These are also used by both gast and geonetwork at runtime">
<!-- These are used by both gast and geonetwork at runtime -->
<!-- Do not remove !! -->
<entry key="version" value="${version}"/>
<entry key="subVersion" value="${subVersion}"/>
<entry key="release" value="${version}"/>
<entry key="javaVersion" value="${javaVersion}"/>
<entry key="jre_url" value="${jre_url}"/>
<entry key="ant.build.javac.target" value="1.5"/>
<entry key="buildDate" type="date" value="now" pattern="yyyy-MM-dd'T'HH:mm:ssZ"/>
<entry key="date" type="date" value="now" pattern="yymmddHHmm"/>
<entry key="day" type="date" value="now" pattern="dd-M-yyyy"/>
<entry key="OS" value="${OS}"/>
<entry key="debugOn" value="${debugOn}"/>
<entry key="git_revision" value="${git2.commit}"/>
<entry key="git_url" value="${git.origin}"/>
</propertyfile>
<!-- make sure all files that need have version numbers etc updated -->
<!-- Windows installer build -->
<copy file="../installer/installer-config.xml"
tofile="${propsdir}/installer-config.xml"
filtering="on" overwrite="yes"/>
<replace file="${propsdir}/installer-config.xml"
propertyFile="../web/src/main/webapp/WEB-INF/server.prop">
<replacefilter token="@version@" property="version"/>
<replacefilter token="@subVersion@" property="subVersion"/>
<replacefilter token="@javaVersion@" property="javaVersion"/>
</replace>
<!-- Modify the config-gui.xml replacing the default view setting with a variable $defaultGUI that can be used to
configure the selected view during the installation process. The choice depends on the userInputPanel.xml radio selection -->
<replace file="../web/target/geonetwork/WEB-INF/config-gui.xml" >
<replacefilter>
<replacetoken><![CDATA[<client type="redirect" widget="false" url="main.home" />]]></replacetoken>
<replacevalue><![CDATA[${defaultGUI}]]></replacevalue>
</replacefilter>
</replace>
<!-- help file -->
<copy file="../docs/readme.html"
tofile="${propsdir}/readme.html"
filtering="on" overwrite="yes"/>
<copy file="../docs/readme_fra.html"
tofile="${propsdir}/readme_fra.html"
filtering="on" overwrite="yes"/>
<copy file="../docs/readme_spa.html"
tofile="${propsdir}/readme_spa.html"
filtering="on" overwrite="yes"/>
<replace file="${propsdir}/readme.html"
propertyFile="../web/src/main/webapp/WEB-INF/server.prop">
<replacefilter token="@version@" property="version"/>
<replacefilter token="@subVersion@" property="subVersion"/>
<replacefilter token="@day@" property="day"/>
<replacefilter token="@javaVersion@" property="javaVersion"/>
<replacefilter token="@jre_url@" property="jre_url"/>
</replace>
<replace file="${propsdir}/readme_fra.html"
propertyFile="../web/src/main/webapp/WEB-INF/server.prop">
<replacefilter token="@version@" property="version"/>
<replacefilter token="@subVersion@" property="subVersion"/>
<replacefilter token="@day@" property="day"/>
<replacefilter token="@javaVersion@" property="javaVersion"/>
<replacefilter token="@jre_url@" property="jre_url"/>
</replace>
<replace file="${propsdir}/readme_spa.html"
propertyFile="../web/src/main/webapp/WEB-INF/server.prop">
<replacefilter token="@version@" property="version"/>
<replacefilter token="@subVersion@" property="subVersion"/>
<replacefilter token="@day@" property="day"/>
<replacefilter token="@javaVersion@" property="javaVersion"/>
<replacefilter token="@jre_url@" property="jre_url"/>
</replace>
</target>
<!-- =================================================================================== -->
<target name="installer" depends="setProperties,inspireTarget">
<ant dir="." target="jarinstall" />
<ant dir="." target="wininstall" />
</target>
<!-- =================================================================================== -->
<target name="jarinstall" depends="setProperties,inspireTarget">
<property file="../web/src/main/webapp/WEB-INF/server.prop"/>
<delete dir="../geonetwork-${release}"/>
<mkdir dir="../geonetwork-${release}"/>
<echo message="Building platform independent installer on ${osys} using IzPack"/>
<izpack input="${propsdir}/installer-config.xml"
output="../geonetwork-${release}/geonetwork-install-${release}-${subVersion}.jar"
installerType="standard"
basedir="${basedir}"/>
<checksum file="../geonetwork-${release}/geonetwork-install-${release}-${subVersion}.jar" forceOverwrite="yes"/>
</target>
<!-- =================================================================================== -->
<target name="wininstall">
<!-- create a Windows installer using launch4j -->
<property file="../web/src/main/webapp/WEB-INF/server.prop"/>
<echo message="Building Windows installer on ${osys} using launch4j"/>
<launch4j configFile="${basedir}/launch4j/launch4jConfig.xml"
jar="../geonetwork-${release}/geonetwork-install-${release}-${subVersion}.jar"
outfile="../geonetwork-${release}/geonetwork-install-${release}-${subVersion}.exe"
txtFileVersion="${version}-${subVersion}-${date}"
txtProductVersion="${version}-${subVersion}"
fileVersion="${version}.0"
productVersion="${version}.0"/>
<checksum file="../geonetwork-${release}/geonetwork-install-${release}-${subVersion}.exe" forceOverwrite="yes"/>
</target>
</project>