1 |
d2a8c3fd
|
Marc NICOLAS
|
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
12 |
|
|
|
13 |
|
|
<project name="fr.cnes.sitools.core" default="build" basedir=".">
|
14 |
|
|
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
<property file="build.properties" />
|
30 |
|
|
|
31 |
|
|
<property file="conf/build/properties/build-test.properties" />
|
32 |
|
|
|
33 |
|
|
<property file="conf/build/properties/build-${HOST}.properties" />
|
34 |
|
|
|
35 |
|
|
<property file="build-default.properties" />
|
36 |
|
|
|
37 |
|
|
<import file="sitools.userlibraries.ant.xml" optional="true" />
|
38 |
|
|
|
39 |
|
|
<property name="cots.dir" value="${ROOT_DIRECTORY}/cots" />
|
40 |
|
|
|
41 |
|
|
<property name="build.extensions.dir" value="../fr.cnes.sitools.ext.test/" />
|
42 |
|
|
<property name="conf.dir" value="conf" />
|
43 |
|
|
<property name="conf.reference.dir" value="${conf.dir}/reference" />
|
44 |
|
|
<property name="conf.bin.dir" value="${conf.dir}/bin" />
|
45 |
|
|
<property name="conf.jar.dir" value="${conf.dir}/jar" />
|
46 |
|
|
<property name="conf.build.dir" value="${conf.dir}/build" />
|
47 |
|
|
<property name="conf.build.properties.dir" value="${conf.dir}/build/properties" />
|
48 |
|
|
<property name="conf.build.userlib.dir" value="${conf.dir}/build/userlibrairies" />
|
49 |
|
|
<property name="conf.properties.dir" value="${conf.dir}/properties" />
|
50 |
|
|
<property file="${conf.reference.dir}/sitools-reference.properties" prefix="properties" />
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
<target name="build" depends="refresh-properties, refresh-userlibraries, build-shell, build-project, build-tests, copy-log4j-properties" />
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
<target name="refresh-properties" description="Mise à jour du fichier de propriétés sitools.properties">
|
61 |
|
|
|
62 |
|
|
<copy outputencoding="UTF-8" tofile="${conf.properties.dir}/sitools.properties" file="${conf.reference.dir}/sitools-reference.properties" overwrite="true" />
|
63 |
|
|
|
64 |
|
|
<propertyfile file="${conf.properties.dir}/sitools.properties" comment="Update root property">
|
65 |
|
|
<entry key="Starter.ROOT_DIRECTORY" value="${ROOT_DIRECTORY}" />
|
66 |
|
|
<entry key="Starter.HOST_DOMAIN" value="${HOST_DOMAIN}" />
|
67 |
|
|
<entry key="Starter.DATABASE_URL" value="${DATABASE_URL}" />
|
68 |
|
|
<entry key="Starter.DATABASE_USER" value="${DATABASE_USER}" />
|
69 |
|
|
<entry key="Starter.DATABASE_PASSWORD" value="${DATABASE_PASSWORD}" />
|
70 |
|
|
<entry key="Starter.DATABASE_SCHEMA" value="${DATABASE_SCHEMA}" />
|
71 |
|
|
<entry key="Starter.DATABASE_DRIVER" value="${DATABASE_DRIVER}" />
|
72 |
|
|
<entry key="Starter.PUBLIC_HOST_DOMAIN" value="${PUBLIC_HOST_DOMAIN}" />
|
73 |
|
|
<entry key="Starter.HOST_PORT" value="${HOST_PORT}" />
|
74 |
|
|
<entry key="Security.Intranet.net" value="${SECURITY_INTRANET_NET}" />
|
75 |
|
|
<entry key="Security.Intranet.mask" value="${SECURITY_INTRANET_MASK}" />
|
76 |
|
|
</propertyfile>
|
77 |
|
|
|
78 |
|
|
<condition property="itnetIsSet">
|
79 |
|
|
<isset property="Security.Intranet.ADMIN" />
|
80 |
|
|
</condition>
|
81 |
|
|
<antcall target="refresh-itnet" />
|
82 |
|
|
<copy outputencoding="UTF-8" tofile="sitools.properties" file="${conf.properties.dir}/sitools.properties" overwrite="true" />
|
83 |
|
|
|
84 |
|
|
|
85 |
|
|
</target>
|
86 |
|
|
|
87 |
|
|
|
88 |
|
|
<macrodef name="updatePropertyKey">
|
89 |
|
|
<attribute name="propertyName" default="Security.Intranet.xxx" />
|
90 |
|
|
<attribute name="propertyValue" default="false" />
|
91 |
|
|
<attribute name="propertyFile" default="${conf.properties.dir}/sitools.properties" />
|
92 |
|
|
<sequential>
|
93 |
|
|
<propertyfile file="@{propertyFile}">
|
94 |
|
|
<entry key="@{propertyName}" value="@{propertyValue}" operation="=" default="false" />
|
95 |
|
|
</propertyfile>
|
96 |
|
|
</sequential>
|
97 |
|
|
</macrodef>
|
98 |
|
|
|
99 |
|
|
|
100 |
|
|
<target name="refresh-itnet" if="itnetIsSet">
|
101 |
|
|
<updatePropertyKey propertyName="Security.Intranet.ADMIN" propertyValue="${Security.Intranet.ADMIN}" />
|
102 |
|
|
<updatePropertyKey propertyName="Security.Intranet.USER" propertyValue="${Security.Intranet.USER}" />
|
103 |
|
|
<updatePropertyKey propertyName="Security.Intranet.SYSTEM" propertyValue="${Security.Intranet.SYSTEM}" />
|
104 |
|
|
<updatePropertyKey propertyName="Security.Intranet.ADMIN_DYNAMIC" propertyValue="${Security.Intranet.ADMIN_DYNAMIC}" />
|
105 |
|
|
<updatePropertyKey propertyName="Security.Intranet.USER_DYNAMIC" propertyValue="${Security.Intranet.USER_DYNAMIC}" />
|
106 |
|
|
<updatePropertyKey propertyName="Security.Intranet.SYSTEM_DYNAMIC" propertyValue="${Security.Intranet.SYSTEM_DYNAMIC}" />
|
107 |
|
|
</target>
|
108 |
|
|
|
109 |
|
|
|
110 |
|
|
<target name="refresh-build-date" description="Mise à jour du fichier de propriétés sitools.properties pour positionner la buid-date">
|
111 |
|
|
|
112 |
|
|
<tstamp>
|
113 |
|
|
<format property="NOW" pattern="yyyy-MM-dd HH:mm:ss" locale="fr,FR" />
|
114 |
|
|
</tstamp>
|
115 |
|
|
|
116 |
|
|
<updatePropertyKey propertyName="Starter.BUILD_DATE" propertyValue="${NOW}" />
|
117 |
|
|
<updatePropertyKey propertyName="Starter.BUILD_DATE" propertyValue="${NOW}" propertyFile="sitools.properties" />
|
118 |
|
|
|
119 |
|
|
</target>
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
|
124 |
|
|
|
125 |
|
|
<target name="execute-tests" description="invoke sitools/prototype/execute-tests">
|
126 |
|
|
<subant target="execute-tests">
|
127 |
|
|
<fileset dir="${conf.build.dir}" includes="build.xml" />
|
128 |
|
|
</subant>
|
129 |
|
|
</target>
|
130 |
|
|
|
131 |
|
|
<target name="javadoc" description="Generate project javadoc">
|
132 |
|
|
<subant target="javadoc-projet">
|
133 |
|
|
<fileset dir="${conf.build.dir}" includes="build.xml" />
|
134 |
|
|
</subant>
|
135 |
|
|
</target>
|
136 |
|
|
|
137 |
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
<target name="coverage" description="invoke sitools/prototype/coverage">
|
141 |
|
|
<subant target="coverage">
|
142 |
|
|
<fileset dir="${conf.build.dir}" includes="build.xml" />
|
143 |
|
|
</subant>
|
144 |
|
|
</target>
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
<target name="audit" description="Generates a report of code convention violations">
|
148 |
|
|
<subant target="audit">
|
149 |
|
|
<fileset dir="${conf.build.dir}" includes="build.xml" />
|
150 |
|
|
</subant>
|
151 |
|
|
</target>
|
152 |
|
|
|
153 |
|
|
|
154 |
|
|
<target name="build-project" description="invoke sitools/prototype/deploy-jar-projet" />
|
155 |
|
|
|
156 |
|
|
|
157 |
|
|
<target name="build-tests" description="invoke sitools/prototype/deploy-jar-test-projet">
|
158 |
|
|
<subant target="deploy-jar-test-projet">
|
159 |
|
|
<fileset dir="${conf.build.dir}" includes="build.xml" />
|
160 |
|
|
</subant>
|
161 |
|
|
<antcall target="refresh-build-date" />
|
162 |
|
|
</target>
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
166 |
|
|
<target name="refresh-userlibraries" description="Mise à jour des userlibrairies pour eclipse et pour Ant">
|
167 |
|
|
<echo message="COTS dir : ${cots.dir}" />
|
168 |
|
|
<xslt in="${conf.build.userlib.dir}/sitools.userlibraries" out="${conf.build.userlib.dir}/sitools.userlibraries.eclipse.xml" style="${conf.build.userlib.dir}/sitools.userlibraries.xsl" force="true" processor="SaxonLiaison">
|
169 |
|
|
<param name="output" expression="eclipse" />
|
170 |
|
|
<param name="ROOT_DIRECTORY" expression="${ROOT_DIRECTORY}" />
|
171 |
|
|
<outputproperty name="method" value="xml" />
|
172 |
|
|
<outputproperty name="standalone" value="no" />
|
173 |
|
|
<outputproperty name="encoding" value="UTF-8" />
|
174 |
|
|
<outputproperty name="indent" value="yes" />
|
175 |
|
|
<classpath location="${cots.dir}/saxon/saxon9he.jar" />
|
176 |
|
|
<classpath location="${cots.dir}/saxon/SaxonLiaison.jar" />
|
177 |
|
|
</xslt>
|
178 |
|
|
<xslt in="${conf.build.userlib.dir}/sitools.userlibraries" out="${conf.build.userlib.dir}/sitools.userlibraries.ant.xml" style="${conf.build.userlib.dir}/sitools.userlibraries.xsl" force="true" processor="SaxonLiaison">
|
179 |
|
|
<param name="output" expression="ant" />
|
180 |
|
|
<param name="ROOT_DIRECTORY" expression="${ROOT_DIRECTORY}" />
|
181 |
|
|
<outputproperty name="method" value="xml" />
|
182 |
|
|
<outputproperty name="standalone" value="yes" />
|
183 |
|
|
<outputproperty name="encoding" value="UTF-8" />
|
184 |
|
|
<outputproperty name="indent" value="yes" />
|
185 |
|
|
<classpath location="${cots.dir}/saxon/saxon9he.jar" />
|
186 |
|
|
<classpath location="${cots.dir}/saxon/SaxonLiaison.jar" />
|
187 |
|
|
</xslt>
|
188 |
|
|
</target>
|
189 |
|
|
|
190 |
|
|
|
191 |
|
|
|
192 |
|
|
<target name="build-shell" description="Mise à jour du shell de lancement">
|
193 |
|
|
|
194 |
|
|
<copy file="${conf.reference.dir}/sitools-reference" tofile="${conf.bin.dir}/sitools" outputencoding="UTF-8" overwrite="true">
|
195 |
|
|
<filterchain>
|
196 |
|
|
<replacetokens>
|
197 |
|
|
<token key="ROOT_DIRECTORY" value="${ROOT_DIRECTORY}" />
|
198 |
|
|
<token key="VERSION" value="${properties.Starter.VERSION}" />
|
199 |
|
|
<token key="PORT" value="${HOST_PORT}" />
|
200 |
|
|
<token key="COPYRIGHT" value="${properties.Starter.COPYRIGHT}" />
|
201 |
|
|
</replacetokens>
|
202 |
|
|
</filterchain>
|
203 |
|
|
</copy>
|
204 |
|
|
<copy outputencoding="UTF-8" tofile="sitools" file="${conf.bin.dir}/sitools" overwrite="true" />
|
205 |
|
|
<chmod file="sitools" perm="ugo+rx" />
|
206 |
|
|
<chmod file="${conf.bin.dir}/sitools" perm="ugo+rx" />
|
207 |
|
|
|
208 |
|
|
|
209 |
|
|
<xslt in="${conf.build.userlib.dir}/sitools.userlibraries" out="${conf.bin.dir}/startSitools.sh" style="${conf.build.userlib.dir}/sitools.userlibraries.xsl" force="true" processor="SaxonLiaison">
|
210 |
|
|
<param name="output" expression="shell" />
|
211 |
|
|
<param name="ROOT_DIRECTORY" expression="${ROOT_DIRECTORY}" />
|
212 |
|
|
<param name="LOG_DIRECTORY" expression="${ROOT_DIRECTORY}" />
|
213 |
|
|
<param name="PORT" expression="${HOST_PORT}" />
|
214 |
|
|
<outputproperty name="method" value="text" />
|
215 |
|
|
<outputproperty name="standalone" value="no" />
|
216 |
|
|
<outputproperty name="encoding" value="UTF-8" />
|
217 |
|
|
<outputproperty name="indent" value="yes" />
|
218 |
|
|
<classpath location="${cots.dir}/saxon/saxon9he.jar" />
|
219 |
|
|
<classpath location="${cots.dir}/saxon/SaxonLiaison.jar" />
|
220 |
|
|
</xslt>
|
221 |
|
|
<xslt in="${conf.build.userlib.dir}/sitools.userlibraries" out="${conf.bin.dir}/startSitools.bat" style="${conf.build.userlib.dir}/sitools.userlibraries.xsl" force="true" processor="SaxonLiaison">
|
222 |
|
|
<param name="output" expression="bat" />
|
223 |
|
|
<param name="ROOT_DIRECTORY" expression="${ROOT_DIRECTORY}" />
|
224 |
|
|
<outputproperty name="method" value="text" />
|
225 |
|
|
<outputproperty name="standalone" value="no" />
|
226 |
|
|
<outputproperty name="encoding" value="UTF-8" />
|
227 |
|
|
<outputproperty name="indent" value="yes" />
|
228 |
|
|
<classpath location="${cots.dir}/saxon/saxon9he.jar" />
|
229 |
|
|
<classpath location="${cots.dir}/saxon/SaxonLiaison.jar" />
|
230 |
|
|
</xslt>
|
231 |
|
|
<copy outputencoding="UTF-8" tofile="startSitools.sh" file="${conf.bin.dir}/startSitools.sh" overwrite="true" />
|
232 |
|
|
<copy outputencoding="UTF-8" tofile="startSitools.bat" file="${conf.bin.dir}/startSitools.bat" overwrite="true" />
|
233 |
|
|
<chmod file="startSitools.sh" perm="ugo+rx" />
|
234 |
|
|
<chmod file="${conf.bin.dir}/startSitools.sh" perm="ugo+rx" />
|
235 |
|
|
</target>
|
236 |
|
|
|
237 |
|
|
<target name="jar" description="target to refresh the core jar">
|
238 |
|
|
<subant target="jar" buildpath="./conf/build" />
|
239 |
|
|
<subant target="deploy-jar" buildpath="./conf/build" />
|
240 |
|
|
</target>
|
241 |
|
|
|
242 |
|
|
<target name="copy-log4j-properties" description="Copy the log4j properties to the root folder">
|
243 |
|
|
<copy outputencoding="UTF-8" tofile="log4j.properties" file="${conf.properties.dir}/log4j.properties" overwrite="true" />
|
244 |
|
|
</target>
|
245 |
|
|
|
246 |
|
|
|
247 |
|
|
|
248 |
|
|
|
249 |
|
|
</project> |