common/templates/source-spec.ant.xml.ftl
changeset 948 21eb99277b75
parent 945 0286796100fd
child 949 627fc020bb12
equal deleted inserted replaced
943:714540e019be 948:21eb99277b75
     3 
     3 
     4 <#assign dollar = "$"/>
     4 <#assign dollar = "$"/>
     5 
     5 
     6     <!-- Convert \s in cache location, because otherwise they disappear entirely when used in a regex replacement! -->
     6     <!-- Convert \s in cache location, because otherwise they disappear entirely when used in a regex replacement! -->
     7     <propertyregex property="sf.spec.sourcesync.cachelocation.for.regex" input="${dollar}{sf.spec.sourcesync.cachelocation}" regexp="\\" replace="/" global="true" defaultValue="${dollar}{sf.spec.sourcesync.cachelocation}"/>
     7     <propertyregex property="sf.spec.sourcesync.cachelocation.for.regex" input="${dollar}{sf.spec.sourcesync.cachelocation}" regexp="\\" replace="/" global="true" defaultValue="${dollar}{sf.spec.sourcesync.cachelocation}"/>
     8     
     8 
       
     9     <!-- Create an empty hg repo to use when converting remote tags into hashes-->
       
    10     <exec executable="hg" dir="${ant['temp.build.dir']}">
       
    11         <arg value="init"/>
       
    12         <arg value="emptyRepo"/>
       
    13     </exec>
       
    14 
     9 <#assign fileset = "" />
    15 <#assign fileset = "" />
    10 <#assign sync_list = "" />
    16 <#assign sync_list = "" />
    11 <#assign bom_list  = "" />
    17 <#assign bom_list  = "" />
    12 <#assign change_list  = "" />
    18 <#assign change_list  = "" />
    13 <#assign count = 0 />
    19 <#assign count = 0 />
    26                 <!-- Work out cache location from source location -->
    32                 <!-- Work out cache location from source location -->
    27                 <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/"/>
    33                 <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/"/>
    28                 <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/"/>
    34                 <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/"/>
    29             </then>
    35             </then>
    30         </if>
    36         </if>
    31 	
    37         
       
    38         <!-- Convert source tag/branch to to changeset hash, in case it's a local tag on the server -->
       
    39         <exec executable="hg" dir="${ant['temp.build.dir']}/emptyRepo" outputproperty="sf.sourcesync.${count}.checksum">
       
    40             <arg value="in"/>
       
    41             <arg value="${pkg_detail.source}"/>
       
    42             <arg value="-r"/>
       
    43             <arg value="${pkg_detail.pattern}"/>
       
    44             <arg value="-l"/>
       
    45             <arg value="1"/>
       
    46             <arg value="-n"/>
       
    47             <arg value="--template"/>
       
    48             <arg value="{node|short}"/>
       
    49             <arg value="-q"/>
       
    50         </exec>
       
    51         
    32         <if>
    52         <if>
    33             <and>
    53             <and>
    34                 <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
    54                 <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
    35                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    55                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    36             </and>
    56             </and>
    80                 </if>
   100                 </if>
    81                 <!-- Update to required revision -->
   101                 <!-- Update to required revision -->
    82                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   102                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
    83                     <arg value="update"/>
   103                     <arg value="update"/>
    84                     <arg value="-r"/>
   104                     <arg value="-r"/>
    85                     <arg value="${pkg_detail.pattern}"/>
   105                     <arg value="${dollar}{sf.sourcesync.${count}.checksum}"/>
    86                 </exec>
       
    87                 <!-- Record the changeset selected, for the BOM -->
       
    88                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
       
    89                     <arg value="identify"/>
       
    90                     <arg value="-i"/>
       
    91                 </exec>
   106                 </exec>
    92             </then>
   107             </then>
    93             <else>
   108             <else>
    94                 <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
   109                 <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
    95                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   110                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   100                 </exec>
   115                 </exec>
   101                 <!-- Update to required version -->
   116                 <!-- Update to required version -->
   102                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   117                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   103                     <arg value="update"/>
   118                     <arg value="update"/>
   104                     <arg value="-r"/>
   119                     <arg value="-r"/>
   105                     <arg value="${pkg_detail.pattern}"/>
   120                     <arg value="${dollar}{sf.sourcesync.${count}.checksum}"/>
   106                 </exec>
       
   107                 <!-- Record the changeset selected, for the BOM -->
       
   108                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
       
   109                     <arg value="identify"/>
       
   110                     <arg value="-i"/>
       
   111                 </exec>
   121                 </exec>
   112                 <if>
   122                 <if>
   113                     <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
   123                     <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
   114                     <then>
   124                     <then>
   115                         <forget>
   125                         <forget>