common/templates/source-spec.ant.xml.ftl
changeset 799 49167a0e38cf
parent 746 12815724a053
child 856 0e553fdaa218
equal deleted inserted replaced
798:db3cbddc6f4a 799:49167a0e38cf
     5 <#assign sync_list = "" />
     5 <#assign sync_list = "" />
     6 <#assign bom_list  = "" />
     6 <#assign bom_list  = "" />
     7 <#assign change_list  = "" />
     7 <#assign change_list  = "" />
     8 <#assign dollar = "$"/>
     8 <#assign dollar = "$"/>
     9 <#assign count = 0 />
     9 <#assign count = 0 />
    10 
    10 <#if ("${ant['sf.spec.sourcesync.archive']}")?? && "${ant['sf.spec.sourcesync.archive']}" == "true">
    11 <#if ("${ant['sf.spec.sourcesync.archive']}")??>
    11   <#assign fast_sync = true />
    12   <#if "${ant['sf.spec.sourcesync.archive']}" == "true">
       
    13     <#assign fast_sync = true />
       
    14   <#else>
       
    15     <#assign fast_sync = false />
       
    16   </#if>
       
    17 <#else>
    12 <#else>
    18   <#assign fast_sync = false />
    13   <#assign fast_sync = false />
    19 </#if>
    14 </#if>
    20 
    15 <#if ("${ant['sf.spec.sourcesync.bug419']}")?? && "${ant['sf.spec.sourcesync.bug419']}" == "true">
    21 <#if ("${ant['sf.spec.sourcesync.bug419']}")??>
    16   <#assign bug419 = true />
    22   <#if "${ant['sf.spec.sourcesync.bug419']}" == "true">
       
    23     <#assign bug419 = true />
       
    24   <#else>
       
    25     <#assign bug419 = false />
       
    26   </#if>
       
    27 <#else>
    17 <#else>
    28   <#assign bug419 = false />
    18   <#assign bug419 = false />
    29 </#if>
    19 </#if>
    30 
       
    31 
    20 
    32     <!-- remove previous version of BOM file (if exists)  -->
    21     <!-- remove previous version of BOM file (if exists)  -->
    33     <target name="reset-bom-sources-csv">
    22     <target name="reset-bom-sources-csv">
    34         <delete file="${ant['build.drive']}/output/logs/BOM/sources.csv" quiet="true"/>
    23         <delete file="${ant['build.drive']}/output/logs/BOM/sources.csv" quiet="true"/>
    35     </target>
    24     </target>
    36 
    25 
    37 <#list data as pkg_detail>
    26 <#list data as pkg_detail>
    38     <target name="sf-prebuild-${count}">
    27     <target name="sf-prebuild-${count}">
    39         <#if (count > 0) >
       
    40             <#assign fileset = "${fileset}"  />
       
    41         </#if>
       
    42         <sequential>
    28         <sequential>
    43             <!-- create sf\layer dir  -->
    29             <!-- create sf\layer dir  -->
    44             <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
    30             <mkdir dir="${ant['build.drive']}${pkg_detail.dst}"/>
    45             <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="false" />
    31             <delete dir="${ant['build.drive']}${pkg_detail.dst}" failonerror="false" />
    46             <!-- Don't use hg archive with tags, as we can have wildcards in the tags... -->
    32             <!-- Don't use hg archive with tags, as we can have wildcards in the tags... -->
   104           </#if>  
    90           </#if>  
   105         </sequential>
    91         </sequential>
   106     </target>
    92     </target>
   107 
    93 
   108     <target name="sf-bom-info-${count}">
    94     <target name="sf-bom-info-${count}">
   109 
       
   110         <sequential>
    95         <sequential>
   111             <!-- record info on source code repo/rev in BOM file  -->
    96             <!-- record info on source code repo/rev in BOM file  -->
   112             <echo message="dir ${ant['build.drive']}${pkg_detail.dst} : ${dollar}{sf.sourcesync.${count}.checksum}"/>
    97             <echo message="dir ${ant['build.drive']}${pkg_detail.dst} : ${dollar}{sf.sourcesync.${count}.checksum}"/>
   113             <exec executable="cmd" output="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true">
    98             <exec executable="cmd" output="${ant['build.drive']}/output/logs/BOM/sources.csv" append="true">
   114                 <arg value="/c"/>
    99                 <arg value="/c"/>
   144                 </#if>    
   129                 </#if>    
   145             </exec>
   130             </exec>
   146           </sequential>
   131           </sequential>
   147     </target>
   132     </target>
   148 
   133 
   149     <#assign fileset = "${fileset}" + "<fileset dir=\"${ant['build.drive']}${pkg_detail.dst}\" includes=\"${pkg_detail.sysdef}\"/>" />       
   134     <#assign fileset = "${fileset}" + "<fileset dir=\"${ant['build.drive']}${pkg_detail.dst}\" includes=\"${pkg_detail.sysdef}\"/>\r\n        " />       
   150     <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\n\t\t"/>       
   135     <#assign sync_list = "${sync_list}" + "<runtarget target=\"sf-prebuild-${count}\"/>\r\n    "/>
   151     <#assign bom_list = "${bom_list}" + "<runtarget target=\"sf-bom-info-${count}\"/>\n\t"/>
   136     <#assign bom_list = "${bom_list}" + "<runtarget target=\"sf-bom-info-${count}\"/>\r\n  "/>
   152     <#assign change_list = "${change_list}" + "<runtarget target=\"sf-bom-change-info-${count}\"/>\n\t"/>        
   137     <#assign change_list = "${change_list}" + "<runtarget target=\"sf-bom-change-info-${count}\"/>\r\n  "/>
   153     <#assign count = count + 1 />
   138     <#assign count = count + 1 />
   154 
       
   155 </#list>
   139 </#list>
   156 
   140 
   157     <path id="system.definition.files">
   141     <path id="system.definition.files">
   158         <fileset dir="${dollar}{sf.common.config.dir}/sysdefs" includes="*.sysdef.xml"/>
   142         <fileset dir="${dollar}{sf.common.config.dir}/sysdefs" includes="*.sysdef.xml"/>
   159         ${fileset}
   143         ${fileset}
   160     </path>
   144     </path>
   161 
   145 
   162 <target name="all" depends="reset-bom-sources-csv">
   146 <target name="all" depends="reset-bom-sources-csv">
   163 
       
   164   <parallel threadCount="${ant['env.NUMBER_OF_PROCESSORS']}">
   147   <parallel threadCount="${ant['env.NUMBER_OF_PROCESSORS']}">
   165     ${sync_list}
   148     ${sync_list}
   166   </parallel>
   149   </parallel>
   167 
   150 
   168   <echo message="Adding BOM header"/>
   151   <echo message="Adding BOM header"/>
   176   ${bom_list}
   159   ${bom_list}
   177   <runtarget target="sf-bom-change-info" />
   160   <runtarget target="sf-bom-change-info" />
   178 </target>
   161 </target>
   179 
   162 
   180 <target name="sf-bom-change-info">
   163 <target name="sf-bom-change-info">
   181   
       
   182   <mkdir dir="${ant['build.drive']}/output/logs/BOM/"/>
   164   <mkdir dir="${ant['build.drive']}/output/logs/BOM/"/>
   183   <delete file="${ant['build.drive']}/output/logs/BOM/changes.txt" quiet="true"/> 
   165   <delete file="${ant['build.drive']}/output/logs/BOM/changes.txt" quiet="true"/>
       
   166 
   184   ${change_list}
   167   ${change_list}
       
   168 </target>
   185 
   169 
   186 </target>
       
   187 </project>
   170 </project>