common/templates/source-spec.ant.xml.ftl
changeset 944 eb33247c261d
parent 909 869f7b50a6f1
child 945 0286796100fd
equal deleted inserted replaced
940:5d6e2c958c66 944:eb33247c261d
     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="--template"/>
       
    47             <arg value="{node|short}"/>
       
    48             <arg value="-q"/>
       
    49         </exec>
       
    50         
    32         <if>
    51         <if>
    33             <and>
    52             <and>
    34                 <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
    53                 <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
    35                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    54                 <available file="${dollar}{sf.spec.sourcesync.cachelocation.${count}}" type="dir"/>
    36             </and>
    55             </and>
    80                 </if>
    99                 </if>
    81                 <!-- Update to required revision -->
   100                 <!-- Update to required revision -->
    82                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   101                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
    83                     <arg value="update"/>
   102                     <arg value="update"/>
    84                     <arg value="-r"/>
   103                     <arg value="-r"/>
    85                     <arg value="${pkg_detail.pattern}"/>
   104                     <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>
   105                 </exec>
    92             </then>
   106             </then>
    93             <else>
   107             <else>
    94                 <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
   108                 <echo message="Clone from ${pkg_detail.source} to ${ant['build.drive']}${pkg_detail.dst}"/>
    95                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   109                 <exec executable="hg" dir="${ant['build.drive']}/" failonerror="true">
   100                 </exec>
   114                 </exec>
   101                 <!-- Update to required version -->
   115                 <!-- Update to required version -->
   102                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   116                 <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="true">
   103                     <arg value="update"/>
   117                     <arg value="update"/>
   104                     <arg value="-r"/>
   118                     <arg value="-r"/>
   105                     <arg value="${pkg_detail.pattern}"/>
   119                     <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>
   120                 </exec>
   112                 <if>
   121                 <if>
   113                     <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
   122                     <isset property="sf.spec.sourcesync.cachelocation.${count}"/>
   114                     <then>
   123                     <then>
   115                         <forget>
   124                         <forget>