buildframework/helium/tools/publish/publish.ant.xml
changeset 217 0f5e3a7fb6af
parent 179 d8ac696cc51f
child 587 85df38eb4012
equal deleted inserted replaced
181:59bb7c4d6172 217:0f5e3a7fb6af
    18 
    18 
    19 Description:
    19 Description:
    20 
    20 
    21 ============================================================================
    21 ============================================================================
    22 -->
    22 -->
       
    23 <!--* @package publishing -->
    23 <project name="publish" xmlns:hlm="http://www.nokia.com/helium">
    24 <project name="publish" xmlns:hlm="http://www.nokia.com/helium">
    24     <description>
    25     <description>
    25     Zipping, delta zipping and copying targets
    26     Zipping, delta zipping and copying targets
    26     </description>
    27     </description>
    27 
    28     
    28     <import file="subcon.ant.xml" />
    29     <!--* @property delta.zip.file.size
       
    30     Define the file size of the zipped up released file, this is then used by delta zipping code to determine if a delta zip is required or a full zip should be created. The delta zip will only be published if it is less than 1/2 the size of this property
       
    31     @type string
       
    32     @editable required
       
    33     @scope public
       
    34     -->
       
    35 
       
    36     <!--* @property file-comparison.left_side
       
    37     The fileset id used on the left side of comparison.
       
    38     @type string
       
    39     @editable required
       
    40     @scope public
       
    41     -->
       
    42 
       
    43     <!--* @property file-comparison.right_side
       
    44     The fileset id used on the right side of comparison.
       
    45     @type string
       
    46     @editable required
       
    47     @scope public
       
    48     -->
       
    49 
    29     <import file="internal-api/internal-api.ant.xml" />
    50     <import file="internal-api/internal-api.ant.xml" />
    30     <import file="nwiki.ant.xml" />
    51     <import file="nwiki.ant.xml" />
    31     <import file="synergy.ant.xml" />
    52     <import file="synergy.ant.xml" />
    32     <import file="test/test2_publishing_to_diamonds.ant.xml" />
    53     <import file="test/test2_publishing_to_diamonds.ant.xml" />
    33 
    54 
       
    55     <!-- Set the maximum number of threads running for archiving (for a parallel job).
       
    56     @type integer
       
    57     -->
    34     <property name="archive.max.number.of.threads" value="8" />
    58     <property name="archive.max.number.of.threads" value="8" />
    35     
    59     
    36     <fileset id="publish.files" dir="${build.output.dir}">
    60     <fileset id="publish.files" dir="${build.output.dir}">
    37         <include name="logs/**/*" />
    61         <include name="logs/**/*" />
    38         <exclude name="logs/**/*_ant_build.log" />
    62         <exclude name="logs/**/*_ant_build.log" />
    69     <fileset id="publish.files4" dir="${build.output.dir}">
    93     <fileset id="publish.files4" dir="${build.output.dir}">
    70         <include name="release_flash_images/**/*" />
    94         <include name="release_flash_images/**/*" />
    71     </fileset>
    95     </fileset>
    72 
    96 
    73     <!-- list of filesets -->
    97     <!-- list of filesets -->
       
    98     <!-- The fileset id which will be upload
       
    99     @type string
       
   100     -->
    74     <property name="publish.fileset.ids" value="publish.files1,publish.files2,publish.files3,publish.files4" />
   101     <property name="publish.fileset.ids" value="publish.files1,publish.files2,publish.files3,publish.files4" />
    75 
   102 
    76     <fileset id="helium.files" dir="${helium.dir}">
   103     <fileset id="helium.files" dir="${helium.dir}">
    77         <include name="*.bat" />
   104         <include name="*.bat" />
    78         <include name="**/*.ant.xml" />
   105         <include name="**/*.ant.xml" />
   108     </target>
   135     </target>
   109 
   136 
   110 
   137 
   111     <!-- Parses the zip configuration file. Expands all the ant properties. -->
   138     <!-- Parses the zip configuration file. Expands all the ant properties. -->
   112     <target name="preprocess-zip-config">
   139     <target name="preprocess-zip-config">
       
   140         <!-- Path to the parsed file of zip specification file
       
   141         @type string
       
   142         @scope private
       
   143         -->
   113         <property name="zip.config.file.parsed" location="${temp.build.dir}/zip.cfg.xml.parsed" />
   144         <property name="zip.config.file.parsed" location="${temp.build.dir}/zip.cfg.xml.parsed" />
   114         <copy file="${zip.config.file}" tofile="${zip.config.file.parsed}" overwrite="true">
   145         <copy file="${zip.config.file}" tofile="${zip.config.file.parsed}" overwrite="true">
   115             <filterchain>
   146             <filterchain>
   116                 <expandproperties />
   147                 <expandproperties />
   117             </filterchain>
   148             </filterchain>
   335                     <!-- Don't print 'compressing' on console -->
   366                     <!-- Don't print 'compressing' on console -->
   336                     <hlm:logtoconsole action="stop" />
   367                     <hlm:logtoconsole action="stop" />
   337                     <!-- Stops writing on ...ant_build.log file-->
   368                     <!-- Stops writing on ...ant_build.log file-->
   338                     <hlm:startSpecificLogMacro name="${zip.@{type}.log.file}" phase="@{phase}"/>
   369                     <hlm:startSpecificLogMacro name="${zip.@{type}.log.file}" phase="@{phase}"/>
   339             
   370             
       
   371                     <!-- Path to the parsed file of zip specification file
       
   372                     @type string
       
   373                     @scope private
       
   374                     -->
   340                     <property name="zip.config.file.parsed" location="${temp.build.dir}/zip.cfg.xml.parsed" />
   375                     <property name="zip.config.file.parsed" location="${temp.build.dir}/zip.cfg.xml.parsed" />
   341                     <copy file="@{file}" tofile="${zip.config.file.parsed}" overwrite="true">
   376                     <copy file="@{file}" tofile="${zip.config.file.parsed}" overwrite="true">
   342                         <filterchain>
   377                         <filterchain>
   343                             <expandproperties />
   378                             <expandproperties />
   344                         </filterchain>
   379                         </filterchain>
   353                         <else>
   388                         <else>
   354                             <if>
   389                             <if>
   355                                 <isgreaterthan arg1="${number.of.threads}" arg2="${archive.max.number.of.threads}"/>
   390                                 <isgreaterthan arg1="${number.of.threads}" arg2="${archive.max.number.of.threads}"/>
   356                                 <then>
   391                                 <then>
   357                                     <ant antfile="${build.drive}/ZIP_${zips.@{type}.spec.name}.xml">
   392                                     <ant antfile="${build.drive}/ZIP_${zips.@{type}.spec.name}.xml">
       
   393                                         <!-- how many parallel threads can run
       
   394                                         @type string
       
   395                                         -->
   358                                         <property name="number.of.threads" value="${archive.max.number.of.threads}"/>
   396                                         <property name="number.of.threads" value="${archive.max.number.of.threads}"/>
   359                                     </ant>
   397                                     </ant>
   360                                 </then>
   398                                 </then>
   361                                 <else>
   399                                 <else>
   362                                     <ant antfile="${build.drive}/ZIP_${zips.@{type}.spec.name}.xml" />
   400                                     <ant antfile="${build.drive}/ZIP_${zips.@{type}.spec.name}.xml" />
   500     <!-- Zips the trace rom content -->
   538     <!-- Zips the trace rom content -->
   501     <target name="zip-trace-roms" unless="skip-zips">
   539     <target name="zip-trace-roms" unless="skip-zips">
   502         <hlm:zipContentMacro type="trace_roms" file="${zip.config.file}" />
   540         <hlm:zipContentMacro type="trace_roms" file="${zip.config.file}" />
   503     </target>
   541     </target>
   504 
   542 
   505 
       
   506     <!-- Zips the trace rom content -->
       
   507     <target name="zip-uda-roms" unless="skip-zips">
       
   508         <hlm:zipContentMacro type="uda_roms" file="${zip.config.file}" />
       
   509     </target>
       
   510 
       
   511 
       
   512     <!-- Zips .loc files into individual packages. -->
       
   513     <target name="zip-loc-files">
       
   514         <mkdir dir="${temp.loc.dir}" />
       
   515         <exec executable="perl" dir="${build.drive}/" failonerror="${failonerror}">
       
   516             <arg file="${helium.dir}/tools/publish/get_loc_files.pl" />
       
   517             <arg value="${build.drive}" />
       
   518         </exec>
       
   519         <zip destfile="${loc.output.dir}/${loc.output.filename}" basedir="${temp.loc.dir}" />
       
   520     </target>
       
   521 
       
   522 
       
   523     <!-- Publishes the content defined by the filesets at the top of this project.
   543     <!-- Publishes the content defined by the filesets at the top of this project.
   524     
   544     
   525     The files are split into 4 filesets to parallelize the publish operation:
   545     The files are split into 4 filesets to parallelize the publish operation:
   526     
   546     
   527     * publish.files1
   547     * publish.files1
   619     print "SMTP server " + smtpserver + " unavailable!! Unable to send log to " , toaddrs
   639     print "SMTP server " + smtpserver + " unavailable!! Unable to send log to " , toaddrs
   620     
   640     
   621         </hlm:python>
   641         </hlm:python>
   622     </target>
   642     </target>
   623 
   643 
   624 
       
   625     <!-- Reports on the status of the build, through other targets. -->
   644     <!-- Reports on the status of the build, through other targets. -->
   626     <target name="report" depends="binary-sizes-log" unless="env.HLM_SUBCON">
   645     <target name="report" depends="binary-sizes-log"/>
   627         <antcall target="rndsdk-create-api-descr-xml" />
       
   628     </target>
       
   629 
       
   630 
   646 
   631     <!-- Delta zips -->
   647     <!-- Delta zips -->
   632 
   648 
       
   649     <!-- Output location
       
   650     @type string
       
   651     @scope private
       
   652     -->
   633     <property name="delta.zip.location" value="${build.output.dir}/build_area/delta_zip" />
   653     <property name="delta.zip.location" value="${build.output.dir}/build_area/delta_zip" />
       
   654     <!-- Temp location
       
   655     @type string
       
   656     @scope private
       
   657     -->
   634     <property name="delta.zip.temp.location" value="${temp.build.dir}/delta_zip" />
   658     <property name="delta.zip.temp.location" value="${temp.build.dir}/delta_zip" />
       
   659     <!-- The zip file
       
   660     @type string
       
   661     @scope private
       
   662     -->
   635     <property name="delta.zip.file" value="${delta.zip.location}/${build.id}_delta_zip.zip" />
   663     <property name="delta.zip.file" value="${delta.zip.location}/${build.id}_delta_zip.zip" />
       
   664     <!-- Define the file size of the zipped up released file, this is then used by delta zipping code to determine if a delta zip is required or a full zip should be created. The delta zip will only be published if it is less than 1/2 the size of this property
       
   665     @type string
       
   666     -->
   636     <property name="delta.zip.file.size" value="11000000" />
   667     <property name="delta.zip.file.size" value="11000000" />
   637     <!--default value of approx 11GB-->
   668     <!--default value of approx 11GB-->
   638 
   669 
       
   670     <!-- Special Instructions file for SymDEC
       
   671     @type string
       
   672     @scope private
       
   673     -->
   639     <property name="delta.zip.delete.file" value="${delta.zip.location}/specialInstructions.xml" />
   674     <property name="delta.zip.delete.file" value="${delta.zip.location}/specialInstructions.xml" />
       
   675     <!-- Temp file
       
   676     @type string
       
   677     @scope private
       
   678     -->
   640     <property name="delta.ant.file" value="${delta.zip.temp.location}/delta_zip.ant.xml" />
   679     <property name="delta.ant.file" value="${delta.zip.temp.location}/delta_zip.ant.xml" />
       
   680     <!-- Output location of md5 file
       
   681     @type string
       
   682     @scope private
       
   683     -->
   641     <property name="md5.signature.file" value="${delta.zip.location}/${build.id}.md5" />
   684     <property name="md5.signature.file" value="${delta.zip.location}/${build.id}.md5" />
       
   685     <!-- Number of partial md5 files to use during creation
       
   686     @type string
       
   687     @scope private
       
   688     -->
   642     <property name="md5.split" value="100" />
   689     <property name="md5.split" value="100" />
   643     <!-- old.md5.file needs to be specified by the user -->
   690     <!-- old.md5.file needs to be specified by the user -->
   644 
   691 
   645 
   692 
   646     <!-- Private: Patch evalid tool -->
   693     <!-- Patch evalid tool. @scope private-->
   647     <target name="patch-evalid">
   694     <target name="patch-evalid">
   648         <patch patchfile="${helium.dir}/tools/publish/evalidmd5.patch" originalfile="${build.drive}/epoc32/tools/evalidmd5.pm" />
   695         <patch patchfile="${helium.dir}/tools/publish/evalidmd5.patch" originalfile="${build.drive}/epoc32/tools/evalidmd5.pm" />
   649     </target>
   696     </target>
   650 
   697 
   651 
   698 
   652     <!-- Private: Revert evalid patch -->
   699     <!-- Revert evalid patch. @scope private-->
   653     <target name="unpatch-evalid">
   700     <target name="unpatch-evalid">
   654         <patch reverse="true" patchfile="${helium.dir}/tools/publish/evalidmd5.patch" originalfile="${build.drive}/epoc32/tools/evalidmd5.pm" />
   701         <patch reverse="true" patchfile="${helium.dir}/tools/publish/evalidmd5.patch" originalfile="${build.drive}/epoc32/tools/evalidmd5.pm" />
   655     </target>
   702     </target>
   656 
   703 
   657 
   704 
   658     <!-- Private: Copy extra tool for evalid -->
   705     <!-- Copy extra tool for evalid. @scope private-->
   659     <target name="pre-build-md5" depends="patch-evalid">
   706     <target name="pre-build-md5" depends="patch-evalid">
   660         <copy todir="${build.drive}\epoc32\tools" file="${helium.dir}/tools/publish/evalid_multiple.pl" />
   707         <copy todir="${build.drive}\epoc32\tools" file="${helium.dir}/tools/publish/evalid_multiple.pl" />
   661     </target>
   708     </target>
   662 
   709 
   663 
   710 
   664     <!-- Private: Revert patches -->
   711     <!-- Revert patches. @scope private-->
   665     <target name="post-build-md5" depends="unpatch-evalid" />
   712     <target name="post-build-md5" depends="unpatch-evalid" />
   666 
   713 
   667 
   714 
   668     <!-- Private: Generate a list of checksums for all files in the build area using EBS system -->
   715     <!-- Generate a list of checksums for all files in the build area using EBS system. @scope private-->
   669     <target name="build-md5-ebs" depends="pre-build-md5">
   716     <target name="build-md5-ebs" depends="pre-build-md5">
   670         <mkdir dir="${delta.zip.location}" />
   717         <mkdir dir="${delta.zip.location}" />
   671         <hlm:python failonerror="true">
   718         <hlm:python failonerror="true">
   672 import os
   719 import os
   673 import delta_zip
   720 import delta_zip
   676         </hlm:python>
   723         </hlm:python>
   677 
   724 
   678         <antcall target="post-build-md5" />
   725         <antcall target="post-build-md5" />
   679     </target>
   726     </target>
   680 
   727 
   681     <!-- Private: Generate a list of checksums for all files in the build area using EC system -->
   728     <!-- Generate a list of checksums for all files in the build area using EC system. @scope private-->
   682     <target name="build-md5-ec" depends="pre-build-md5">
   729     <target name="build-md5-ec" depends="pre-build-md5">
   683         <mkdir dir="${delta.zip.location}" />
   730         <mkdir dir="${delta.zip.location}" />
   684         <echo>delta.zip.temp.location: ${delta.zip.temp.location}</echo>
   731         <echo>delta.zip.temp.location: ${delta.zip.temp.location}</echo>
   685         <hlm:python failonerror="true">
   732         <hlm:python failonerror="true">
   686 import os
   733 import os
   693     </target>
   740     </target>
   694 
   741 
   695 
   742 
   696     <!-- Generate a list of checksums for all files in the build area -->
   743     <!-- Generate a list of checksums for all files in the build area -->
   697     <target name="build-md5">
   744     <target name="build-md5">
       
   745         <!-- Comma seperated excluded directories from the zip
       
   746         @type string
       
   747         @scope public
       
   748         -->
   698         <property name="delta.exclude.commasep" value="epoc32_save.zip,output/**/*,delta_zips/**/*,temp/**/*,epoc32/**/*.sym,epoc32/BUILD/**/*" />
   749         <property name="delta.exclude.commasep" value="epoc32_save.zip,output/**/*,delta_zips/**/*,temp/**/*,epoc32/**/*.sym,epoc32/BUILD/**/*" />
   699         <echo>build MD5 started</echo>
   750         <echo>build MD5 started</echo>
   700         <if>
   751         <if>
   701             <isset property="build.system.ec-helium" />
   752             <isset property="build.system.ec-helium" />
   702             <then>
   753             <then>
   752     </target>
   803     </target>
   753 
   804 
   754 
   805 
   755     <!-- Set prop old.md5.file to md5 file from last build in publish dir -->
   806     <!-- Set prop old.md5.file to md5 file from last build in publish dir -->
   756     <target name="delta-use-last-build">
   807     <target name="delta-use-last-build">
       
   808         <!-- Location of current build md5 file
       
   809         @type string
       
   810         @scope private
       
   811         -->
   757         <property name="md5.current.build" value="${publish.dir}/build_area/delta_zip/${build.id}.md5" />
   812         <property name="md5.current.build" value="${publish.dir}/build_area/delta_zip/${build.id}.md5" />
   758         <hlm:python outputproperty="old.md5.file">
   813         <hlm:python outputproperty="old.md5.file">
   759 import re
   814 import re
   760 import ant
   815 import ant
   761 import os
   816 import os
   794             <include name="**/*.zip" />
   849             <include name="**/*.zip" />
   795             <include name="**/*.xml" />
   850             <include name="**/*.xml" />
   796         </fileset>
   851         </fileset>
   797 
   852 
   798         <antcall target="grace-upload">
   853         <antcall target="grace-upload">
   799             <reference refid="grace.delta.zips.id" torefid="gracezips" />
   854             <reference refid="grace.delta.zips.id" torefid="release.zips" />
   800         </antcall>
   855         </antcall>
   801     </target>
   856     </target>
   802 
   857 
   803     <!-- Publishes the Ant build log.
   858     <!-- Publishes the Ant build log.
   804         
   859         
   833 
   888 
   834     <!-- Update the build status by processing the ant build output log -->
   889     <!-- Update the build status by processing the ant build output log -->
   835     <target name="build-status">
   890     <target name="build-status">
   836         <hlm:metadatarecord database="${metadata.dbfile}">
   891         <hlm:metadatarecord database="${metadata.dbfile}">
   837             <hlm:antmetadatainput>
   892             <hlm:antmetadatainput>
   838                 <fileset casesensitive="false" file="${build.log.dir}/${build.id}_ant_build.log" />
   893                 <fileset casesensitive="false" file="${build.log}" />
   839                 <metadatafilterset refid="filterset.ant.output" />
   894                 <metadatafilterset refid="filterset.ant.output" />
   840             </hlm:antmetadatainput>
   895             </hlm:antmetadatainput>
   841         </hlm:metadatarecord>
   896         </hlm:metadatarecord>
   842 
   897 
   843         <hlm:signalMacro logfile="${build.id}_ant_build.log" 
   898         <hlm:signalMacro logfile="${build.log}" 
   844             signal.input="exceptionSignalInput" />
   899             signal.input="exceptionSignalInput" />
   845     </target>
   900     </target>
   846 
   901 
   847     <!-- Exception handler to process the ant output log -->
   902     <!-- Exception handler to process the ant output log -->
   848     <target name="hlm-exception-handler">
   903     <target name="hlm-exception-handler">
   849         <if>
   904         <if>
   850             <available file="${build.log.dir}/${build.id}_ant_build.log"/>
   905             <available file="${build.log}"/>
   851             <then>
   906             <then>
   852                 <runtarget target="do-exception-handler" />
   907                 <runtarget target="do-exception-handler" />
   853             </then>
   908             </then>
   854         </if>
   909         </if>
   855     </target>
   910     </target>