common/templates/source-spec.ant.xml.ftl
changeset 1042 f505fa5486eb
parent 975 293f16b1c667
child 1043 2c948b30191c
equal deleted inserted replaced
1041:705ebddb2efc 1042:f505fa5486eb
    15 <#assign count = 0 />
    15 <#assign count = 0 />
    16 
    16 
    17 <#list data as csv_file>
    17 <#list data as csv_file>
    18   <#list csv_file as pkg_detail>
    18   <#list csv_file as pkg_detail>
    19     <target name="sf-prebuild-${count}">
    19     <target name="sf-prebuild-${count}">
       
    20     	
       
    21     	<!-- if defined the revision override take that as revision and change the url to point to FCL -->
       
    22     	<if>
       
    23     		<not><equals arg1="${ant['sf.spec.sources.revision']}" arg2="" trim="true"/></not>
       
    24     		<then>
       
    25     			<property name="sources.${count}.revision" value="${ant['sf.spec.sources.revision']}"/>
       
    26     			<propertyregex property="sources.${count}.URL" input="${pkg_detail.source}" regexp="/MCL/" casesensitive="false" replace="/FCL/"/>
       
    27     		</then>
       
    28     		<else>
       
    29     			<property name="sources.${count}.revision" value="${pkg_detail.pattern}"/>
       
    30     			<property name="sources.${count}.URL" value="${pkg_detail.source}"/>
       
    31     		</else>
       
    32     	</if>
    20         
    33         
    21         <!-- Create sf\layer dir on build dir -->
    34         <!-- Create sf\layer dir on build dir -->
    22         <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
    35         <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
    23         <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true" />
    36         <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true" />
    24         
    37         
    25         <if>
    38         <if>
    26             <istrue value="${dollar}{sf.spec.sourcesync.usecache}"/>
    39             <istrue value="${dollar}{sf.spec.sourcesync.usecache}"/>
    27             <then>
    40             <then>
    28                 <!-- Work out cache location from source location -->
    41                 <!-- Work out cache location from source location -->
    29                 <propertyregex property="sf.spec.sourcesync.cachelocation.${count}" input="${pkg_detail.source}" regexp="^http://developer.symbian.org/" casesensitive="false" replace="${dollar}{sf.spec.sourcesync.cachelocation.for.regex}/Live/"/>
    42                 <propertyregex property="sf.spec.sourcesync.cachelocation.${count}" input="${dollar}{sources.${count}.URL}" regexp="^http://developer.symbian.org/" casesensitive="false" replace="${dollar}{sf.spec.sourcesync.cachelocation.for.regex}/Live/"/>
    30                 <propertyregex property="sf.spec.sourcesync.cachelocation.${count}" input="${pkg_detail.source}" regexp="^${ant['sf.spec.sourcesync.local.development.area']}/" casesensitive="false" replace="${dollar}{sf.spec.sourcesync.cachelocation.for.regex}/LocalDev/"/>
    43                 <propertyregex property="sf.spec.sourcesync.cachelocation.${count}" input="${dollar}{sources.${count}.URL}" regexp="^${ant['sf.spec.sourcesync.local.development.area']}/" casesensitive="false" replace="${dollar}{sf.spec.sourcesync.cachelocation.for.regex}/LocalDev/"/>
    31             </then>
    44             </then>
    32         </if>
    45         </if>
    33         
    46         
    34         <!-- Convert source tag/branch to to changeset hash, in case it's a local tag on the server -->
    47         <!-- Convert source tag/branch to to changeset hash, in case it's a local tag on the server -->
    35         <retry tries="10" uniquename="${count}">
    48         <retry tries="10" uniquename="${count}">
    36             <sequential>
    49             <sequential>
    37                 <exec executable="hg" failonerror="true" output="${ant['temp.build.dir']}/sf.sourcesync.${count}.checksum" error="nul:">
    50                 <exec executable="hg" failonerror="true" output="${ant['temp.build.dir']}/sf.sourcesync.${count}.checksum" error="nul:">
    38                     <arg value="id"/>
    51                     <arg value="id"/>
    39                     <arg value="${pkg_detail.source}"/>
    52                     <arg value="${dollar}{sources.${count}.URL}"/>
    40                     <arg value="-r"/>
    53                     <arg value="-r"/>
    41                     <arg value="${pkg_detail.pattern}"/>
    54                     <arg value="${pkg_detail.pattern}"/>
    42                     <arg value="-q"/>
    55                     <arg value="-q"/>
    43                 </exec>
    56                 </exec>
    44                 <loadfile property="sf.sourcesync.${count}.checksum" srcFile="${ant['temp.build.dir']}/sf.sourcesync.${count}.checksum"/>
    57                 <loadfile property="sf.sourcesync.${count}.checksum" srcFile="${ant['temp.build.dir']}/sf.sourcesync.${count}.checksum"/>
    53             </and>
    66             </and>
    54             <then>
    67             <then>
    55                 <!-- Package in cache already -->
    68                 <!-- Package in cache already -->
    56                 <retry tries="3" uniquename="${count}" failonerror="0">
    69                 <retry tries="3" uniquename="${count}" failonerror="0">
    57                     <sequential>
    70                     <sequential>
    58                         <echo message="Pull from ${pkg_detail.source} to ${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
    71                         <echo message="Pull from ${dollar}{sources.${count}.URL} to ${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
    59                         <exec executable="hg" dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" failonerror="true">
    72                         <exec executable="hg" dir="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" failonerror="true">
    60                             <arg value="pull"/>
    73                             <arg value="pull"/>
    61                             <arg value="${pkg_detail.source}"/>
    74                             <arg value="${dollar}{sources.${count}.URL}"/>
    62                         </exec>
    75                         </exec>
    63                         <property name="sf.spec.sourcesync.cache.pull.succeeded.${count}" value="1"/>
    76                         <property name="sf.spec.sourcesync.cache.pull.succeeded.${count}" value="1"/>
    64                     </sequential>
    77                     </sequential>
    65                 </retry>
    78                 </retry>
    66                 <if>
    79                 <if>
    91                             </if>
   104                             </if>
    92                         </forget>
   105                         </forget>
    93                         <!-- In the meantime, by-pass it for this build -->
   106                         <!-- In the meantime, by-pass it for this build -->
    94                         <retry tries="30" uniquename="${count}">
   107                         <retry tries="30" uniquename="${count}">
    95                             <sequential>
   108                             <sequential>
    96                                 <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
   109                                 <echo message="Clone from ${dollar}{sources.${count}.URL} to ${ant['build.drive']}${pkg_detail.dst}"/>
    97                                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   110                                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
    98                                     <arg value="clone"/>
   111                                     <arg value="clone"/>
    99                                     <arg value="-U"/>
   112                                     <arg value="-U"/>
   100                                     <arg value="${pkg_detail.source}"/>
   113                                     <arg value="${dollar}{sources.${count}.URL}"/>
   101                                     <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
   114                                     <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
   102                                 </exec>
   115                                 </exec>
   103                             </sequential>
   116                             </sequential>
   104                             <cleanup>
   117                             <cleanup>
   105                                 <delete dir="${ant['build.drive']}${pkg_detail.dst}"/>
   118                                 <delete dir="${ant['build.drive']}${pkg_detail.dst}"/>
   116             </then>
   129             </then>
   117             <else>
   130             <else>
   118                 <!-- Package not in cache, or cache not in use -->
   131                 <!-- Package not in cache, or cache not in use -->
   119                 <retry tries="10" uniquename="${count}">
   132                 <retry tries="10" uniquename="${count}">
   120                     <sequential>
   133                     <sequential>
   121                         <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
   134                         <echo message="Clone from ${dollar}{sources.${count}.URL} to ${ant['build.drive']}${pkg_detail.dst}"/>
   122                         <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   135                         <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   123                             <arg value="clone"/>
   136                             <arg value="clone"/>
   124                             <arg value="-U"/>
   137                             <arg value="-U"/>
   125                             <arg value="${pkg_detail.source}"/>
   138                             <arg value="${dollar}{sources.${count}.URL}"/>
   126                             <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
   139                             <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
   127                         </exec>
   140                         </exec>
   128                     </sequential>
   141                     </sequential>
   129                     <cleanup>
   142                     <cleanup>
   130                         <delete dir="${ant['build.drive']}${pkg_detail.dst}"/>
   143                         <delete dir="${ant['build.drive']}${pkg_detail.dst}"/>
   148                             <!-- Clone source to get the right default repo -->
   161                             <!-- Clone source to get the right default repo -->
   149                             <exec executable="hg" dir="${ant['build.drive']}/" failonerror="false">
   162                             <exec executable="hg" dir="${ant['build.drive']}/" failonerror="false">
   150                                 <arg value="clone"/>
   163                                 <arg value="clone"/>
   151                                 <arg value="-r"/>
   164                                 <arg value="-r"/>
   152                                 <arg value="null"/>
   165                                 <arg value="null"/>
   153                                 <arg value="${pkg_detail.source}"/>
   166                                 <arg value="${dollar}{sources.${count}.URL}"/>
   154                                 <arg value="${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
   167                                 <arg value="${dollar}{sf.spec.sourcesync.cachelocation.${count}}"/>
   155                             </exec>
   168                             </exec>
   156                             <!-- Set the speed-up flag on the cache repo -->
   169                             <!-- Set the speed-up flag on the cache repo -->
   157                             <echo file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}/.hg/hgrc" append="true" message="${dollar}{line.separator}"/>
   170                             <echo file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}/.hg/hgrc" append="true" message="${dollar}{line.separator}"/>
   158                             <echo file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}/.hg/hgrc" append="true" message="[server]${dollar}{line.separator}"/>
   171                             <echo file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}/.hg/hgrc" append="true" message="[server]${dollar}{line.separator}"/>
   170         </if>
   183         </if>
   171     </target>
   184     </target>
   172     
   185     
   173     <target name="sf-bom-info-${count}">
   186     <target name="sf-bom-info-${count}">
   174         <!-- record info on source code repo/rev in BOM file  -->
   187         <!-- record info on source code repo/rev in BOM file  -->
   175         <echo file="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true" message="${pkg_detail.source},${pkg_detail.dst},changeset,${dollar}{sf.sourcesync.${count}.checksum},${pkg_detail.sysdef}${dollar}{line.separator}"/>
   188         <echo file="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true" message="${dollar}{sources.${count}.URL},${pkg_detail.dst},changeset,${dollar}{sf.sourcesync.${count}.checksum},${pkg_detail.sysdef}${dollar}{line.separator}"/>
   176     </target>
   189     </target>
   177     
   190     
   178     <target name="sf-bom-change-info-${count}">
   191     <target name="sf-bom-change-info-${count}">
   179         <if><not><isset property="sf.sourcesync.${count}.checksum"/></not>
   192         <if><not><isset property="sf.sourcesync.${count}.checksum"/></not>
   180             <then>
   193             <then>
   183                     <arg value="-i"/>
   196                     <arg value="-i"/>
   184                 </exec>
   197                 </exec>
   185             </then>
   198             </then>
   186         </if>
   199         </if>
   187         <echo message="Writing BOM changes since ${dollar}{sf.previous.pdk.tag} for ${pkg_detail.dst}" />
   200         <echo message="Writing BOM changes since ${dollar}{sf.previous.pdk.tag} for ${pkg_detail.dst}" />
   188         <echo file="${ant['build.drive']}/output/logs/BOM/changes.txt" append="true" message="${dollar}{line.separator}${pkg_detail.source}${dollar}{line.separator}${pkg_detail.dst}${dollar}{line.separator}${dollar}{line.separator}" />
   201         <echo file="${ant['build.drive']}/output/logs/BOM/changes.txt" append="true" message="${dollar}{line.separator}${dollar}{sources.${count}.URL}${dollar}{line.separator}${pkg_detail.dst}${dollar}{line.separator}${dollar}{line.separator}" />
   189             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" output="${ant['build.drive']}/output/logs/BOM/changes.txt" append="true">
   202             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" output="${ant['build.drive']}/output/logs/BOM/changes.txt" append="true">
   190                 <arg value="log"/>
   203                 <arg value="log"/>
   191                 <arg value="-r"/>
   204                 <arg value="-r"/>
   192                 <arg value="${dollar}{sf.sourcesync.${count}.checksum}:${dollar}{sf.previous.pdk.tag}"/>
   205                 <arg value="${dollar}{sf.sourcesync.${count}.checksum}:${dollar}{sf.previous.pdk.tag}"/>
   193                 <arg value="-f"/>
   206                 <arg value="-f"/>