common/build.xml
changeset 861 caa0601f50c5
parent 860 fbd25e274e6b
child 864 2b0f08dedb30
equal deleted inserted replaced
860:fbd25e274e6b 861:caa0601f50c5
    87         <else>
    87         <else>
    88             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/>
    88             <property name="sf.spec.sourcesync.sourcespecdir" value="${sf.project.location}"/>
    89         </else>
    89         </else>
    90     </if>
    90     </if>
    91     
    91     
    92     <target name="sf-prep" depends="prep-drive,init-build-area,check-tool-dependencies,create-bom,log-build-env">
    92     <target name="sf-prep" depends="sf-prep-announce,prep-drive,init-build-area,check-tool-dependencies,create-bom,log-build-env">
    93         <echo>[SF-PREP]</echo>
       
    94         <!-- Test for the disk space we would like for this build -->
    93         <!-- Test for the disk space we would like for this build -->
    95 	<fail>
    94 	<fail>
    96             <condition>
    95             <condition>
    97                 <not>
    96                 <not>
    98                     <or>
    97                     <or>
   105         </fail>
   104         </fail>
   106 
   105 
   107         <tempfile property="prep.dynamic.config" suffix="ant.xml" destdir="${temp.build.dir}"/>
   106         <tempfile property="prep.dynamic.config" suffix="ant.xml" destdir="${temp.build.dir}"/>
   108 
   107 
   109         <runtarget target="sf-check-env"/>
   108         <runtarget target="sf-check-env"/>
   110     </target>
   109         <stopwatch name="sf-prep" action="elapsed"/>
   111         
   110     </target>
       
   111 
       
   112     <target name="sf-prep-announce">    
       
   113         <stopwatch name="sf-prep"/>
       
   114         <echo>[SF-PREP]</echo>
       
   115     </target>
       
   116 
   112     <target name="sf-check-env">
   117     <target name="sf-check-env">
   113         <!-- Conditional location of BuildEnv.xml. Project always preferred to default -->
   118         <!-- Conditional location of BuildEnv.xml. Project always preferred to default -->
   114         <if><available file="${sf.project.location}/BuildEnv.xml"/>        
   119         <if><available file="${sf.project.location}/BuildEnv.xml"/>        
   115             <then>
   120             <then>
   116                 <property name="sf.buildenv.location" value="${sf.project.location}"/>
   121                 <property name="sf.buildenv.location" value="${sf.project.location}"/>
   233         <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" todir="${build.log.dir}/BOM/"/>
   238         <copy file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}.xml" todir="${build.log.dir}/BOM/"/>
   234         <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
   239         <delete file="${build.drive}/output/build/canonical_system_definition_${sysdef.configuration}_temp.xml"/>
   235     </target>
   240     </target>
   236 
   241 
   237     <target name="sf-prebuild" depends="sf-prep,sf-prebuild-noprep"/>
   242     <target name="sf-prebuild" depends="sf-prep,sf-prebuild-noprep"/>
   238     <target name="sf-prebuild-noprep" depends="sf-prebuild-announce,sf-diamonds-connect,sf-diamonds-tag-build,sf-getenvs,sf-syncsource,sf-diamondize-bom"/>
   243     <target name="sf-prebuild-noprep" depends="sf-prebuild-announce,sf-diamonds-connect,sf-diamonds-tag-build,sf-getenvs,sf-syncsource,sf-diamondize-bom">
       
   244         <stopwatch name="sf-prebuild" action="elapsed"/>
       
   245     </target>
   239     
   246     
   240     <target name="sf-prebuild-announce">
   247     <target name="sf-prebuild-announce">
       
   248         <stopwatch name="sf-prebuild"/>
   241         <echo>[SF-PREBUILD]</echo>
   249         <echo>[SF-PREBUILD]</echo>
   242     </target>
   250     </target>
   243     
   251     
   244     <target name="sf-diamonds-connect">
   252     <target name="sf-diamonds-connect">
   245       <if>
   253       <if>
   295         </exec>
   303         </exec>
   296 	<echo message="${sf.job.bom.project.repo},build/config,${sf.job.bom.project.checksum}" file="${build.drive}/output/logs/BOM/project.csv"/>
   304 	<echo message="${sf.job.bom.project.repo},build/config,${sf.job.bom.project.checksum}" file="${build.drive}/output/logs/BOM/project.csv"/>
   297     </target>
   305     </target>
   298 
   306 
   299     <target name="sf-getenvs">
   307     <target name="sf-getenvs">
       
   308         <stopwatch name="sf-getenvs"/>
   300         <!-- create BOM dir -->
   309         <!-- create BOM dir -->
   301         <mkdir dir="${build.drive}/output/logs/BOM"/>
   310         <mkdir dir="${build.drive}/output/logs/BOM"/>
   302         
   311         
   303         <!-- tools baseline must come before epoc baseline to allow clean listing -->
   312         <!-- tools baseline must come before epoc baseline to allow clean listing -->
   304         <touch file="${build.drive}/output/logs/BOM/toolsbaseline.txt"/>
   313         <touch file="${build.drive}/output/logs/BOM/toolsbaseline.txt"/>
   305         <if>
   314         <if>
   306             <istrue value="${sf.spec.toolsbaseline.enable}" />
   315             <istrue value="${sf.spec.toolsbaseline.enable}" />
   307             <then>
   316             <then>
       
   317                 <stopwatch name="sf-getenvs (tools)"/>
   308 
   318 
   309                 <!-- record toolsbaseline information in BOM file -->
   319                 <!-- record toolsbaseline information in BOM file -->
   310                 <echo message="${sf.spec.toolsbaseline.location}" file="${build.drive}/output/logs/BOM/toolsbaseline.txt"/>
   320                 <echo message="${sf.spec.toolsbaseline.location}" file="${build.drive}/output/logs/BOM/toolsbaseline.txt"/>
   311 
   321 
   312                 <!-- wrapper around preparation-getenv but with diff params -->
   322                 <!-- wrapper around preparation-getenv but with diff params -->
   315                 <echo message="INFO Getting tools environment listing"/>
   325                 <echo message="INFO Getting tools environment listing"/>
   316                 <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_toolsbaseline.log">
   326                 <exec executable="perl" dir="${build.log.dir}/" failonerror="true" output="${build.log.dir}/listdir_${build.id}_toolsbaseline.log">
   317                     <arg value="${sf.common.config.dir}/tools/listdir.pl"/>
   327                     <arg value="${sf.common.config.dir}/tools/listdir.pl"/>
   318                     <arg value="${build.drive}/epoc32"/>
   328                     <arg value="${build.drive}/epoc32"/>
   319                 </exec>
   329                 </exec>
       
   330                 <stopwatch name="sf-getenvs (tools)" action="elapsed"/>
   320             </then>
   331             </then>
   321         </if>        
   332         </if>        
   322 
   333 
   323         <touch file="${build.drive}/output/logs/BOM/baseline.txt"/>
   334         <touch file="${build.drive}/output/logs/BOM/baseline.txt"/>
   324         <if>
   335         <if>
   325             <istrue value="${sf.spec.baseline.enable}" />
   336             <istrue value="${sf.spec.baseline.enable}" />
   326             <then>
   337             <then>
       
   338                 <stopwatch name="sf-getenvs (baseline)"/>
   327                 <!-- record baseline information in BOM file -->
   339                 <!-- record baseline information in BOM file -->
   328                 <echo message="${sf.spec.baseline.location}" file="${build.drive}/output/logs/BOM/baseline.txt"/>
   340                 <echo message="${sf.spec.baseline.location}" file="${build.drive}/output/logs/BOM/baseline.txt"/>
   329                 
   341                 
   330                 <!-- run internal target preparation-getenv -->
   342                 <!-- run internal target preparation-getenv -->
   331                 <runtarget target="preparation-getenv"/>
   343                 <runtarget target="preparation-getenv"/>
   332             </then>
   344                 <stopwatch name="sf-getenvs (baseline)" action="elapsed"/>
   333         </if>
   345             </then>
       
   346         </if>
       
   347         <stopwatch name="sf-getenvs" action="elapsed"/>
   334     </target>
   348     </target>
   335 
   349 
   336     <target name="sf-getenv-tools">
   350     <target name="sf-getenv-tools">
   337         <antcall target="preparation-getenv" inheritAll="false">
   351         <antcall target="preparation-getenv" inheritAll="false">
   338             <param name="base_release.path"           value="${sf.spec.toolsbaseline.location}"/>
   352             <param name="base_release.path"           value="${sf.spec.toolsbaseline.location}"/>
   339             <param name="base_release.getenv_options" value="${sf.spec.toolsbaseline.getenv_options}"/>
   353             <param name="base_release.getenv_options" value="${sf.spec.toolsbaseline.getenv_options}"/>
   340         </antcall>
   354         </antcall>
   341     </target>
   355     </target>
   342 
   356 
   343     <target name="sf-syncsource">
   357     <target name="sf-syncsource">
       
   358         <stopwatch name="sf-syncsource"/>
   344         <touch file="${build.log.dir}/BOM/sources.csv"/> 
   359         <touch file="${build.log.dir}/BOM/sources.csv"/> 
   345         <if>
   360         <if>
   346             <istrue value="${sf.spec.sourcesync.enable}" />
   361             <istrue value="${sf.spec.sourcesync.enable}" />
   347             <then>
   362             <then>
   348                 <runtarget target="sf-get-source"/>                
   363                 <runtarget target="sf-get-source"/>                
   349                 <runtarget target="sf-package-source"/>                
   364                 <runtarget target="sf-package-source"/>                
   350                 <runtarget target="sf-unpack-rnd"/>
   365                 <runtarget target="sf-unpack-rnd"/>
   351             </then>
   366             </then>
   352         </if>        
   367         </if>        
       
   368         <stopwatch name="sf-syncsource" action="elapsed"/>
   353     </target>
   369     </target>
   354 
   370 
   355     <!-- generate dir list using passed location and name 
   371     <!-- generate dir list using passed location and name 
   356     if a baseline list is available then generate deltas too -->
   372     if a baseline list is available then generate deltas too -->
   357 
   373 
   409             </then>
   425             </then>
   410         </if>
   426         </if>
   411     </target>
   427     </target>
   412 
   428 
   413     <!-- This target is overridden in platform builds, but used directly in package builds -->
   429     <!-- This target is overridden in platform builds, but used directly in package builds -->
   414     <target name="sf-build-noprep" depends="sf-truclean,sf-model-from-project,sf-compile,sf-postbuild">
   430     <target name="sf-build-noprep" depends="sf-truclean,sf-model-from-project,sf-compile">
   415         <echo>[SF-BUILD-NOPREP]</echo>
   431         <echo>[SF-BUILD-NOPREP]</echo>
   416     </target>
   432     </target>
   417     
   433     
   418     <target name="create-canonical-sysdef-file">
   434     <target name="create-canonical-sysdef-file">
   419       <copy file="${build.drive}/${sf.spec.systemdefinition.location}" tofile="${canonical.sysdef.file}" failonerror="true" verbose="true"/>
   435       <copy file="${build.drive}/${sf.spec.systemdefinition.location}" tofile="${canonical.sysdef.file}" failonerror="true" verbose="true"/>
   420     </target>
   436     </target>
   421     
   437     
   422   <target name="sf-truclean">
   438   <target name="sf-truclean">
       
   439     <stopwatch name="sf-truclean"/>
   423     <if>
   440     <if>
   424       <istrue value="${sf.spec.build.clean.enable}"/>
   441       <istrue value="${sf.spec.build.clean.enable}"/>
   425       <then>
   442       <then>
   426         <echo message="Executing truclean step."/>
   443         <echo message="Executing truclean step."/>
   427         <fmpp sourceFile="${sf.common.config.dir}/templates/truclean.ant.xml.ftl"
   444         <fmpp sourceFile="${sf.common.config.dir}/templates/truclean.ant.xml.ftl"
   435       </then>
   452       </then>
   436       <else>
   453       <else>
   437         <echo message="Skipping truclean step."/>
   454         <echo message="Skipping truclean step."/>
   438       </else>
   455       </else>
   439     </if>
   456     </if>
       
   457     <stopwatch name="sf-truclean" action="elapsed"/>
   440   </target>
   458   </target>
   441   
   459   
   442   <target name="sf-model-from-project">
   460   <target name="sf-model-from-project">
       
   461     <stopwatch name="sf-model-from-project"/>
   443     <if>
   462     <if>
   444       <isset property="sf.spec.systemdefinition.source"/>
   463       <isset property="sf.spec.systemdefinition.source"/>
   445       <then>
   464       <then>
   446         <echo message="Using ${sf.spec.systemdefinition.source} as model file"/>
   465         <echo message="Using ${sf.spec.systemdefinition.source} as model file"/>
   447         <echo message="Copying to ${build.drive}/definition.xml"/>
   466         <echo message="Copying to ${build.drive}/definition.xml"/>
   455           <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   474           <arg value="${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}"/>
   456           <arg value="${sf.config.dir}/../build/config/${sf.spec.job.codeline}"/>
   475           <arg value="${sf.config.dir}/../build/config/${sf.spec.job.codeline}"/>
   457         </exec>
   476         </exec>
   458       </else>
   477       </else>
   459     </if>
   478     </if>
       
   479     <stopwatch name="sf-model-from-project" action="elapsed"/>
   460   </target>
   480   </target>
   461     
   481     
   462     <target name="sf-get-source" depends="sf-generate-source-spec">
   482     <target name="sf-get-source" depends="sf-generate-source-spec">
   463         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   483         <ant antfile="${temp.build.dir}/source-spec.ant.xml" />
   464     </target>
   484     </target>