builds_to_ant.xsl 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  4. exclude-result-prefixes="xs"
  5. version="2.0">
  6. <!-- template do zbudowania listy podzadan na podsatwie <fileset id="builds_to_ant" dir="temp" includes="prezes1.build_root_x2f_.d1e1.CRM_PROCES_x2f_.d1e46.CRM_WSKAZNIK_x2f_.d1e51.CRM_LISTA_ZASOBOW.*" /> -->
  7. <xsl:output indent="yes"/>
  8. <xsl:strip-space elements="*"/>
  9. <xsl:param name="temp" required="yes"/>
  10. <xsl:param name="default_antfile"/>
  11. <!--<xsl:param name="loop_xpath" required="yes"/>-->
  12. <xsl:param name="loop_xpath_real" required="yes"/>
  13. <xsl:param name="loop_path_recurs" required="yes"/>
  14. <xsl:param name="xpath_query" required="yes"/>
  15. <xsl:param name="featureID_name_dita" required="yes"/>
  16. <xsl:param name="xpath_query_test.xml"/>
  17. <!--<xsl:param name="recurse_ant_basedir" required="yes"/>-->
  18. <!--<xsl:param name="temp_current" required="yes"/>-->
  19. <xsl:param name="ant-launcher.jar" required="yes"/>
  20. <xsl:param name="build_check_java_process_count.xml" required="yes"/>
  21. <xsl:param name="parallel_java_process_max" required="yes"/>
  22. <xsl:param name="loop_xpath" /> <!-- required="yes" , added at @2017-04-14 to concat $temp in exec -->
  23. <xsl:param name="feature_pos"/>
  24. <xsl:param name="feature_pos_parent"/> <!-- do wykluczenia bledow z przejsciem przez loop jak jest wiecej elementow Proces_tree -->
  25. <xsl:param name="process_locks"/>
  26. <xsl:param name="uuid" required="yes"/>
  27. <xsl:param name="debug" select="1"/>
  28. <xsl:variable name="xpath_query_test">
  29. <xsl:choose>
  30. <xsl:when test="$xpath_query_test.xml">
  31. <xsl:copy-of select="doc($xpath_query_test.xml)"/>
  32. </xsl:when>
  33. <xsl:otherwise>
  34. <xpath_query_test>OK</xpath_query_test>
  35. </xsl:otherwise>
  36. </xsl:choose>
  37. </xsl:variable>
  38. <xsl:template name="last_slash">
  39. <xsl:param name="string" required="yes"/>
  40. <xsl:for-each select="tokenize($string,'/')">
  41. <xsl:if test="position()=(last() - 1)">
  42. <xsl:value-of select="."/>
  43. </xsl:if>
  44. </xsl:for-each>
  45. </xsl:template>
  46. <xsl:template match="builds_to_ant">
  47. <project xmlns:gml="http://www.opengis.net/gml"
  48. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  49. xmlns:xlink="http://www.w3.org/1999/xlink"
  50. xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
  51. xmlns:wfs="http://www.opengis.net/wfs"
  52. xmlns:ogc="http://www.opengis.net/ogc"
  53. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  54. basedir="../."
  55. name="builds_to_ant_proj{$loop_path_recurs}{$loop_xpath_real}"
  56. default="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}">
  57. <property name="build_check_java_process_count.xml" value="{$build_check_java_process_count.xml}"/>
  58. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  59. <tempfile prefix=".builds_to_ant_set_parallel_java_process_max" suffix=".xml" destdir="{$temp}" deleteonexit="true" >
  60. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  61. </tempfile>
  62. <property name="xpath_query" value="{$xpath_query}"/>
  63. <xsl:element name="target">
  64. <xsl:attribute name="name" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  65. <ant antfile="{$build_check_java_process_count.xml}">
  66. <xsl:attribute name="output" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  67. <property name="builds_to_ant_set_parallel_java_process_max">
  68. <xsl:attribute name="value" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  69. </property>
  70. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  71. <property name="process_locks" value="{$process_locks}"/>
  72. </ant>
  73. <loadfile>
  74. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max_loadfile',$loop_path_recurs,$loop_xpath_real)"/>
  75. <xsl:attribute name="srcfile" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  76. </loadfile>
  77. <!--<delete verbose="false">
  78. <xsl:attribute name="file" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  79. </delete>-->
  80. </xsl:element>
  81. <xsl:element name="target">
  82. <xsl:attribute name="name" select="concat('builds_to_ant',$loop_path_recurs,$loop_xpath_real)"/>
  83. <xsl:attribute name="depends" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  84. <xsl:variable name="last_slash">
  85. <xsl:call-template name="last_slash">
  86. <xsl:with-param name="string" select="$temp"/>
  87. </xsl:call-template>
  88. </xsl:variable>
  89. <xsl:comment> default_antfile: <xsl:value-of select="$default_antfile"/> ; </xsl:comment>
  90. <xsl:choose>
  91. <xsl:when test="not($xpath_query_test/xpath_query_test='OK')">
  92. <xsl:message> $xpath_query_test NOT OK - bypassed by xpath_query filter </xsl:message>
  93. <echo> $xpath_query_test NOT OK - bypassed by xpath_query filter </echo>
  94. </xsl:when>
  95. <xsl:when test="1=1"> <!-- $last_slash='temp' -->
  96. <xsl:if test="$debug &gt; 1"><xsl:message> FIRST LEVEL ANT is executed in PARALLEL </xsl:message></xsl:if>
  97. <xsl:if test="$debug &gt; 1"><echo>
  98. ######98 PARALLEL STARTING CURRENT LEAF BUILDING BY RelatedFeature #######
  99. # $temp = <xsl:value-of select="$temp"/> ;
  100. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  101. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  102. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  103. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  104. #
  105. ################################################################
  106. </echo></xsl:if>
  107. <!--<tempfile suffix=".xml" destdir="{$process_locks}" deleteonexit="yes" createfile="yes">
  108. <xsl:attribute name="property" select="concat('builds_to_ant_lock',$loop_path_recurs,$loop_xpath_real)"/>
  109. </tempfile>-->
  110. <parallel failonany="true">
  111. <xsl:attribute name="threadCount" select="concat('${builds_to_ant_set_parallel_java_process_max_loadfile',$loop_path_recurs,$loop_xpath_real,'}')"/>
  112. <!-- threadCount="4" -->
  113. <xsl:for-each select="tokenize(.,';')">
  114. <!-- is also possible to run ordinary ant task! -->
  115. <!--<echo message="executing pos:{position()} antfile: {$temp}/{$loop_xpath}/{.}/build.xml "/>-->
  116. <!--<ant antfile="{$temp}/{$loop_xpath}/{.}/build.xml" dir="." inheritall="false">
  117. <property name="parallel_pos" value="{position()}"/>
  118. </ant>--> <!-- CHANGED from ${temp}/{.} -->
  119. <java>
  120. <xsl:attribute name="jar" select="$ant-launcher.jar"/>
  121. <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
  122. <!--<xsl:attribute name="dir" select="'${basedir}'"/>-->
  123. <xsl:attribute name="fork" select="'true'"/>
  124. <xsl:attribute name="clonevm" select="'false'"/>
  125. <xsl:attribute name="failonerror" select="'true'"/>
  126. <!--<xsl:attribute name="append" select="'false'"/>-->
  127. <!--<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-->
  128. <!--<xsl:attribute name="output" select="concat($temp,'/',.,'_out.log')"/>-->
  129. <arg value="-buildfile"/>
  130. <arg value="{$temp}/{$loop_xpath}/{.}/build.xml"/>
  131. </java>
  132. </xsl:for-each>
  133. </parallel>
  134. <!--<delete>
  135. <xsl:attribute name="file" select="concat('${builds_to_ant_lock',$loop_path_recurs,$loop_xpath_real,'}')"/>
  136. </delete>-->
  137. <xsl:if test="$debug &gt; 1"><echo>
  138. #######98B PARALLEL FINISHED CURRENT LEAF BUILDING BY RelatedFeature #######
  139. # $temp = <xsl:value-of select="$temp"/> ;
  140. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  141. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  142. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  143. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  144. #
  145. ################################################################
  146. </echo></xsl:if>
  147. </xsl:when>
  148. <xsl:otherwise>
  149. <xsl:if test="$debug &gt; 1"><xsl:message> SECOND AND NEXT LEVEL ANT is executed in normal </xsl:message></xsl:if>
  150. <xsl:if test="$debug &gt; 1"><echo>
  151. ######98 NOT PARALLEL STARTING CURRENT LEAF BUILDING BY RelatedFeature #######
  152. # $temp = <xsl:value-of select="$temp"/> ;
  153. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  154. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  155. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  156. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  157. #
  158. ################################################################
  159. </echo></xsl:if>
  160. <xsl:for-each select="tokenize(.,';')">
  161. <echo>#####155 Running antfile: <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',.,'/build.xml')"/></echo>
  162. <ant antfile="{$temp}/{$loop_xpath}/{.}/build.xml" dir="."/><!-- bylo przed 2017-04-14 <ant antfile="{$temp}/{.}" dir="."/>-->
  163. </xsl:for-each>
  164. <xsl:if test="$debug &gt; 1"><echo>
  165. #######98B NOT PARALLEL FINISHED CURRENT LEAF BUILDING BY RelatedFeature #######
  166. # $temp = <xsl:value-of select="$temp"/> ;
  167. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  168. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  169. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  170. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  171. #
  172. ################################################################
  173. </echo></xsl:if>
  174. </xsl:otherwise>
  175. </xsl:choose>
  176. </xsl:element>
  177. <!--<delete verbose="false">
  178. <xsl:attribute name="file" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  179. </delete>-->
  180. </project>
  181. </xsl:template>
  182. <xsl:template match="builds_to_ant" mode="exec">
  183. <project xmlns:gml="http://www.opengis.net/gml"
  184. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  185. xmlns:xlink="http://www.w3.org/1999/xlink"
  186. xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
  187. xmlns:wfs="http://www.opengis.net/wfs"
  188. xmlns:ogc="http://www.opengis.net/ogc"
  189. xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
  190. basedir="../."
  191. name="builds_to_ant_proj{$loop_path_recurs}{$loop_xpath_real}"
  192. default="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}">
  193. <property name="build_check_java_process_count.xml" value="{$build_check_java_process_count.xml}"/>
  194. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  195. <tempfile prefix=".builds_to_ant_set_parallel_java_process_max" suffix=".xml" destdir="{$temp}" deleteonexit="true" >
  196. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  197. </tempfile>
  198. <property name="xpath_query" value="{$xpath_query}"/>
  199. <xsl:element name="target">
  200. <xsl:attribute name="name" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  201. <ant antfile="{$build_check_java_process_count.xml}">
  202. <xsl:attribute name="output" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  203. <property name="builds_to_ant_set_parallel_java_process_max">
  204. <xsl:attribute name="value" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  205. </property>
  206. <property name="parallel_java_process_max" value="{$parallel_java_process_max}"/>
  207. <property name="process_locks" value="{$process_locks}"/>
  208. </ant>
  209. <loadfile>
  210. <xsl:attribute name="property" select="concat('builds_to_ant_set_parallel_java_process_max_loadfile',$loop_path_recurs,$loop_xpath_real)"/>
  211. <xsl:attribute name="srcfile" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  212. </loadfile>
  213. <!--<delete verbose="false">
  214. <xsl:attribute name="file" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  215. </delete>-->
  216. </xsl:element>
  217. <target name="builds_to_ant{$loop_path_recurs}{$loop_xpath_real}">
  218. <xsl:attribute name="depends" select="concat('builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real)"/>
  219. <xsl:comment> default_antfile: <xsl:value-of select="$default_antfile"/> ; </xsl:comment>
  220. <!-- robimy na paraler -->
  221. <xsl:choose>
  222. <xsl:when test="not($xpath_query_test/xpath_query_test='OK')">
  223. <xsl:message> $xpath_query_test NOT OK - bypassed by xpath_query filter </xsl:message>
  224. <echo> $xpath_query_test NOT OK - bypassed by xpath_query filter </echo>
  225. </xsl:when>
  226. <xsl:when test="1=1"> <!-- error brak klasy Error: Could not find or load main class org.apache.tools.ant.Main -->
  227. <xsl:if test="$debug &gt; 1"><echo>
  228. ######234 PARALLEL STARTING CURRENT BUILDING BY RelatedFeatureLoop #######
  229. # $temp = <xsl:value-of select="$temp"/> ;
  230. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  231. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  232. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  233. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  234. # $feature_pos_parent= <xsl:value-of select="$feature_pos_parent"/>; $feature_pos= <xsl:value-of select="$feature_pos"/>;
  235. ################################################################
  236. </echo></xsl:if>
  237. <!--<tempfile suffix=".xml" destdir="{$process_locks}" deleteonexit="yes" createfile="yes">
  238. <xsl:attribute name="property" select="concat('builds_to_ant_lock',$loop_path_recurs,$loop_xpath_real)"/>
  239. </tempfile>-->
  240. <parallel failonany="false"> <!-- we tried to retry lowe -->
  241. <xsl:attribute name="threadCount" select="concat('${builds_to_ant_set_parallel_java_process_max_loadfile',$loop_path_recurs,$loop_xpath_real,'}')"/>
  242. <xsl:for-each select="tokenize(.,';')">
  243. <!-- could be exec also in parallel task !!! -->
  244. <!--<exec executable="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
  245. <xsl:element name="arg">
  246. <xsl:attribute name="line" select="concat('-f ',$temp,'/',$loop_xpath,'/',.,'/build_root.xml')"/>
  247. </xsl:element>
  248. <xsl:element name="arg">
  249. <xsl:attribute name="line" select="concat('-Dparallel_pos=',position())"/>
  250. </xsl:element>
  251. </exec>-->
  252. <java>
  253. <xsl:attribute name="jar" select="$ant-launcher.jar"/>
  254. <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
  255. <xsl:attribute name="dir" select="concat($temp,'/',$loop_xpath,'/',.)"/>
  256. <xsl:attribute name="fork" select="'true'"/>
  257. <xsl:attribute name="clonevm" select="'false'"/>
  258. <xsl:attribute name="newenvironment" select="'true'"/>
  259. <xsl:attribute name="failonerror" select="'true'"/>
  260. <!--<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-->
  261. <!--<xsl:attribute name="output" select="concat(.,'_out.log')"/>-->
  262. <arg value="-buildfile"/>
  263. <arg value="{$temp}/{$loop_xpath}/{.}/build_root.xml"/>
  264. <xsl:element name="arg">
  265. <xsl:attribute name="line" select="concat('-Dparallel_pos=',position())"/>
  266. </xsl:element>
  267. </java>
  268. </xsl:for-each>
  269. </parallel>
  270. <!--<delete>
  271. <xsl:attribute name="file" select="concat('${builds_to_ant_lock',$loop_path_recurs,$loop_xpath_real,'}')"/>
  272. </delete>-->
  273. <xsl:if test="$debug &gt; 1"><echo>
  274. #######257 NOT PARALLEL FINISHED CURRENT LEAF BUILDING BY RelatedFeatureLoop #######
  275. # $temp = <xsl:value-of select="$temp"/> ;
  276. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  277. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  278. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  279. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  280. #
  281. ################################################################
  282. </echo></xsl:if>
  283. </xsl:when>
  284. <xsl:otherwise>
  285. <xsl:if test="$debug &gt; 1"><echo>
  286. ######270 DISABLED PARALLEL STARTING CURRENT BUILDING BY RelatedFeatureLoop #######
  287. # $temp = <xsl:value-of select="$temp"/> ;
  288. # builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
  289. # $xpath_query = <xsl:value-of select="$xpath_query"/>;
  290. # $xpath_query_test/xpath_query_test = <xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
  291. # $featureID_name_dita = <xsl:value-of select="$featureID_name_dita"/>;
  292. #
  293. ################################################################
  294. </echo></xsl:if>
  295. <xsl:for-each select="tokenize(.,';')">
  296. <xsl:if test="$debug &gt; 1"><echo>#####281 Running exec antfile: <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',.,'/build_root.xml')"/>
  297. ##### $feature_pos_parent= <xsl:value-of select="$feature_pos_parent"/>; $feature_pos= <xsl:value-of select="$feature_pos"/>;
  298. #####
  299. </echo></xsl:if>
  300. <!-- TODO DEBUG OFF LOOP -->
  301. <exec executable="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
  302. <xsl:element name="arg">
  303. <xsl:attribute name="line" select="concat('-f ',$temp,'/',$loop_xpath,'/',.,'/build_root.xml')"/>
  304. </xsl:element>
  305. <xsl:element name="arg">
  306. <xsl:attribute name="line" select="concat('-Dparallel_pos=',position())"/>
  307. </xsl:element>
  308. </exec>
  309. <!--<ant antfile="{.}/build_root.xml" dir="{$temp}" inheritall="false" usenativebasedir="true" />-->
  310. </xsl:for-each>
  311. </xsl:otherwise>
  312. </xsl:choose>
  313. <echo>#285 VERYFING CORRECT CHILD EXEC IF FAILED RETRY IT </echo>
  314. <xsl:for-each select="tokenize(.,';')">
  315. <echo>#285 VERYFING <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',.,'/build_root.xml')"/> (.test_if_exec_child_ant.xml + {$uuid}_out_task_dita_final.dita.xml ) </echo>
  316. <loadfile property="Verify_numbers_file_{position()}" srcFile="{$temp}/{$loop_xpath}/{.}/.test_if_exec_child_ant.xml"/>
  317. <condition property="Verify_{position()}" taskname="Retry_{position()}">
  318. <or>
  319. <available file="{$temp}/{$loop_xpath}/{.}/{$uuid}_out_task_dita_final.dita.xml"/> <!-- todo zrobic sprawdzenie czy bylo warto sciagac podwezel -->
  320. <xsl:element name="contains">
  321. <xsl:attribute name="string" select="concat('${Verify_numbers_file_',position(),'}')"/>
  322. <xsl:attribute name="substring" select="'numberMatched=&quot;0&quot;'"/>
  323. </xsl:element>
  324. </or>
  325. </condition>
  326. </xsl:for-each>
  327. <xsl:for-each select="tokenize(.,';')">
  328. <antcall target="Retry_{position()}"/>
  329. <antcall target="Confirm_{position()}"/>
  330. </xsl:for-each>
  331. </target>
  332. <!-- retries tasks-->
  333. <xsl:for-each select="tokenize(.,';')">
  334. <target name="Retry_{position()}">
  335. <xsl:attribute name="unless" select="concat('${Verify_',position(),'}')"/>
  336. <echo>
  337. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #350 FIXING BAD RELATEDLOOP EXECUTION for <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',.,'build_root.xml')"/>
  338. </echo>
  339. <delete includeEmptyDirs="true" quiet="true">
  340. <fileset dir="{$temp}/{$loop_xpath}/{.}">
  341. <include name="*"/>
  342. <exclude name="build_root.xml"/>
  343. </fileset>
  344. </delete>
  345. <exec executable="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
  346. <xsl:element name="arg">
  347. <xsl:attribute name="line" select="concat('-f ',$temp,'/',$loop_xpath,'/',.,'/build_root.xml')"/>
  348. </xsl:element>
  349. <xsl:element name="arg">
  350. <xsl:attribute name="line" select="concat('-Dparallel_pos=',position())"/>
  351. </xsl:element>
  352. </exec>
  353. </target>
  354. </xsl:for-each>
  355. <!-- confirm ok tasks -->
  356. <xsl:for-each select="tokenize(.,';')">
  357. <target name="Confirm_{position()}">
  358. <xsl:attribute name="if" select="concat('${Verify_',position(),'}')"/>
  359. <echo> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #350 #380 CONFIRMED RELATEDLOOP EXECUTION for <xsl:value-of select="concat($temp,'/',$loop_xpath,'/',.,'build_root.xml')"/></echo>
  360. </target>
  361. </xsl:for-each>
  362. <!--<delete>
  363. <xsl:attribute name="file" select="concat('${builds_to_ant_set_parallel_java_process_max',$loop_path_recurs,$loop_xpath_real,'}')"/>
  364. </delete>-->
  365. </project>
  366. </xsl:template>
  367. </xsl:stylesheet>