| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- <?xml version="1.0" encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- exclude-result-prefixes="xs"
- version="2.0">
-
- <!-- 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.*" /> -->
-
- <xsl:output indent="yes"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:param name="temp" required="yes"/>
- <xsl:param name="default_antfile"/>
- <!--<xsl:param name="loop_xpath" required="yes"/>-->
- <xsl:param name="loop_xpath_real" required="yes"/>
- <xsl:param name="xpath_query" required="yes"/>
- <xsl:param name="featureID_name_dita" required="yes"/>
- <xsl:param name="xpath_query_test.xml"/>
- <!--<xsl:param name="recurse_ant_basedir" required="yes"/>-->
- <!--<xsl:param name="temp_current" required="yes"/>-->
- <xsl:param name="ant-launcher.jar"/>
-
-
- <xsl:variable name="xpath_query_test">
- <xsl:choose>
- <xsl:when test="$xpath_query_test.xml">
- <xsl:copy-of select="doc($xpath_query_test.xml)"/>
- </xsl:when>
- <xsl:otherwise>
- <xpath_query_test>OK</xpath_query_test>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:template name="last_slash">
- <xsl:param name="string" required="yes"/>
- <xsl:for-each select="tokenize($string,'/')">
- <xsl:if test="position()= last()">
- <xsl:value-of select="."/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
-
-
- <xsl:template match="builds_to_ant">
- <project xmlns:gml="http://www.opengis.net/gml"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
- xmlns:wfs="http://www.opengis.net/wfs"
- xmlns:ogc="http://www.opengis.net/ogc"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- basedir="../."
- name="builds_to_ant_proj{$loop_xpath_real}"
- default="builds_to_ant{$loop_xpath_real}">
- <xsl:element name="target">
- <xsl:attribute name="name" select="concat('builds_to_ant',$loop_xpath_real)"/>
- <xsl:variable name="last_slash">
- <xsl:call-template name="last_slash">
- <xsl:with-param name="string" select="$temp"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:comment> default_antfile: <xsl:value-of select="$default_antfile"/> ; </xsl:comment>
- <xsl:choose>
- <xsl:when test="not($xpath_query_test/xpath_query_test='OK')">
- <xsl:message> $xpath_query_test NOT OK - bypassed by xpath_query filter </xsl:message>
- <echo> $xpath_query_test NOT OK - bypassed by xpath_query filter </echo>
- </xsl:when>
- <xsl:when test="1=2"> <!-- $last_slash='temp' -->
- <xsl:message> FIRST LEVEL ANT is executed in PARALLEL </xsl:message>
- <echo>
- #
- #
- builds_to_ant - uruchomienie ANT w parallel temp/<xsl:value-of select="."/>;
- $xpath_query=<xsl:value-of select="$xpath_query"/>;
- $xpath_query_test/xpath_query_test=<xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
- $featureID_name_dita<xsl:value-of select="$featureID_name_dita"/>;
- #
- #
- </echo>
- <parallel threadCount="4" failonany="true"> <!-- threadCount="4" -->
- <xsl:for-each select="tokenize(.,';')">
- <java>
- <xsl:attribute name="jar" select="$ant-launcher.jar"/>
- <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
- <!--<xsl:attribute name="dir" select="'${basedir}'"/>-->
- <xsl:attribute name="fork" select="'true'"/>
- <xsl:attribute name="clonevm" select="'true'"/>
- <xsl:attribute name="failonerror" select="'true'"/>
- <!--<xsl:attribute name="append" select="'false'"/>-->
- <xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>
- <!--<xsl:attribute name="output" select="concat(.,'_out.log')"/>-->
- <arg value="-buildfile"/>
- <arg value="{$temp}/{.}"/>
- </java>
- </xsl:for-each>
- </parallel>
- <echo>#
- #
- #
- #
- #94 i run all PARALLEL TASKS - should wait some time!
- #
- #
- #
- #</echo>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message> SECOND AND NEXT LEVEL ANT is executed in normal </xsl:message>
- <xsl:for-each select="tokenize(.,';')">
- <echo>
- #
- #
- #
- #
- builds_to_ant - za chwile uruchomie antfile (NOT PARALLEL) $last_slash=<xsl:value-of select="$last_slash"/>; $loop_xpath_real=<xsl:value-of select="$loop_xpath_real"/>; temp/<xsl:value-of select="."/>;
- $xpath_query=<xsl:value-of select="$xpath_query"/>;
- $featureID_name_dita<xsl:value-of select="$featureID_name_dita"/>;
- #
- #
- </echo>
- <ant antfile="{$temp}/{.}" dir="."/>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </project>
- </xsl:template>
-
-
- <xsl:template match="builds_to_ant" mode="exec">
- <project xmlns:gml="http://www.opengis.net/gml"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:p5_default_db="https://biuro.biall-net.pl/wfs/default_db"
- xmlns:wfs="http://www.opengis.net/wfs"
- xmlns:ogc="http://www.opengis.net/ogc"
- xmlns:system_cache__appinfo="http://biuro.biall-net.pl/xmlschema_procesy5/default_db_xml_cache/appinfo.xsd"
- basedir="../."
- name="builds_to_ant_proj{$loop_xpath_real}"
- default="builds_to_ant{$loop_xpath_real}">
- <target name="builds_to_ant{$loop_xpath_real}">
- <xsl:comment> default_antfile: <xsl:value-of select="$default_antfile"/> ; </xsl:comment>
- <!-- robimy na paraler -->
- <xsl:choose>
- <xsl:when test="not($xpath_query_test/xpath_query_test='OK')">
- <xsl:message> $xpath_query_test NOT OK - bypassed by xpath_query filter </xsl:message>
- <echo> $xpath_query_test NOT OK - bypassed by xpath_query filter </echo>
- </xsl:when>
- <xsl:when test="1=2"> <!-- error brak klasy Error: Could not find or load main class org.apache.tools.ant.Main -->
- <echo>
- #
- #
- #
- #
- builds_to_ant - PARALLEL RUN za chwile uruchomie antfile LOOP exec <xsl:value-of select="concat($temp,'/',.)"/>/build_root.xml ;
- $xpath_query=<xsl:value-of select="$xpath_query"/>;
- $xpath_query_test/xpath_query_test=<xsl:value-of select="$xpath_query_test/xpath_query_test"/>;
- $featureID_name_dita<xsl:value-of select="$featureID_name_dita"/>;
- #
- #
- </echo>
- <parallel threadCount="4" failonany="true">
- <xsl:for-each select="tokenize(.,';')">
- <java>
- <xsl:attribute name="jar" select="$ant-launcher.jar"/>
- <!--<xsl:attribute name="classname" select="'org.apache.tools.ant.Main'"/>-->
- <xsl:attribute name="dir" select="concat($temp,'/',.)"/>
- <xsl:attribute name="fork" select="'true'"/>
- <xsl:attribute name="clonevm" select="'false'"/>
- <xsl:attribute name="newenvironment" select="'true'"/>
- <xsl:attribute name="failonerror" select="'true'"/>
- <!--<xsl:attribute name="resultproperty" select="concat(.,'_resprop')"/>-->
- <!--<xsl:attribute name="output" select="concat(.,'_out.log')"/>-->
- <arg value="-buildfile"/>
- <arg value="{$temp}/{.}/build_root.xml"/>
- </java>
- </xsl:for-each>
- </parallel>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="tokenize(.,';')">
- <echo>
- #
- #
- #
- #
- builds_to_ant - za chwile uruchomie antfile LOOP exec temp/<xsl:value-of select="."/>;
- $xpath_query=<xsl:value-of select="$xpath_query"/>;
- $featureID_name_dita<xsl:value-of select="$featureID_name_dita"/>;
- #
- #
- </echo>
- <exec executable="/opt/local/bin/ant" dir="{$temp}" failifexecutionfails="true">
- <xsl:element name="arg">
- <xsl:attribute name="line" select="concat('-f ',$temp,'/',.,'/build_root.xml')"/>
- </xsl:element>
- </exec>
- <!--<ant antfile="{.}/build_root.xml" dir="{$temp}" inheritall="false" usenativebasedir="true" />-->
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </target>
- </project>
- </xsl:template>
-
- </xsl:stylesheet>
|