|
3 | 3 | <!-- environment should be declared before reading build.properties --> |
4 | 4 | <property environment="env" /> |
5 | 5 | <!-- set global properties for this build --> |
| 6 | + <property name="services.trunk" value="." /> |
6 | 7 | <property file="build.properties" /> |
7 | 8 | <property name="mvn.opts" value="-V" /> |
8 | 9 | <property name="src" location="src" /> |
|
14 | 15 | <os family="windows" /> |
15 | 16 | </condition> |
16 | 17 |
|
17 | | - <scriptdef name="urlencode" language="javascript"> |
18 | | - <attribute name="property"/> |
19 | | - <![CDATA[ |
20 | | - var value = self.project.getProperty(attributes.get("property")); |
21 | | - var encoded = encodeURIComponent(value); |
22 | | - self.project.setProperty(attributes.get("property") + ".encoded", encoded) |
23 | | - ]]> |
24 | | - </scriptdef> |
| 18 | + <target name="prepare-ant-libs"> |
| 19 | + <ant antfile="3rdparty/ant/build.xml" target="prepare-ant-libs" inheritAll="false" /> |
| 20 | + </target> |
| 21 | + |
| 22 | + <target name="encode-jdbc-options" depends="prepare-ant-libs"> |
| 23 | + <path id="javax.classpath"> |
| 24 | + <fileset dir="${services.trunk}/3rdparty/ant/target/dependency"> |
| 25 | + <include name="*.jar" /> |
| 26 | + </fileset> |
| 27 | + </path> |
| 28 | + |
| 29 | + <scriptdef name="encode" language="javascript" manager="javax" classpathref="javax.classpath"> |
| 30 | + <attribute name="property"/> |
| 31 | + <![CDATA[ |
| 32 | + var value = self.project.getProperty(attributes.get("property")); |
| 33 | + var encoded = encodeURIComponent(value); |
| 34 | + self.project.setProperty(attributes.get("property") + ".encoded", encoded) |
| 35 | + ]]> |
| 36 | + </scriptdef> |
| 37 | + |
| 38 | + <encode property="db.jdbc.urloptions" /> |
| 39 | + </target> |
25 | 40 |
|
26 | 41 | <target name="init"> |
27 | 42 | <!-- Create the time stamp --> |
|
226 | 241 | <!-- |
227 | 242 | This target calls the 'create_nuxeo_db' and 'create_cspace_db' targets and creates some database utility functions |
228 | 243 | --> |
229 | | - <target name="-create_db" depends="-validate_create_db_unix, -validate_create_db_windows"> |
230 | | - <urlencode property="db.jdbc.urloptions" /> |
| 244 | + <target name="-create_db" depends="-validate_create_db_unix, -validate_create_db_windows, encode-jdbc-options"> |
231 | 245 | <antcall target="create_nuxeo_db" /> |
232 | 246 | <antcall target="create_cspace_db" /> |
233 | 247 | <antcall target="create_update_userid_db_function" /> |
|
311 | 325 | <ant antfile="services/build.xml" target="create_cspace_db" inheritAll="false" /> |
312 | 326 | </target> |
313 | 327 |
|
314 | | - <target name="import" description="import default configuration"> |
315 | | - <urlencode property="db.jdbc.urloptions" /> |
316 | | - <ant antfile="services/build.xml" target="import" inheritAll="false" /> |
| 328 | + <target name="import" depends="encode-jdbc-options" description="import default configuration"> |
| 329 | + <ant antfile="services/build.xml" target="import" inheritAll="false"> |
| 330 | + <property name="db.jdbc.urloptions.encoded" value="${db.jdbc.urloptions.encoded}" /> |
| 331 | + </ant> |
317 | 332 | </target> |
318 | 333 |
|
319 | | - <target name="deploy" depends="install, setup_initdb.sql" description="deploy services in ${jee.server.cspace}"> |
| 334 | + <target name="deploy" depends="install, setup_initdb.sql, encode-jdbc-options" description="deploy services in ${jee.server.cspace}"> |
320 | 335 | <!-- copy db scripts, etc. --> |
321 | 336 | <copy todir="${jee.server.cspace}/cspace/services/scripts"> |
322 | 337 | <fileset dir="${src}/main/resources/scripts/" /> |
323 | 338 | </copy> |
324 | 339 | <ant antfile="3rdparty/build.xml" target="deploy" inheritAll="false" /> |
325 | 340 | <ant antfile="common-lib/build.xml" target="deploy" inheritAll="false" /> |
326 | | - <ant antfile="services/build.xml" target="deploy" inheritAll="false" /> |
| 341 | + <ant antfile="services/build.xml" target="deploy" inheritAll="false"> |
| 342 | + <property name="db.jdbc.urloptions.encoded" value="${db.jdbc.urloptions.encoded}" /> |
| 343 | + </ant> |
327 | 344 | <ant antfile="cspace-ui/build.xml" target="deploy" inheritAll="false" /> |
328 | 345 | </target> |
329 | 346 |
|
|
0 commit comments