common/templates/source-spec.ant.xml.ftl
changeset 231 c75afb49c4d3
parent 163 fc4460f54beb
child 232 52c893932513
equal deleted inserted replaced
230:75af1c9cfd87 231:c75afb49c4d3
    16     <target name="sf-prebuild-${count}">
    16     <target name="sf-prebuild-${count}">
    17         <#if (count > 0) >
    17         <#if (count > 0) >
    18             <#assign fileset = "${fileset}"  />
    18             <#assign fileset = "${fileset}"  />
    19         </#if>
    19         </#if>
    20         <sequential>
    20         <sequential>
       
    21             <!-- create sf\layer dir  -->
    21             <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="false"/>
    22             <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="false"/>
    22             <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
    23             <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
       
    24             <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="false"/>
       
    25 
       
    26             <exec executable="hg" dir="${ant['build.drive']}">
       
    27                 <arg value="clone"/>
       
    28                 <arg value="-U"/>
       
    29                 <arg value="${pkg_detail.source}"/>
       
    30                 <arg value="${ant['build.drive']}${pkg_detail.dst}"/>
       
    31             </exec>
       
    32 
    23             <hlm:scm verbose="true" scmUrl="scm:hg:${pkg_detail.source}">
    33             <hlm:scm verbose="true" scmUrl="scm:hg:${pkg_detail.source}">
    24                 <hlm:checkout basedir="${ant['build.drive']}${pkg_detail.dst}"/>
    34                 <!--hlm:checkout basedir="${ant['build.drive']}${pkg_detail.dst}"/-->
       
    35                 <#if "${pkg_detail.type}"=="tag" >
    25                 <hlm:tags basedir="${ant['build.drive']}${pkg_detail.dst}" reference="hg.tags.id${dollar}{refid}"/>
    36                 <hlm:tags basedir="${ant['build.drive']}${pkg_detail.dst}" reference="hg.tags.id${dollar}{refid}"/>
    26                 <hlm:update basedir="${ant['build.drive']}${pkg_detail.dst}">
    37                 <hlm:update basedir="${ant['build.drive']}${pkg_detail.dst}">
    27                     <hlm:latestTag pattern="${pkg_detail.tag}">
    38                 <hlm:latestTag pattern="${pkg_detail.pattern}">
    28                         <hlm:tagSet refid="hg.tags.id${dollar}{refid}" />
    39                         <hlm:tagSet refid="hg.tags.id${dollar}{refid}" />
    29                     </hlm:latestTag>
    40                 </hlm:latestTag>
    30                 </hlm:update>
    41                 </hlm:update>
       
    42                 </#if>
       
    43                 <#if "${pkg_detail.type}"== "changeset" || "${pkg_detail.type}"=="branch">
       
    44                 <hlm:update basedir="${ant['build.drive']}${pkg_detail.dst}">
       
    45                      <hlm:tag name="${pkg_detail.pattern}"/>
       
    46                 </hlm:update>
       
    47                 </#if>
    31             </hlm:scm>
    48             </hlm:scm>
    32         
       
    33         </sequential>
    49         </sequential>
    34     </target>
    50     </target>
    35 
    51 
    36     <target name="sf-bom-info-${count}">
    52     <target name="sf-bom-info-${count}">
    37 
    53 
    38         <sequential>
    54         <sequential>
    39             
    55             
    40             <!-- record info on source code repo/rev in BOM file  -->
    56             <!-- record info on source code repo/rev in BOM file  -->
    41             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.rev">
       
    42                 <arg value="identify"/>
       
    43                 <arg value="-n"/>
       
    44             </exec>
       
    45             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
    57             <exec executable="hg" dir="${ant['build.drive']}${pkg_detail.dst}" outputproperty="sf.sourcesync.${count}.checksum">
    46                 <arg value="identify"/>
    58                 <arg value="identify"/>
    47                 <arg value="-i"/>
    59                 <arg value="-i"/>
    48             </exec>
    60             </exec>
    49             <echo message="dir ${ant['build.drive']}${pkg_detail.dst} : revision ${dollar}{sf.sourcesync.${count}.rev}:${dollar}{sf.sourcesync.${count}.checksum}"/>
    61             <echo message="dir ${ant['build.drive']}${pkg_detail.dst} : ${dollar}{sf.sourcesync.${count}.checksum}"/>
    50             <exec executable="cmd" output="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true">
    62             <exec executable="cmd" output="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true">
    51                 <arg value="/c"/>
    63                 <arg value="/c"/>
    52                 <arg value="echo"/>
    64                 <arg value="echo"/>
    53                 <arg value="${pkg_detail.source},${pkg_detail.dst},${dollar}{sf.sourcesync.${count}.rev}:${dollar}{sf.sourcesync.${count}.checksum}"/>
    65                 <arg value="${pkg_detail.source},${pkg_detail.dst},changeset,${dollar}{sf.sourcesync.${count}.checksum}"/>
    54             </exec>
    66             </exec>
    55         
       
    56         </sequential>
    67         </sequential>
    57     </target>
    68     </target>
    58 
    69 
    59 
    70 
    60     <#assign fileset = "${fileset}" + "<fileset dir=\"${ant['build.drive']}${pkg_detail.dst}\" includes=\"${pkg_detail.pattern}\"/>" />       
    71     <#assign fileset = "${fileset}" + "<fileset dir=\"${ant['build.drive']}${pkg_detail.dst}\" includes=\"${pkg_detail.sysdef}\"/>" />       
    61     <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\n"/>       
    72     <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\n"/>       
    62     <#assign bom_list = "${bom_list}" + "<runtarget target=\"sf-bom-info-${count}\"/>\n"/>    
    73     <#assign bom_list = "${bom_list}" + "<runtarget target=\"sf-bom-info-${count}\"/>\n"/>    
    63     <#assign count = count + 1 />
    74     <#assign count = count + 1 />
    64 
    75 
    65 </#list>
    76 </#list>
    73 
    84 
    74   <parallel threadCount="${ant['env.NUMBER_OF_PROCESSORS']}">
    85   <parallel threadCount="${ant['env.NUMBER_OF_PROCESSORS']}">
    75     ${sync_list}
    86     ${sync_list}
    76   </parallel>
    87   </parallel>
    77 
    88 
    78 
    89   <echo message="Adding BOM header"/>
       
    90       <exec executable="cmd" output="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true">
       
    91       <arg value="/c"/>
       
    92       <arg value="echo"/>
       
    93       <arg value="source,dst,type,pattern,sysdef,"/>
       
    94   </exec>
       
    95   
    79   ${bom_list}
    96   ${bom_list}
    80 
    97 
    81 </target>
    98 </target>
    82 </project>
    99 </project>