common/build.postbuild.xml
changeset 1084 abefe2962232
parent 1082 372b86ab2b52
child 1108 09255e80a1ec
equal deleted inserted replaced
1083:a91d8608229c 1084:abefe2962232
    98         </if>
    98         </if>
    99         <stopwatch name="sf-postbuild" action="elapsed"/>
    99         <stopwatch name="sf-postbuild" action="elapsed"/>
   100     </target>
   100     </target>
   101 
   101 
   102     <target name="sf-tag-hg-code">
   102     <target name="sf-tag-hg-code">
   103         <property name="sf.tagafterbuild.tag" value="${sf.spec.job.name}_${sf.spec.job.codeline}.${sf.spec.job.number}"/>
   103         <!-- To do the tagging, we need to know what tag to use, and who the author is (from hg's perspective) -->
       
   104         <fail message="This target needs to have all the details specified, or to be run interactively so it can query the user">
       
   105             <condition>
       
   106                 <and>
       
   107                     <isset property="sf.hudson.executor.number"/>
       
   108                     <not>
       
   109                         <or>
       
   110                             <isset property="sf.tagafterbuild.tag"/>
       
   111                             <isset property="sf.hg.ui.username"/>
       
   112                         </or>
       
   113                     </not>
       
   114                 </and>
       
   115             </condition>
       
   116         </fail>
       
   117 
       
   118         <!-- Ask the user, interactively, what tag to use -->
       
   119         <input addproperty="sf.tagafterbuild.tag" message="Enter the tag to apply to the code (eg &quot;PDK_1.0.1&quot;):"/>
       
   120         <fail message="No tag supplied">
       
   121             <condition>
       
   122                 <length string="${sf.tagafterbuild.tag}" trim="true" length="0"/>
       
   123             </condition>
       
   124         </fail>
       
   125 
       
   126         <!-- Now get the username sorted out -->
       
   127         <exec executable="hg" outputproperty="sf.hg.showconfig.ui.username">
       
   128             <arg value="showconfig"/>
       
   129             <arg value="ui.username"/>
       
   130         </exec>
       
   131         <input addproperty="sf.hg.ui.username" message="Enter hg author credentials (eg &quot;Fred Bloggs &lt;fredb@example.org&gt;&quot;) default is" defaultvalue="${sf.hg.showconfig.ui.username}"/>
       
   132         <fail message="No author supplied">
       
   133             <condition>
       
   134                 <length string="${sf.hg.ui.username}" trim="true" length="0"/>
       
   135             </condition>
       
   136         </fail>
       
   137 
   104         <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
   138         <fmpp sourceFile="${sf.common.config.dir}/templates/tag-hg-code.ant.xml.ftl"
   105               outputFile="${temp.build.dir}/tag-hg-code.ant.xml">
   139               outputFile="${temp.build.dir}/tag-hg-code.ant.xml">
   106             <data expandProperties="yes">
   140             <data expandProperties="yes">
   107                 ant: antProperties()
   141                 ant: antProperties()
   108                 data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   142                 data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
   109             </data>
   143             </data>
   110         </fmpp>
   144         </fmpp>
   111         <ant antfile="${temp.build.dir}/tag-hg-code.ant.xml"/>
   145         <ant antfile="${temp.build.dir}/tag-hg-code.ant.xml"/>
       
   146     </target>
       
   147 
       
   148     <target name="sf-push-hg-tags">
       
   149         <!-- To do the pushing, we need to have a set of credentials for the developer.symbian.org site -->
       
   150         <fail message="This target needs to have loging credentials specified specified, or to be run interactively so it can query the user">
       
   151             <condition>
       
   152                 <and>
       
   153                     <isset property="sf.hudson.executor.number"/>
       
   154                     <not>
       
   155                         <or>
       
   156                             <isset property="sf.symbian.account.username"/>
       
   157                             <isset property="sf.symbian.account.password"/>
       
   158                         </or>
       
   159                     </not>
       
   160                 </and>
       
   161             </condition>
       
   162         </fail>
       
   163 
       
   164         <input addproperty="sf.symbian.account.username" message="Enter symbian.org username (eg &quot;fredb&quot;)"/>
       
   165         <fail message="No author supplied">
       
   166             <condition>
       
   167                 <length string="${sf.hg.ui.username}" trim="true" length="0"/>
       
   168             </condition>
       
   169         </fail>
       
   170 
       
   171         <input addproperty="sf.symbian.account.password" message="Enter symbian.org password (eg &quot;unguessable&quot;)">
       
   172             <!-- Ant 1.8 supports secure here, which would be an improvement... -->
       
   173             <handler type="default"/>
       
   174         </input>
       
   175         <fail message="No password supplied">
       
   176             <condition>
       
   177                 <length string="${sf.hg.ui.password}" trim="true" length="0"/>
       
   178             </condition>
       
   179         </fail>
       
   180 
       
   181         <if>
       
   182             <not>
       
   183                 <available file="${build.drive}/tagging" type="dir"/>
       
   184             </not>
       
   185             <then>
       
   186                 <!-- No dir with tagged repos in - create them! -->
       
   187                 <runtarget target="sf-tag-hg-code"/>
       
   188             </then>
       
   189         </if>
       
   190 
       
   191         <fmpp sourceFile="${sf.common.config.dir}/templates/push-hg-tags.ant.xml.ftl"
       
   192               outputFile="${temp.build.dir}/push-hg-tags.ant.xml">
       
   193             <data expandProperties="yes">
       
   194                 ant: antProperties()
       
   195                 data: csv(${sf.spec.sourcesync.sourcespecdir}/${sf.spec.sourcesync.sourcespecfile}, {separator:','})
       
   196             </data>
       
   197         </fmpp>
       
   198         <ant antfile="${temp.build.dir}/push-hg-tags.ant.xml"/>
   112     </target>
   199     </target>
   113 
   200 
   114     <target name="sf-run-evalid" >
   201     <target name="sf-run-evalid" >
   115         <delete dir="${build.drive}/output/md5"/>
   202         <delete dir="${build.drive}/output/md5"/>
   116         <mkdir  dir="${build.drive}/output/md5"/>
   203         <mkdir  dir="${build.drive}/output/md5"/>
   628           <exec executable="perl" dir="${build.drive}">
   715           <exec executable="perl" dir="${build.drive}">
   629             <arg value="${sf.common.config.dir}/tools/uh2diamonds.pl"/>
   716             <arg value="${sf.common.config.dir}/tools/uh2diamonds.pl"/>
   630           </exec>
   717           </exec>
   631           <echo message="Send ${build.log.dir}/diamonds_uh.xml to Diamonds"/>
   718           <echo message="Send ${build.log.dir}/diamonds_uh.xml to Diamonds"/>
   632           <exec executable="python">
   719           <exec executable="python">
   633 		    <arg value="${sf.common.config.dir}/tools/brag/send_xml_to_diamonds.py"/>
   720             <arg value="${sf.common.config.dir}/tools/brag/send_xml_to_diamonds.py"/>
   634 		    <arg value="-u"/>
   721             <arg value="-u"/>
   635 		    <arg value="http://${diamonds.host}${diamonds.build.id}"/>
   722             <arg value="http://${diamonds.host}${diamonds.build.id}"/>
   636 		    <arg value="-f"/>
   723             <arg value="-f"/>
   637 		    <arg value="${build.log.dir}/diamonds_uh.xml"/>
   724             <arg value="${build.log.dir}/diamonds_uh.xml"/>
   638 		  </exec>
   725           </exec>
   639         </then>
   726         </then>
   640       </if>
   727       </if>
   641     </target>
   728     </target>
   642     
   729     
   643     <target name="sf-links-to-diamonds">
   730     <target name="sf-links-to-diamonds">