common/build.xml
changeset 1247 311e0398c886
parent 1205 3698c6929ff1
child 1249 96548ab09767
equal deleted inserted replaced
1246:85da5566bcbb 1247:311e0398c886
   474         <stopwatch name="sf-syncsource" action="elapsed"/>
   474         <stopwatch name="sf-syncsource" action="elapsed"/>
   475     </target>
   475     </target>
   476     
   476     
   477     <target name="sf-get-source" depends="sf-generate-source-spec">
   477     <target name="sf-get-source" depends="sf-generate-source-spec">
   478         <stopwatch name="sf-get-source"/>
   478         <stopwatch name="sf-get-source"/>
   479         <if>
   479         <!-- Get test manifest, and move resolved csv so that it doesnt conflict with source-spec.ant.xml -->
   480             <istrue value="${sf.spec.sourcesync.enable}"/>
   480         <if>
   481             <then>
   481             <istrue value="${sf.spec.smoketest.enable}"/>
   482                 <!-- Get test manifest, and move resolved csv so that it doesnt conflict with source-spec.ant.xml -->
   482             <then>
   483                 <if>
   483                 <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
   484                     <available file="${temp.build.dir}/source-test-spec.ant.xml"/>
   484                 <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
   485                     <then>
   485             </then>
   486                         <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
   486         </if>
   487                         <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
   487 
   488                     </then>
   488 
   489                 </if>
   489         <if><available file="${temp.build.dir}/source-rnd-spec.ant.xml"/>
   490         
   490           <then>
   491                 <if><available file="${temp.build.dir}/source-rnd-spec.ant.xml"/>
   491               <ant antfile="${temp.build.dir}/source-rnd-spec.ant.xml" />
   492                     <then>
   492               <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_rnd.csv"/>
   493                         <ant antfile="${temp.build.dir}/source-rnd-spec.ant.xml" />
   493           </then>
   494                         <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_rnd.csv"/>
   494         </if>
   495                     </then>
   495         
   496                 </if>
   496         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   497                 
       
   498                 <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
       
   499             </then>
       
   500         </if>
       
   501         <stopwatch name="sf-get-source" action="elapsed"/>
   497         <stopwatch name="sf-get-source" action="elapsed"/>
   502     </target>
   498     </target>
   503     
   499     
   504     <target name="sf-generate-source-spec">
   500     <target name="sf-generate-source-spec">
   505         <!-- If we've not had a cache specified, but we should use one, then work one out... -->
   501         <!-- If we've not had a cache specified, but we should use one, then work one out... -->
   537         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   533         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   538         for multiple package builds, this needs to be linked with package name. -->
   534         for multiple package builds, this needs to be linked with package name. -->
   539         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   535         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   540         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   536         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   541         
   537         
   542         <property name="sf.source.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   538         <property name="sf.test.csv.file" value="nul:"/>
   543         <if><available file="${sf.source.csv.file}"/>
   539         
   544             <then>
   540         <if>
   545                 <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   541             <istrue value="${sf.spec.sourcesync.enable}" />
   546                       outputFile="${temp.build.dir}/source-spec.ant.xml">
   542             <then>
   547                     <data expandProperties="yes">
   543                 <property name="sf.source.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   548                         ant: antProperties()
   544                 <property name="sf.source_rnd.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
   549                         data: [
   545             </then>
   550                             csv(${sf.source.csv.file}, {separator:','})
   546         </if>
   551                         ]
   547         <property name="sf.source.csv.file"     value="nul:"/>
   552                     </data>
   548         <property name="sf.source_rnd.csv.file" value="nul:"/>
   553                 </fmpp>
   549 
   554             </then>
   550         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   555         </if>
   551               outputFile="${temp.build.dir}/source-spec.ant.xml">
   556 
   552               <data expandProperties="yes">
   557         <property name="sf.source_rnd.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
   553                     ant: antProperties()
   558         <if><available file="${sf.source_rnd.csv.file}"/>
   554                     data: [
       
   555                         csv(${sf.source.csv.file}, {separator:','})
       
   556                     ]
       
   557               </data>
       
   558         </fmpp>
       
   559 		
       
   560         <if><available file="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
   559           <then>
   561           <then>
   560             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   562             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   561                   outputFile="${temp.build.dir}/source-rnd-spec.ant.xml">
   563                   outputFile="${temp.build.dir}/source-rnd-spec.ant.xml">
   562                   <data expandProperties="yes">
   564                   <data expandProperties="yes">
   563                         ant: antProperties()
   565                         ant: antProperties()
   566                         ]
   568                         ]
   567                   </data>
   569                   </data>
   568             </fmpp>
   570             </fmpp>
   569           </then>
   571           </then>
   570         </if>
   572         </if>
   571 
   573         <if>
   572         <property name="sf.test.csv.file" value="nul:"/>
   574             <istrue value="${sf.spec.smoketest.enable}"/>
   573         <if>
       
   574             <available file="${sf.test.csv.file}"/>
       
   575             <then>
   575             <then>
   576             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   576             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   577                   outputFile="${temp.build.dir}/source-test-spec.ant.xml">
   577                   outputFile="${temp.build.dir}/source-test-spec.ant.xml">
   578                   <data expandProperties="yes">
   578                   <data expandProperties="yes">
   579                         ant: antProperties()
   579                         ant: antProperties()
   712         <!-- Make a copy in BOM dir -->
   712         <!-- Make a copy in BOM dir -->
   713         <copy file="${build.drive}/output/logs/sf-diamondize-bom.xml" tofile="${build.log.dir}/BOM/build-info.xml"/>
   713         <copy file="${build.drive}/output/logs/sf-diamondize-bom.xml" tofile="${build.log.dir}/BOM/build-info.xml"/>
   714     </target>
   714     </target>
   715 
   715 
   716     <target name="sf-preprocess-package-config">
   716     <target name="sf-preprocess-package-config">
   717         <!-- preprocess by stripping the header of the rnd source and concat with sources.csv -->
   717 	<!-- preprocess by stripping the header of the rnd source and concat with sources.csv -->
   718         <loadfile srcfile="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}" property="rnd.source.no.header" failonerror="false">
   718     <loadfile srcfile="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}" property="rnd.source.no.header" failonerror="false">
   719             <filterchain>
   719     <filterchain>
   720                 <headfilter skip="1"/>
   720       <headfilter skip="1"/>
   721             </filterchain>
   721     </filterchain>
   722         </loadfile>
   722     </loadfile>
   723         <echo message="${rnd.source.no.header}" file="${temp.build.dir}/sources_rnd_no_header.csv"/>
   723     <echo message="${rnd.source.no.header}" file="${temp.build.dir}/sources_rnd_no_header.csv"/>
   724 
   724     
   725         <!-- order is important as the rnd source now has no header -->
   725     <!-- order is important as the rnd source now has no header -->
   726         <concat destfile="${temp.build.dir}/sources.csv" force="yes">
   726     <concat destfile="${temp.build.dir}/sources.csv" force="yes">
   727            <file file="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   727        <file file="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   728            <file file="${temp.build.dir}/sources_rnd_no_header.csv"/>
   728        <file file="${temp.build.dir}/sources_rnd_no_header.csv"/>
   729         </concat>
   729     </concat>
   730 
   730 
   731         <echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   731     <echo message="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   732         <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
   732         <exec executable="perl" dir="${build.drive}/" failonerror="false" output="${build.log.dir}/zipconfig.log">
   733             <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
   733             <arg value="${sf.common.config.dir}/tools/populateziptemplate.pl"/>
   734             <arg value="${temp.build.dir}/sources.csv"/>
   734             <arg value="${temp.build.dir}/sources.csv"/>
   735             <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
   735             <arg value="${sf.common.config.dir}/templates/zip.cfg.xml.ftl.template"/>
   736             <arg value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   736             <arg value="${temp.build.dir}/zip.cfg.xml.ftl"/>
   820     </target>
   820     </target>
   821     
   821     
   822     <!-- Unpack the rnd zips ready to be used in the build -->
   822     <!-- Unpack the rnd zips ready to be used in the build -->
   823     <target name="sf-unpack-rnd">
   823     <target name="sf-unpack-rnd">
   824         <echo message="INFO Unpacking any available RnD binaries"/>
   824         <echo message="INFO Unpacking any available RnD binaries"/>
   825         <mkdir dir="${build.drive}/output/zips/"/>
   825 		<mkdir dir="${build.drive}/output/zips/"/>
   826         <for param="rndZip">
   826         <for param="rndZip">
   827             <fileset dir="${build.drive}/output/zips/">
   827             <fileset dir="${build.drive}/output/zips/">
   828                 <include name="binaries_*.zip"/> <!-- Internal rnd bins -->
   828                 <include name="binaries_*.zip"/> <!-- Internal rnd bins -->
   829                 <include name="release/bin_*.zip"/> <!-- Releaseable rnd bins -->
   829                 <include name="release/bin_*.zip"/> <!-- Releaseable rnd bins -->
   830             </fileset>
   830             </fileset>