common/build.xml
changeset 681 eeab5a04dc46
parent 679 7e493c0264f3
child 698 382728cd25d2
equal deleted inserted replaced
680:81550e87fc91 681:eeab5a04dc46
    55     <import file="${sf.common.config.dir}/build.test.xml"/>
    55     <import file="${sf.common.config.dir}/build.test.xml"/>
    56              
    56              
    57     <!-- setup conditional Helium internal properties -->
    57     <!-- setup conditional Helium internal properties -->
    58     <if><istrue value="${sf.spec.sourcesync.usecache}"/>
    58     <if><istrue value="${sf.spec.sourcesync.usecache}"/>
    59         <then>
    59         <then>
    60             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.common.config.dir}/generated"/>
    60             <property name="sf.spec.sourcesync.sourcespecdir" value="${temp.build.dir}"/>
    61         </then>
    61         </then>
    62         <else>
    62         <else>
    63             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/>
    63             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/>
    64         </else>
    64         </else>
    65     </if>
    65     </if>
    66     
    66     
    67     <!-- conditional import of generated source spec if available -->
    67     <!-- conditional import of generated source spec if available -->
    68     <if><available  file="${sf.common.config.dir}/generated/source-spec.ant.xml" />
    68     <if><available  file="${temp.build.dir}/source-spec.ant.xml" />
    69         <then>
    69         <then>
    70             <echo message="Generated source spec found, importing..." />
    70             <echo message="Generated source spec found, importing..." />
    71             <import file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
    71             <import file="${temp.build.dir}/source-spec.ant.xml"/>
    72         </then>
    72         </then>
    73     </if>
    73     </if>
    74     
    74     
    75     <target name="sf-prep" depends="sf-clean-generated-directory,prep-drive,init-build-area,sf-generate-source-spec,check-tool-dependencies,create-bom,log-build-env">
    75     <target name="sf-prep" depends="prep-drive,init-build-area,sf-generate-source-spec,check-tool-dependencies,create-bom,log-build-env">
    76         <echo>[SF-PREP]</echo>
    76         <echo>[SF-PREP]</echo>
    77         <!-- Test for the disk space we would like for this build -->
    77         <!-- Test for the disk space we would like for this build -->
    78 	<fail>
    78 	<fail>
    79             <condition>
    79             <condition>
    80                 <not>
    80                 <not>
   162     <target name="sf-generate-source-spec">
   162     <target name="sf-generate-source-spec">
   163         <!-- Generate the sources.csv if hg cache is activated -->
   163         <!-- Generate the sources.csv if hg cache is activated -->
   164         <if><istrue value="${sf.spec.sourcesync.usecache}"/>
   164         <if><istrue value="${sf.spec.sourcesync.usecache}"/>
   165             <then>
   165             <then>
   166                 <echo message="Generating Hg local cache..." />
   166                 <echo message="Generating Hg local cache..." />
   167                 <mkdir dir="${sf.common.config.dir}/generated"/>
       
   168                 <exec executable="perl" dir="${build.log.dir}" failonerror="true" output="${build.log.dir}/${build.id}_hgcache.log">
   167                 <exec executable="perl" dir="${build.log.dir}" failonerror="true" output="${build.log.dir}/${build.id}_hgcache.log">
   169                     <arg value="${sf.common.config.dir}/tools/cachefiles.pl"/>
   168                     <arg value="${sf.common.config.dir}/tools/cachefiles.pl"/>
   170                     <arg value="${sf.spec.sourcesync.cachelocation}"/>
   169                     <arg value="${sf.spec.sourcesync.cachelocation}"/>
   171                     <arg value="${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}"/>
   170                     <arg value="${sf.project.location}/${sf.spec.sourcesync.sourcespecfile}"/>
   172                     <arg value="${sf.common.config.dir}/generated/${sf.spec.sourcesync.sourcespecfile}"/>
   171                     <arg value="${temp.build.dir}/${sf.spec.sourcesync.sourcespecfile}"/>
   173                 </exec>
   172                 </exec>
   174             </then>
   173             </then>
   175         </if>
   174         </if>
   176 
   175 
   177         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   176         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   178         for multiple package builds, this needs to be linked with package name. -->
   177         for multiple package builds, this needs to be linked with package name. -->
   179         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   178         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   180         <delete file="${sf.common.config.dir}/generated/source-spec.ant.xml"/>
   179         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   181         
   180         
   182         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   181         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   183               outputFile="${sf.common.config.dir}/generated/source-spec.ant.xml">
   182               outputFile="${temp.build.dir}/source-spec.ant.xml">
   184               <data expandProperties="yes">
   183               <data expandProperties="yes">
   185                     ant: antProperties()
   184                     ant: antProperties()
   186                     data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   185                     data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   187               </data>
   186               </data>
   188         </fmpp>
   187         </fmpp>
   392     <if>
   391     <if>
   393       <istrue value="${sf.spec.build.clean.enable}"/>
   392       <istrue value="${sf.spec.build.clean.enable}"/>
   394       <then>
   393       <then>
   395         <echo message="Executing truclean step."/>
   394         <echo message="Executing truclean step."/>
   396         <fmpp sourceFile="${sf.common.config.dir}/templates/truclean.ant.xml.ftl"
   395         <fmpp sourceFile="${sf.common.config.dir}/templates/truclean.ant.xml.ftl"
   397             outputFile="${sf.common.config.dir}/generated/truclean.ant.xml">
   396             outputFile="${temp.build.dir}/truclean.ant.xml">
   398           <data expandProperties="yes">
   397           <data expandProperties="yes">
   399               ant: antProperties()
   398               ant: antProperties()
   400               data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   399               data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   401           </data>
   400           </data>
   402         </fmpp>
   401         </fmpp>
   403         <ant antfile="${sf.common.config.dir}/generated/truclean.ant.xml"/>
   402         <ant antfile="${temp.build.dir}/truclean.ant.xml"/>
   404       </then>
   403       </then>
   405       <else>
   404       <else>
   406         <echo message="Skipping truclean step."/>
   405         <echo message="Skipping truclean step."/>
   407       </else>
   406       </else>
   408     </if>
   407     </if>
   427       </else>
   426       </else>
   428     </if>
   427     </if>
   429   </target>
   428   </target>
   430     
   429     
   431     <target name="sf-get-source" depends="sf-generate-source-spec">
   430     <target name="sf-get-source" depends="sf-generate-source-spec">
   432         <ant antfile="${sf.common.config.dir}/generated/source-spec.ant.xml" />
   431         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   433     </target>
   432     </target>
   434     
   433     
   435     <target name="sf-diamondize-bom" depends="sf-record-proj-conf-bom">
   434     <target name="sf-diamondize-bom" depends="sf-record-proj-conf-bom">
   436         <fmpp sourceFile="${sf.common.config.dir}/templates/build-info.xml.ftl"
   435         <fmpp sourceFile="${sf.common.config.dir}/templates/build-info.xml.ftl"
   437               outputFile="${build.drive}/output/logs/sf-diamondize-bom.xml">
   436               outputFile="${build.drive}/output/logs/sf-diamondize-bom.xml">
   447         <!-- Make a copy in BOM dir -->
   446         <!-- Make a copy in BOM dir -->
   448         <copy file="${build.drive}/output/logs/sf-diamondize-bom.xml" tofile="${build.log.dir}/BOM/build-info.xml"/>
   447         <copy file="${build.drive}/output/logs/sf-diamondize-bom.xml" tofile="${build.log.dir}/BOM/build-info.xml"/>
   449     </target>
   448     </target>
   450 
   449 
   451     <target name="sf-preprocess-package-config">
   450     <target name="sf-preprocess-package-config">
   452         <mkdir dir="${sf.common.config.dir}/generated"/>
       
   453 	<echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   451 	<echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   454         <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
   452         <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
   455             <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
   453             <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
   456             <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   454             <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   457             <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
   455             <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
   458             <arg value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   456             <arg value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   459             <arg value="${build.log.dir}/rnd_excludefile.txt"/>
   457             <arg value="${build.log.dir}/rnd_excludefile.txt"/>
   460         </exec>
   458         </exec>
   461         <antcall target="sf-log-to-brag">
   459         <antcall target="sf-log-to-brag">
   462             <param name="sf.brag.phase" value="Prebuild"/>
   460             <param name="sf.brag.phase" value="Prebuild"/>
   463             <param name="sf.brag.step" value="Preprocess package config"/>
   461             <param name="sf.brag.step" value="Preprocess package config"/>
   468     
   466     
   469     <target name="sf-zip-content">
   467     <target name="sf-zip-content">
   470         <!-- If it's the file we use for everything, and it's not up to date... -->
   468         <!-- If it's the file we use for everything, and it's not up to date... -->
   471         <if>
   469         <if>
   472           <and>
   470           <and>
   473             <equals arg1="${zip.config.file}" arg2="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   471             <equals arg1="${zip.config.file}" arg2="${temp.build.dir}/zip.cfg.xml.ftl"/>
   474             <not>
   472             <not>
   475               <and>
   473               <and>
   476                 <uptodate targetfile="${sf.common.config.dir}/generated/zip.cfg.xml.ftl">
   474                 <uptodate targetfile="${temp.build.dir}/zip.cfg.xml.ftl">
   477                   <srcfiles dir="${sf.common.config.dir}">
   475                   <srcfiles dir="${sf.common.config.dir}">
   478                     <include name="tools/populateziptemplate.pl"/>
   476                     <include name="tools/populateziptemplate.pl"/>
   479                     <include name="templates/zip.cfg.xml.ftl.template"/>
   477                     <include name="templates/zip.cfg.xml.ftl.template"/>
   480                   </srcfiles>
   478                   </srcfiles>
   481                 </uptodate>
   479                 </uptodate>
   482                 <uptodate targetfile="${sf.common.config.dir}/generated/zip.cfg.xml.ftl">
   480                 <uptodate targetfile="${temp.build.dir}/zip.cfg.xml.ftl">
   483                   <srcfiles dir="${sf.spec.sourcesync.sourcespecdir}">
   481                   <srcfiles dir="${sf.spec.sourcesync.sourcespecdir}">
   484                     <include name="${sf.spec.sourcesync.sourcespecfile}"/>
   482                     <include name="${sf.spec.sourcesync.sourcespecfile}"/>
   485                   </srcfiles>
   483                   </srcfiles>
   486                 </uptodate>
   484                 </uptodate>
   487               </and>
   485               </and>
   506     </target>
   504     </target>
   507     
   505     
   508     <target name="sf-package-source" >
   506     <target name="sf-package-source" >
   509         <!-- Firstly zip up rnd by package -->
   507         <!-- Firstly zip up rnd by package -->
   510         <antcall target="sf-zip-content">
   508         <antcall target="sf-zip-content">
   511             <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   509             <param name="zip.config.file" value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   512             <param name="zip.target.name" value="rnd" />
   510             <param name="zip.target.name" value="rnd" />
   513         </antcall>
   511         </antcall>
   514         <antcall target="sf-zip-content">
   512         <antcall target="sf-zip-content">
   515             <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   513             <param name="zip.config.file" value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   516             <param name="zip.target.name" value="rnd-internal" />
   514             <param name="zip.target.name" value="rnd-internal" />
   517         </antcall>
   515         </antcall>
   518         <if>
   516         <if>
   519             <istrue value="${sf.spec.package.src.enable}"/>
   517             <istrue value="${sf.spec.package.src.enable}"/>
   520             <then>
   518             <then>
   521                 <echo message="INFO Packaging Source Repos"/>
   519                 <echo message="INFO Packaging Source Repos"/>
   522                 <antcall target="sf-zip-content">
   520                 <antcall target="sf-zip-content">
   523                     <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   521                     <param name="zip.config.file" value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   524                     <param name="zip.target.name" value="src" />
   522                     <param name="zip.target.name" value="src" />
   525                 </antcall>
   523                 </antcall>
   526                 <!-- Then zip up src zips by layer -->
   524                 <!-- Then zip up src zips by layer -->
   527                 <antcall target="sf-zip-content">
   525                 <antcall target="sf-zip-content">
   528                     <param name="zip.config.file" value="${sf.common.config.dir}/generated/zip.cfg.xml.ftl"/>
   526                     <param name="zip.config.file" value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   529                     <param name="zip.target.name" value="src-by-layer" />
   527                     <param name="zip.target.name" value="src-by-layer" />
   530                 </antcall>
   528                 </antcall>
   531             </then>
   529             </then>
   532         </if>
   530         </if>
   533     </target>
   531     </target>
   569         </exec>
   567         </exec>
   570         <!-- And copy the XSL so the output can be transformed by a browser -->
   568         <!-- And copy the XSL so the output can be transformed by a browser -->
   571         <copy file="${sf.common.config.dir}/tools/brag/brag.xsl" toDir="${build.log.dir}/summary/"/>
   569         <copy file="${sf.common.config.dir}/tools/brag/brag.xsl" toDir="${build.log.dir}/summary/"/>
   572     </target>
   570     </target>
   573     
   571     
   574     <target name="sf-clean-generated-directory">
       
   575       <delete dir="${sf.common.config.dir}/generated" failonerror="false" />
       
   576       <mkdir dir="${sf.common.config.dir}/generated" />
       
   577     </target>
       
   578 
       
   579 </project>
   572 </project>
   580 
   573