common/build.xml
changeset 1185 3698c6929ff1
parent 1177 5796b6eeacd9
child 1215 311e0398c886
equal deleted inserted replaced
1184:365ce6d73fd4 1185:3698c6929ff1
   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         <!-- Get test manifest, and move resolved csv so that it doesnt conflict with source-spec.ant.xml -->
   479         <if>
   480         <if>
   480             <istrue value="${sf.spec.sourcesync.enable}"/>
   481             <istrue value="${sf.spec.smoketest.enable}"/>
   481             <then>
   482             <then>
   482                 <!-- Get test manifest, and move resolved csv so that it doesnt conflict with source-spec.ant.xml -->
   483                 <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
   483                 <if>
   484                 <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
   484                     <available file="${temp.build.dir}/source-test-spec.ant.xml"/>
   485             </then>
   485                     <then>
   486         </if>
   486                         <ant antfile="${temp.build.dir}/source-test-spec.ant.xml" />
   487 
   487                         <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_test.csv"/>
   488 
   488                     </then>
   489         <if><available file="${temp.build.dir}/source-rnd-spec.ant.xml"/>
   489                 </if>
   490           <then>
       
   491               <ant antfile="${temp.build.dir}/source-rnd-spec.ant.xml" />
       
   492               <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_rnd.csv"/>
       
   493           </then>
       
   494         </if>
       
   495         
   490         
   496         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   491                 <if><available file="${temp.build.dir}/source-rnd-spec.ant.xml"/>
       
   492                     <then>
       
   493                         <ant antfile="${temp.build.dir}/source-rnd-spec.ant.xml" />
       
   494                         <move file="${build.drive}/output/logs/BOM/sources.csv" tofile="${build.drive}/output/logs/BOM/sources_rnd.csv"/>
       
   495                     </then>
       
   496                 </if>
       
   497                 
       
   498                 <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
       
   499             </then>
       
   500         </if>
   497         <stopwatch name="sf-get-source" action="elapsed"/>
   501         <stopwatch name="sf-get-source" action="elapsed"/>
   498     </target>
   502     </target>
   499     
   503     
   500     <target name="sf-generate-source-spec">
   504     <target name="sf-generate-source-spec">
   501         <!-- If we've not had a cache specified, but we should use one, then work one out... -->
   505         <!-- If we've not had a cache specified, but we should use one, then work one out... -->
   533         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   537         <!-- TODO: 1. Same file name souce-spec.ant.xml is used for all packages
   534         for multiple package builds, this needs to be linked with package name. -->
   538         for multiple package builds, this needs to be linked with package name. -->
   535         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   539         <!-- TODO: 2. Change fmpp data to be a full property rather than relative path -->
   536         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   540         <delete file="${temp.build.dir}/source-spec.ant.xml"/>
   537         
   541         
   538         <property name="sf.test.csv.file" value="nul:"/>
   542         <property name="sf.source.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   539         
   543         <if><available file="${sf.source.csv.file}"/>
   540         <if>
   544             <then>
   541             <istrue value="${sf.spec.sourcesync.enable}" />
   545                 <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   542             <then>
   546                       outputFile="${temp.build.dir}/source-spec.ant.xml">
   543                 <property name="sf.source.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   547                     <data expandProperties="yes">
   544                 <property name="sf.source_rnd.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
   548                         ant: antProperties()
   545             </then>
   549                         data: [
   546         </if>
   550                             csv(${sf.source.csv.file}, {separator:','})
   547         <property name="sf.source.csv.file"     value="nul:"/>
   551                         ]
   548         <property name="sf.source_rnd.csv.file" value="nul:"/>
   552                     </data>
   549 
   553                 </fmpp>
   550         <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   554             </then>
   551               outputFile="${temp.build.dir}/source-spec.ant.xml">
   555         </if>
   552               <data expandProperties="yes">
   556 
   553                     ant: antProperties()
   557         <property name="sf.source_rnd.csv.file" value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile.rnd}"/>
   554                     data: [
   558         <if><available file="${sf.source_rnd.csv.file}"/>
   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}"/>
       
   561           <then>
   559           <then>
   562             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   560             <fmpp sourceFile="${sf.common.config.dir}/templates/source-spec.ant.xml.ftl"
   563                   outputFile="${temp.build.dir}/source-rnd-spec.ant.xml">
   561                   outputFile="${temp.build.dir}/source-rnd-spec.ant.xml">
   564                   <data expandProperties="yes">
   562                   <data expandProperties="yes">
   565                         ant: antProperties()
   563                         ant: antProperties()
   568                         ]
   566                         ]
   569                   </data>
   567                   </data>
   570             </fmpp>
   568             </fmpp>
   571           </then>
   569           </then>
   572         </if>
   570         </if>
   573         <if>
   571 
   574             <istrue value="${sf.spec.smoketest.enable}"/>
   572         <property name="sf.test.csv.file" value="nul:"/>
       
   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>