70 # Delete all dirs based on config |
70 # Delete all dirs based on config |
71 for dir_ in delete_dirs: |
71 for dir_ in delete_dirs: |
72 try: |
72 try: |
73 if os.sep == '\\': |
73 if os.sep == '\\': |
74 fileutils.subst(del_folder_drive, dir_) |
74 fileutils.subst(del_folder_drive, dir_) |
75 self.log(str("substed for deleling folders")) |
75 self.log(str("substed for deleting folders")) |
76 self.log(str("Removing %s\\" % del_folder_drive)) |
76 self.log(str("Removing %s\\" % del_folder_drive)) |
77 fileutils.rmtree("%s\\" % del_folder_drive) |
77 fileutils.rmtree("%s\\" % del_folder_drive) |
78 fileutils.unsubst(del_folder_drive) |
78 fileutils.unsubst(del_folder_drive) |
79 self.log(str("unsbusted substed for deleling folders")) |
79 self.log(str("unsubsted substed for deleting folders")) |
80 else: |
80 else: |
81 self.log(str("Removing %s" % dir_)) |
81 self.log(str("Removing %s" % dir_)) |
82 fileutils.rmtree(dir_) |
82 fileutils.rmtree(dir_) |
83 except Exception, e: |
83 except Exception, e: |
84 if os.sep == '\\': |
84 if os.sep == '\\': |
85 fileutils.unsubst(del_folder_drive) |
85 try: |
86 self.log(str("unsbusted for deleling folders")) |
86 fileutils.unsubst(del_folder_drive) |
|
87 self.log(str("unsubsted for deleling folders")) |
|
88 except Exception, e2: |
|
89 self.log(str("failed when unsubsting for failed deleting folders... process will continue anyway")) |
87 self.log(str("ERROR: %s" % e)) |
90 self.log(str("ERROR: %s" % e)) |
88 |
91 |
89 # Delete all config files |
92 # Delete all config files |
90 for path_ in found_inputs: |
93 for path_ in found_inputs: |
91 self.log(str("Deleting %s." % path_)) |
94 self.log(str("Deleting %s." % path_)) |
131 </scriptdef> |
134 </scriptdef> |
132 |
135 |
133 <!-- This target flags the Build areas for deletion. So the cleanup build robot could remove them. --> |
136 <!-- This target flags the Build areas for deletion. So the cleanup build robot could remove them. --> |
134 <target name="flag-ba-for-deletion" if = "ci.cleanup.env.dir"> |
137 <target name="flag-ba-for-deletion" if = "ci.cleanup.env.dir"> |
135 <mkdir dir="${ci.cleanup.env.dir}"/> |
138 <mkdir dir="${ci.cleanup.env.dir}"/> |
136 <if> |
139 <condition property="ci.min.ba.maintain" value="2"> |
137 <not> |
140 <not> |
138 <isset property="ci.min.ba.maintain"/> |
141 <isset property="ci.min.ba.maintain"/> |
139 </not> |
142 </not> |
140 <then> |
143 </condition> |
141 <property name="ci.min.ba.maintain" value="2"/> |
|
142 </then> |
|
143 </if> |
|
144 <hlm:BADeleteMacro outputdir="${ci.cleanup.env.dir}" rootdir="${prep.root.dir}" no.ba.remain="${ci.min.ba.maintain}"/> |
144 <hlm:BADeleteMacro outputdir="${ci.cleanup.env.dir}" rootdir="${prep.root.dir}" no.ba.remain="${ci.min.ba.maintain}"/> |
145 </target> |
145 </target> |
146 |
146 |
147 <!-- This task monitor the sessions available under the session file and update/create new ones if needed. --> |
147 <!-- This task monitor the sessions available under the session file and update/create new ones if needed. --> |
148 <scriptdef name="monitorCCMSession" language="jython" uri="http://www.nokia.com/helium"> |
148 <scriptdef name="monitorCCMSession" language="jython" uri="http://www.nokia.com/helium"> |
266 for project in projects: |
266 for project in projects: |
267 p = doc.xml_create_element(u"project", attributes=project) |
267 p = doc.xml_create_element(u"project", attributes=project) |
268 root.xml_append(p) |
268 root.xml_append(p) |
269 |
269 |
270 output = open(outputFilename, "w+") |
270 output = open(outputFilename, "w+") |
271 output.write(doc.xml()) |
271 output.write(doc.xml(indent=u"yes")) |
272 output.close() |
272 output.close() |
273 </hlm:python> |
273 </hlm:python> |
274 </sequential> |
274 </sequential> |
275 </macrodef> |
275 </macrodef> |
276 |
276 |
284 </and> |
284 </and> |
285 <then> |
285 <then> |
286 <property name="do.ci-monitor-ccm-session" value="true"/> |
286 <property name="do.ci-monitor-ccm-session" value="true"/> |
287 </then> |
287 </then> |
288 <else> |
288 <else> |
289 <echo>Delivery file not available or 'ci.session.file' not defined or ccm.enabled not set to true.</echo> |
289 <echo>'prep.delivery.file' not available or 'ci.session.file' not defined or 'ccm.enabled' not set to true.</echo> |
290 </else> |
290 </else> |
291 </if> |
291 </if> |
292 </target> |
292 </target> |
293 |
293 |
294 <!-- Validate input for the ci-prep-wa-create-list target. --> |
294 <!-- Validate input for the ci-prep-wa-create-list target. --> |
295 <target name="ci-prep-wa-create-list-validate" depends="ci-monitor-ccm-session-validate" if="do.ci-monitor-ccm-session"> |
295 <target name="ci-prep-wa-create-list-validate" depends="ci-monitor-ccm-session-validate" if="do.ci-monitor-ccm-session"> |
296 <if> |
296 <if> |
297 <and> |
297 <isset property="ci.project.config"/> |
298 <isset property="ci.project.config"/> |
|
299 </and> |
|
300 <then> |
298 <then> |
301 <property name="do.ci-prep-wa-create-list" value="true"/> |
299 <property name="do.ci-prep-wa-create-list" value="true"/> |
302 </then> |
300 </then> |
303 <else> |
301 <else> |
304 <echo>'ci.project.config' not defined.</echo> |
302 <echo>'ci.project.config' not defined.</echo> |