buildframework/helium/tools/common/templates/ido/ido-ant-copy.xml.ftl
changeset 587 85df38eb4012
parent 217 0f5e3a7fb6af
child 628 7c4a911dc066
--- a/buildframework/helium/tools/common/templates/ido/ido-ant-copy.xml.ftl	Thu Mar 04 15:10:37 2010 +0200
+++ b/buildframework/helium/tools/common/templates/ido/ido-ant-copy.xml.ftl	Tue Apr 27 08:33:08 2010 +0300
@@ -21,7 +21,22 @@
 --> 
 <?xml version="1.0"?>
 <project name="ido-ant-copy" default="all">
-    <target name="all">
+    <target name="delete">
+        <parallel threadCount="${r'$'}{number.of.threads}">
+        <#list data?keys as component>
+            <sequential>
+                <#if ant?keys?seq_contains('ido.keep.old')>
+                <delete dir="${data[component]}_old" failonerror="false"/>
+                <move file="${data[component]}" todir="${data[component]}_old" failonerror="false"/>
+                <#else>
+                <delete dir="${data[component]}" failonerror="false"/>
+                </#if>
+            </sequential>
+        </#list>
+        </parallel>
+    </target>
+    
+    <target name="copy">
         <#list data?keys as component>
             <mkdir dir="${data[component]}"/>
         </#list>
@@ -38,11 +53,15 @@
                         <exclude name="**/.svn/**"/>
                     </fileset>
                 </copy>
-                <exec executable="attrib" dir="${data[component]}">
+                <#-- Below operation is not required on linux as copy task will changes 
+                the file permissions to write mode -->
+                <exec executable="attrib" osfamily="windows" dir="${data[component]}">
                     <arg line="-R /S /D .\*"/>
                 </exec>
             </sequential>
         </#list>
         </parallel>
     </target>
+    
+    <target name="all" depends="delete,copy" />
 </project>