common/build.xml
changeset 892 24ecf67cba71
parent 891 6c56420d1006
child 895 5b76b79b6713
equal deleted inserted replaced
891:6c56420d1006 892:24ecf67cba71
    29         </then>
    29         </then>
    30     </if>
    30     </if>
    31     
    31     
    32     <!-- Import common properties -->
    32     <!-- Import common properties -->
    33     <import file="${sf.common.config.dir}/common_props.ant.xml" />
    33     <import file="${sf.common.config.dir}/common_props.ant.xml" />
    34 
    34     
    35     <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}"/>
    36     
    37     
    37     <!-- setup Helium internal properties from their equivalent in the project spec -->
    38     <!-- setup Helium internal properties from their equivalent in the project spec -->
    38     <property name="build.name" value="${sf.spec.job.name}"/>
    39     <property name="build.name" value="${sf.spec.job.name}"/>
    39     <property name="core.build.version" value="${sf.spec.job.codeline}"/>
    40     <property name="core.build.version" value="${sf.spec.job.codeline}"/>
    40     <property name="build.number" value="${sf.spec.job.number}"/>
    41     <property name="build.number" value="${sf.spec.job.number}"/>
    75     <import file="${sf.common.config.dir}/common_refs.ant.xml" />
    76     <import file="${sf.common.config.dir}/common_refs.ant.xml" />
    76              
    77              
    77     <!-- Import functionality distributed into other file(s) -->
    78     <!-- Import functionality distributed into other file(s) -->
    78     <import file="${sf.common.config.dir}/build.postbuild.xml"/>
    79     <import file="${sf.common.config.dir}/build.postbuild.xml"/>
    79 	
    80 	
    80 	<!-- Import test functionality distributed into other file(s) -->
    81     <!-- Import test functionality distributed into other file(s) -->
    81     <import file="${sf.common.config.dir}/build.test.xml"/>
    82     <import file="${sf.common.config.dir}/build.test.xml"/>
    82              
       
    83     <!-- setup conditional Helium internal properties -->
       
    84     <if><istrue value="${sf.spec.sourcesync.usecache}"/>
       
    85         <then>
       
    86             <property name="sf.spec.sourcesync.sourcespecdir" value="${temp.build.dir}"/>
       
    87         </then>
       
    88         <else>
       
    89             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/>
       
    90         </else>
       
    91     </if>
       
    92     
    83     
    93     <target name="sf-prep" depends="sf-prep-announce,prep-drive,init-build-area,create-bom,log-build-env">
    84     <target name="sf-prep" depends="sf-prep-announce,prep-drive,init-build-area,create-bom,log-build-env">
    94         <!-- Test for the disk space we would like for this build -->
    85         <!-- Test for the disk space we would like for this build -->
    95 	<fail>
    86 	<fail>
    96             <condition>
    87             <condition>
   355                 <runtarget target="sf-unpack-rnd"/>
   346                 <runtarget target="sf-unpack-rnd"/>
   356             </then>
   347             </then>
   357         </if>
   348         </if>
   358         <stopwatch name="sf-syncsource" action="elapsed"/>
   349         <stopwatch name="sf-syncsource" action="elapsed"/>
   359     </target>
   350     </target>
   360 
   351     
   361     <target name="sf-get-source" depends="sf-generate-source-spec">
   352     <target name="sf-get-source" depends="sf-generate-source-spec">
   362         <stopwatch name="sf-get-source"/>
   353         <stopwatch name="sf-get-source"/>
   363         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   354         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   364         <stopwatch name="sf-get-source" action="elapsed"/>
   355         <stopwatch name="sf-get-source" action="elapsed"/>
   365     </target>
   356     </target>
   366     
   357     
   367     <target name="sf-generate-source-spec">
   358     <target name="sf-generate-source-spec">
   368         <!-- Generate the sources.csv if hg cache is activated -->
   359         <!-- If we've not had a cache specified, but we should use one, then work one out... -->
   369         <if><istrue value="${sf.spec.sourcesync.usecache}"/>
   360         <if>
   370             <then>
   361             <and>    
   371                 <echo message="Generating Hg local cache..." />
   362                 <istrue value="${sf.spec.sourcesync.usecache}"/>
   372                 <exec executable="perl" dir="${build.log.dir}" failonerror="true" output="${build.log.dir}/${build.id}_hgcache.log">
   363                 <not><isset property="sf.spec.sourcesync.cachelocation"/></not>
   373                     <arg value="${sf.common.config.dir}/tools/cachefiles.pl"/>
   364             </and>
   374                     <arg value="${sf.spec.sourcesync.cachelocation}"/>
   365             <then>
   375                     <arg value="${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}"/>
   366                 <!-- Iterate through drives to look for an existing cache -->
   376                     <arg value="${temp.build.dir}/${sf.spec.sourcesync.sourcespecfile}"/>
   367                 <exec executable="perl" outputproperty="sf.spec.sourcesync.all.drives" logerror="true" failonerror="true">
       
   368                     <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/>
       
   369                     <arg value="-all"/>
   377                 </exec>
   370                 </exec>
   378             </then>
   371                 <for list="${sf.spec.all.drives}" param="physical.drive">
   379         </if>
   372                     <sequential>
   380 
   373                         <available property="sf.spec.sourcesync.cachelocation" value="@{physical.drive}/${sf.spec.sourcesync.cache.path}" file="@{physical.drive}${sf.spec.sourcesync.cache.path}" type="dir"/>
       
   374                     </sequential>
       
   375                 </for>
       
   376                 <if>
       
   377                     <not><isset property="sf.spec.sourcesync.cachelocation"/></not>
       
   378                     <then>
       
   379                         <!-- No existing cache - locate the preferred drive for creating one -->
       
   380                         <exec executable="perl" outputproperty="sf.spec.sourcesync.largest.drive" logerror="true" failonerror="true">
       
   381                             <arg value="${sf.common.config.dir}/tools/findPhysicalDrive.pl"/>
       
   382                             <arg value="-capacity"/>
       
   383                         </exec>
       
   384                         <property name="sf.spec.sourcesync.cachelocation" value="${sf.spec.sourcesync.largest.drive}/${sf.spec.sourcesync.cache.path}"/>
       
   385                         <mkdir dir="${sf.spec.sourcesync.cachelocation}"/>
       
   386                     </then>
       
   387                 </if>
       
   388             </then>
       
   389         </if>
       
   390         
   381         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   391         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   382         for multiple package builds, this needs to be linked with package name. -->
   392         for multiple package builds, this needs to be linked with package name. -->
   383         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   393         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   384         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   394         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   385         
   395