buildframework/helium/tools/preparation/preparation.ant.xml
changeset 179 d8ac696cc51f
parent 1 be27ed110b50
child 217 0f5e3a7fb6af
equal deleted inserted replaced
1:be27ed110b50 179:d8ac696cc51f
    75             </try>
    75             </try>
    76             <catch>
    76             <catch>
    77                 <echo message="Error: getenv failed"/>
    77                 <echo message="Error: getenv failed"/>
    78             </catch>
    78             </catch>
    79         </trycatch>
    79         </trycatch>
    80         <hlm:tempRecordStopMacro name="${build.id}_getenv.log" filterref="filterset.getenv"/>
    80         <hlm:tempRecordStopMacro name="${build.id}_getenv.log" filterref="filterset.getenv" phase="prep"/>
    81     </target>
    81     </target>
    82 
    82 
    83         
    83         
    84     <!-- Removes an older build area from a machine, based on a count of 
    84     <!-- Removes an older build area from a machine, based on a count of 
    85     how many build areas to maintain at a time.
    85     how many build areas to maintain at a time.
   203     </target>
   203     </target>
   204 
   204 
   205 
   205 
   206     <!-- Gets the ARM compiler license text. -->
   206     <!-- Gets the ARM compiler license text. -->
   207     <target name="get-arm-license">
   207     <target name="get-arm-license">
   208         <exec executable="armcc.exe" outputproperty="arm.compiler.version.text" failonerror="${failonerror}">
   208         <exec executable="armcc" outputproperty="arm.compiler.version.text" failonerror="${failonerror}">
   209             <arg value="--vsn" />
   209             <arg value="--vsn" />
   210         </exec>
   210         </exec>
   211         <echo message="ARM compiler version text: ${arm.compiler.version.text}" />
   211         <echo message="ARM compiler version text: ${arm.compiler.version.text}" />
   212     </target>
   212     </target>
   213 
   213 
   228     <target name="set-arm-version" depends="check-env-arm-license" unless="not.using.rvct">
   228     <target name="set-arm-version" depends="check-env-arm-license" unless="not.using.rvct">
   229         <loadresource property="arm.compiler.version">
   229         <loadresource property="arm.compiler.version">
   230             <propertyresource name="arm.compiler.version.text"/>
   230             <propertyresource name="arm.compiler.version.text"/>
   231             <filterchain>
   231             <filterchain>
   232                 <linecontainsregexp>
   232                 <linecontainsregexp>
   233                     <regexp pattern="ARM/Thumb C/C\+\+ Compiler" />
   233                     <regexp pattern="ARM.* C/C\+\+ Compiler" />
   234                 </linecontainsregexp>
   234                 </linecontainsregexp>
   235             </filterchain>
   235             </filterchain>
   236         </loadresource>
   236         </loadresource>
   237         <echo message="ARM compiler version: ${arm.compiler.version}" />
   237         <echo message="ARM compiler version: ${arm.compiler.version}" />
   238     </target>
   238     </target>
   265 
   265 
   266     <!-- Generates a starting XML file for the build summary. -->
   266     <!-- Generates a starting XML file for the build summary. -->
   267     <target name="build-info" depends="log-build-start">
   267     <target name="build-info" depends="log-build-start">
   268         <dirname file="${build.summary.file}" property="build.summary.file.dir"/>
   268         <dirname file="${build.summary.file}" property="build.summary.file.dir"/>
   269         <mkdir dir="${build.summary.file.dir}"/>
   269         <mkdir dir="${build.summary.file.dir}"/>
       
   270         <mkdir dir="${prep.log.dir}"/>
   270         <xmltask dest="${build.log.dir}/${build.id}_info.log.xml">
   271         <xmltask dest="${build.log.dir}/${build.id}_info.log.xml">
   271             <insert path="/">
   272             <insert path="/">
   272                 <![CDATA[
   273                 <![CDATA[
   273             <info>
   274             <info>
   274                 <id>${build.id}</id>
   275                 <id>${build.id}</id>
   408      
   409      
   409     <!-- Creates several initial directories in a new build area. -->
   410     <!-- Creates several initial directories in a new build area. -->
   410     <target name="init-build-area" depends="check-env-build-drive">
   411     <target name="init-build-area" depends="check-env-build-drive">
   411         <mkdir dir="${build.output.dir}" />
   412         <mkdir dir="${build.output.dir}" />
   412         <mkdir dir="${build.log.dir}" />
   413         <mkdir dir="${build.log.dir}" />
   413         <mkdir dir="${temp.build.dir}" />
   414         <mkdir dir="${prep.log.dir}" />
       
   415         <mkdir dir="${compile.log.dir}" />
       
   416         <mkdir dir="${test.log.dir}" />
       
   417         <mkdir dir="${post.log.dir}" />
       
   418         <mkdir dir="${temp.build.dir}" />  
       
   419         <mkdir dir="${diamonds.build.output.dir}" />       
   414     </target>
   420     </target>
   415     
   421     
   416     
   422     
   417     <!-- Basic initialization for a build, including starting the main ant_build log.
   423     <!-- Basic initialization for a build, including starting the main ant_build log.
   418         It also copies the additional logs from the temp directory into the build area. -->
   424         It also copies the additional logs from the temp directory into the build area. -->
   419     <target name="init" depends="get-ccm-password">
   425     <target name="init" depends="get-ccm-password">
   420         <runtarget target="build-number"/>
   426         <runtarget target="build-number"/>
   421         <runtarget target="init-build-area"/>
   427         <runtarget target="init-build-area"/>
   422         <runtarget target="start-ant-log"/>
   428         <runtarget target="build-info"/>
   423     </target>
   429         
   424     
       
   425     <!-- Starting the main ant_build log -->
       
   426     <target name="start-ant-log" depends="build-info">
       
   427         <record name="${build.log}" append="true" loglevel="info"/>
       
   428         <echo>Start main Ant build log: ${build.log}</echo>
       
   429     
       
   430         <echo>Copying temp logs from ${build.cache.log.dir} into the build area.</echo>
   430         <echo>Copying temp logs from ${build.cache.log.dir} into the build area.</echo>
   431         <copy todir="${build.log.dir}" verbose="true" failonerror="false">
   431         <copy todir="${prep.log.dir}" verbose="true" failonerror="false">
   432             <fileset dir="${build.cache.log.dir}">
   432             <fileset dir="${build.cache.log.dir}">
   433                 <include name="*.log"/>
   433                 <include name="*.log"/>
   434                 <include name="*.xml"/>
   434                 <include name="*.xml"/>
   435             </fileset>
   435             </fileset>
   436         </copy>
   436         </copy>
   437     </target>
   437         
       
   438     </target>
       
   439     
       
   440     <!-- Starting the main ant_build log 
       
   441     <deprecated>
       
   442     Now this will be take care by the logging listener.
       
   443     It will start the main ant logging when ever the build starts.
       
   444     </deprecated>-->
       
   445     <target name="start-ant-log" />
       
   446     
   438     
   447     
   439     <!-- This target exists as a trigger for initiating the Diamonds logger. If 
   448     <!-- This target exists as a trigger for initiating the Diamonds logger. If 
   440           it is not included in the build sequence, the build will not be logged to 
   449           it is not included in the build sequence, the build will not be logged to 
   441           Diamonds. Also  build.property.cache.file will be there contains all the diamonds related properties 
   450           Diamonds. Also  build.property.cache.file will be there contains all the diamonds related properties 
   442     --> 
   451     --> 
   443     <target name="diamonds">
   452     <target name="diamonds">
   444         <mkdir dir="${build.log.dir}" />
   453         <mkdir dir="${diamonds.build.output.dir}" />
   445         <var name="diamonds.build.url"  value="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}"/>
   454         <var name="diamonds.build.url"  value="http://${diamonds.host}:${diamonds.port}${diamonds.build.id}"/>
   446         <echoproperties destfile="${build.property.cache.file}">
   455         <echoproperties destfile="${build.property.cache.file}">
   447             <propertyset>
   456             <propertyset>
   448                 <propertyref prefix="diamonds.build.url"/>
   457                 <propertyref prefix="diamonds.build.url"/>
   449                 <propertyref prefix="diamonds.host"/>
   458                 <propertyref prefix="diamonds.host"/>
   477     </target>
   486     </target>
   478 
   487 
   479 
   488 
   480     <!-- Preps the build area by copying and unzipping all the inputs. -->
   489     <!-- Preps the build area by copying and unzipping all the inputs. -->
   481     <target name="prep-copy" depends="prep-prepare-input">
   490     <target name="prep-copy" depends="prep-prepare-input">
   482         <preset.exec executable="${env.PERL}" output="${build.log.dir}/${build.id}_buildarea_prep.log" failonerror="true">
   491         <preset.exec executable="${env.PERL}" output="${prep.log.dir}/${build.id}_buildarea_prep.log" failonerror="true">
   483             <arg value="${helium.dir}/tools/preparation/prep_build_area.pl" />
   492             <arg value="${helium.dir}/tools/preparation/prep_build_area.pl" />
   484             <arg value="-config" />
   493             <arg value="-config" />
   485             <arg value="${prep.config.file.parsed}" />
   494             <arg value="${prep.config.file.parsed}" />
   486             <arg value="-destdir" />
   495             <arg value="-destdir" />
   487             <arg value="${build.drive}${env.EPOCROOT}" />
   496             <arg value="${build.drive}${env.EPOCROOT}" />
   491         <!-- Delete Symbian file to force S60 version to compile -->
   500         <!-- Delete Symbian file to force S60 version to compile -->
   492         <delete file="${build.drive}/epoc32/tools/j2me/hromize.exe" />
   501         <delete file="${build.drive}/epoc32/tools/j2me/hromize.exe" />
   493         <!-- parsing the generated log -->
   502         <!-- parsing the generated log -->
   494         <hlm:metadatarecord database="${metadata.dbfile}">
   503         <hlm:metadatarecord database="${metadata.dbfile}">
   495             <hlm:textmetadatainput>
   504             <hlm:textmetadatainput>
   496                 <fileset casesensitive="false" file="${build.log.dir}/${build.id}_buildarea_prep.log" />
   505                 <fileset casesensitive="false" file="${prep.log.dir}/${build.id}_buildarea_prep.log" />
   497                 <metadatafilterset refid="filterset.buildarea.prep" />
   506                 <metadatafilterset refid="filterset.buildarea.prep" />
   498             </hlm:textmetadatainput>
   507             </hlm:textmetadatainput>
   499         </hlm:metadatarecord>
   508         </hlm:metadatarecord>
   500         <hlm:generateBuildStatus file="${build.id}_buildarea_prep.log" />
   509         <hlm:generateBuildStatus file="${build.id}_buildarea_prep.log" />
   501     </target>
   510     </target>
   512     <!-- Wrapper target to call prep-work-area during the build.
   521     <!-- Wrapper target to call prep-work-area during the build.
   513          log will get recorded under the log directory.
   522          log will get recorded under the log directory.
   514          Property ccm.enabled has to be set to 'true' to enable that step!
   523          Property ccm.enabled has to be set to 'true' to enable that step!
   515          prep-work-area-check-errors is also run so it emits a signal in case of errors.
   524          prep-work-area-check-errors is also run so it emits a signal in case of errors.
   516       -->
   525       -->
   517     <target name="do-prep-work-area">
   526     <target name="do-prep-work-area" depends="find-files-pre">
   518         <runtarget target="prep-work-area"/>
   527         <runtarget target="prep-work-area"/>
       
   528         <runtarget target="find-files-post"/>
   519     </target>
   529     </target>
   520     <!-- <deprecated>Please use do-prep-work-area</deprecated> -->
   530     <!-- <deprecated>Please use do-prep-work-area</deprecated> -->
   521     <target name="do-ccm-get-input" depends="do-prep-work-area"/>
   531     <target name="do-ccm-get-input" depends="do-prep-work-area"/>
   522     
   532     
   523     
   533     
   559                 <record name="${build.log}" action="stop" append="true"/>
   569                 <record name="${build.log}" action="stop" append="true"/>
   560             </then>
   570             </then>
   561         </if>
   571         </if>
   562         <hlm:metadatarecord database="${metadata.dbfile}">
   572         <hlm:metadatarecord database="${metadata.dbfile}">
   563             <hlm:antmetadatainput>
   573             <hlm:antmetadatainput>
   564                 <fileset casesensitive="false" file="${build.log.dir}/${build.id}_ant_build.log" />
   574                 <fileset casesensitive="false" file="${build.log.dir}/${build.id}_main.ant.log" />
   565                 <metadatafilterset refid="filterset.ant.output" />
   575                 <metadatafilterset refid="filterset.ant.output" />
   566             </hlm:antmetadatainput>
   576             </hlm:antmetadatainput>
   567         </hlm:metadatarecord>
   577         </hlm:metadatarecord>
   568         <hlm:generateBuildStatus file="${build.id}_ant_build.log" />
   578         <hlm:generateBuildStatus file="${build.id}_main.ant.log" />
   569         <!-- Todo: metadata: insert assertions for metadata parsing here -->
   579         <!-- Todo: metadata: insert assertions for metadata parsing here -->
   570     </target>
   580     </target>
   571     
   581     
   572     <!-- Set properties for track full build event. -->
   582     <!-- Set properties for track full build event. -->
   573     <target name="set-fullbuild-properties">
   583     <target name="set-fullbuild-properties">