22 <if> |
22 <if> |
23 <not><isset property="sf.spec.job.root.drive"/></not> |
23 <not><isset property="sf.spec.job.root.drive"/></not> |
24 <then> |
24 <then> |
25 <exec executable="perl" outputproperty="sf.spec.job.root.drive" logerror="true" failonerror="true"> |
25 <exec executable="perl" outputproperty="sf.spec.job.root.drive" logerror="true" failonerror="true"> |
26 <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/> |
26 <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/> |
|
27 <arg value="-space"/> |
27 </exec> |
28 </exec> |
28 </then> |
29 </then> |
29 </if> |
30 </if> |
30 |
31 |
31 <!-- Import common properties --> |
32 <!-- Import common properties --> |
32 <import file="${sf.common.config.dir}/common_props.ant.xml" /> |
33 <import file="${sf.common.config.dir}/common_props.ant.xml" /> |
33 |
34 |
34 <property name="sf.spec.job.rootdir" value="${sf.spec.job.root.drive}/${sf.spec.job.root.path}"/> |
35 <property name="sf.spec.job.rootdir" value="${sf.spec.job.root.drive}/${sf.spec.job.root.path}"/> |
|
36 <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/> |
35 |
37 |
36 <!-- setup Helium internal properties from their equivalent in the project spec --> |
38 <!-- setup Helium internal properties from their equivalent in the project spec --> |
37 <property name="build.name" value="${sf.spec.job.name}"/> |
39 <property name="build.name" value="${sf.spec.job.name}"/> |
38 <property name="core.build.version" value="${sf.spec.job.codeline}"/> |
40 <property name="core.build.version" value="${sf.spec.job.codeline}"/> |
39 <property name="build.number" value="${sf.spec.job.number}"/> |
41 <property name="build.number" value="${sf.spec.job.number}"/> |
74 <import file="${sf.common.config.dir}/common_refs.ant.xml" /> |
76 <import file="${sf.common.config.dir}/common_refs.ant.xml" /> |
75 |
77 |
76 <!-- Import functionality distributed into other file(s) --> |
78 <!-- Import functionality distributed into other file(s) --> |
77 <import file="${sf.common.config.dir}/build.postbuild.xml"/> |
79 <import file="${sf.common.config.dir}/build.postbuild.xml"/> |
78 |
80 |
79 <!-- Import test functionality distributed into other file(s) --> |
81 <!-- Import test functionality distributed into other file(s) --> |
80 <import file="${sf.common.config.dir}/build.test.xml"/> |
82 <import file="${sf.common.config.dir}/build.test.xml"/> |
81 |
|
82 <!-- setup conditional Helium internal properties --> |
|
83 <if><istrue value="${sf.spec.sourcesync.usecache}"/> |
|
84 <then> |
|
85 <property name="sf.spec.sourcesync.sourcespecdir" value="${temp.build.dir}"/> |
|
86 </then> |
|
87 <else> |
|
88 <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/> |
|
89 </else> |
|
90 </if> |
|
91 |
83 |
92 <!-- helium 7 compatability. needs to be defined --> |
84 <!-- helium 7 compatability. needs to be defined --> |
93 <if> |
85 <if> |
94 <or> |
86 <or> |
95 <equals arg1="${helium.version}" arg2="7.0"/> |
87 <equals arg1="${helium.version}" arg2="7.0"/> |
369 <runtarget target="sf-unpack-rnd"/> |
361 <runtarget target="sf-unpack-rnd"/> |
370 </then> |
362 </then> |
371 </if> |
363 </if> |
372 <stopwatch name="sf-syncsource" action="elapsed"/> |
364 <stopwatch name="sf-syncsource" action="elapsed"/> |
373 </target> |
365 </target> |
374 |
366 |
375 <target name="sf-get-source" depends="sf-generate-source-spec"> |
367 <target name="sf-get-source" depends="sf-generate-source-spec"> |
|
368 <stopwatch name="sf-get-source"/> |
376 <ant antfile="${temp.build.dir}/source-spec.ant.xml" /> |
369 <ant antfile="${temp.build.dir}/source-spec.ant.xml" /> |
|
370 <stopwatch name="sf-get-source" action="elapsed"/> |
377 </target> |
371 </target> |
378 |
372 |
379 <target name="sf-generate-source-spec"> |
373 <target name="sf-generate-source-spec"> |
380 <!-- Generate the sources.csv if hg cache is activated --> |
374 <!-- If we've not had a cache specified, but we should use one, then work one out... --> |
381 <if><istrue value="${sf.spec.sourcesync.usecache}"/> |
375 <if> |
382 <then> |
376 <and> |
383 <echo message="Generating Hg local cache..." /> |
377 <istrue value="${sf.spec.sourcesync.usecache}"/> |
384 <exec executable="perl" dir="${build.log.dir}" failonerror="true" output="${build.log.dir}/${build.id}_hgcache.log"> |
378 <not><isset property="sf.spec.sourcesync.cachelocation"/></not> |
385 <arg value="${sf.common.config.dir}/tools/cachefiles.pl"/> |
379 </and> |
386 <arg value="${sf.spec.sourcesync.cachelocation}"/> |
380 <then> |
387 <arg value="${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}"/> |
381 <!-- Iterate through drives to look for an existing cache --> |
388 <arg value="${temp.build.dir}/${sf.spec.sourcesync.sourcespecfile}"/> |
382 <exec executable="perl" outputproperty="sf.spec.sourcesync.all.drives" logerror="true" failonerror="true"> |
|
383 <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/> |
|
384 <arg value="-all"/> |
389 </exec> |
385 </exec> |
390 </then> |
386 <for list="${sf.spec.all.drives}" param="physical.drive"> |
391 </if> |
387 <sequential> |
392 |
388 <available property="sf.spec.sourcesync.cachelocation" value="@{physical.drive}/${sf.spec.sourcesync.cache.path}" file="@{physical.drive}/${sf.spec.sourcesync.cache.path}" type="dir"/> |
|
389 </sequential> |
|
390 </for> |
|
391 <if> |
|
392 <not><isset property="sf.spec.sourcesync.cachelocation"/></not> |
|
393 <then> |
|
394 <!-- No existing cache - locate the preferred drive for creating one --> |
|
395 <exec executable="perl" outputproperty="sf.spec.sourcesync.largest.drive" logerror="true" failonerror="true"> |
|
396 <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/> |
|
397 <arg value="-capacity"/> |
|
398 </exec> |
|
399 <property name="sf.spec.sourcesync.cachelocation" value="${sf.spec.sourcesync.largest.drive}/${sf.spec.sourcesync.cache.path}"/> |
|
400 <mkdir dir="${sf.spec.sourcesync.cachelocation}"/> |
|
401 </then> |
|
402 </if> |
|
403 </then> |
|
404 </if> |
|
405 |
393 <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages |
406 <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages |
394 for multiple package builds, this needs to be linked with package name. --> |
407 for multiple package builds, this needs to be linked with package name. --> |
395 <!-- TODO: 2. Change fmpp data to be a full property rather than relative path --> |
408 <!-- TODO: 2. Change fmpp data to be a full property rather than relative path --> |
396 <delete file="${temp.build.dir}/source-spec.ant.xml"/> |
409 <delete file="${temp.build.dir}/source-spec.ant.xml"/> |
397 |
410 |