[Yanel-commits] rev 42786 - in public/yanel/trunk/src/build: .
targets targets/webapp
michi at wyona.com
michi at wyona.com
Mon May 11 10:04:48 CEST 2009
Author: michi
Date: 2009-05-11 10:04:48 +0200 (Mon, 11 May 2009)
New Revision: 42786
Modified:
public/yanel/trunk/src/build/fix-resources-src.xsl
public/yanel/trunk/src/build/targets/resources.xml
public/yanel/trunk/src/build/targets/webapp/webapp.xml
public/yanel/trunk/src/build/yanel2resources.xsl
Log:
check if copy resource-type configs property is set
Modified: public/yanel/trunk/src/build/fix-resources-src.xsl
===================================================================
--- public/yanel/trunk/src/build/fix-resources-src.xsl 2009-05-11 08:00:19 UTC (rev 42785)
+++ public/yanel/trunk/src/build/fix-resources-src.xsl 2009-05-11 08:04:48 UTC (rev 42786)
@@ -7,6 +7,8 @@
<xsl:output method="xml" indent="yes"/>
+<xsl:param name="copy.resource-type-configs.to.webapp" select="'NULL_copy_resource-type-configs_to_webapp'"/>
+
<xsl:template match="/">
<y:resource-types xmlns:y="http://www.wyona.org/yanel/1.0" version="{/yanel:resource-types/@version}">
<xsl:for-each select="/yanel:resource-types/yanel:resource-type">
@@ -14,7 +16,7 @@
<xsl:when test="@package">
<y:resource-type package="{@package}"/>
</xsl:when>
- <xsl:when test="@copy-dir-name">
+ <xsl:when test="@copy-dir-name and $copy.resource-type-configs.to.webapp = 'true'">
<y:resource-type src="../../resources/{@copy-dir-name}"/>
</xsl:when>
<xsl:otherwise>
Modified: public/yanel/trunk/src/build/targets/resources.xml
===================================================================
--- public/yanel/trunk/src/build/targets/resources.xml 2009-05-11 08:00:19 UTC (rev 42785)
+++ public/yanel/trunk/src/build/targets/resources.xml 2009-05-11 08:04:48 UTC (rev 42786)
@@ -81,6 +81,7 @@
<param name="yanel.source.version" expression="${yanel.version}-r${yanel.revision}"/>
<param name="maven.url" expression="${maven.url}"/>
<param name="yanel.source.home" expression="${yanel.source.home.forward.slashes}"/>
+ <param name="copy.resource-type-configs.to.webapp" expression="${copy.resource-type-configs.to.webapp}"/>
</xslt>
</target>
Modified: public/yanel/trunk/src/build/targets/webapp/webapp.xml
===================================================================
--- public/yanel/trunk/src/build/targets/webapp/webapp.xml 2009-05-11 08:00:19 UTC (rev 42785)
+++ public/yanel/trunk/src/build/targets/webapp/webapp.xml 2009-05-11 08:04:48 UTC (rev 42786)
@@ -118,6 +118,7 @@
<!-- /DEPRECATED -->
<xslt in="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/classes/resource-types.xml" out="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/classes/resource-types.xml-OUT" style="fix-resources-src.xsl" force="true">
+ <param name="copy.resource-type-configs.to.webapp" expression="${copy.resource-type-configs.to.webapp}"/>
</xslt>
<move file="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/classes/resource-types.xml-OUT" tofile="${build.dir}/webapps/${servlet.context.prefix}/WEB-INF/classes/resource-types.xml"/>
Modified: public/yanel/trunk/src/build/yanel2resources.xsl
===================================================================
--- public/yanel/trunk/src/build/yanel2resources.xsl 2009-05-11 08:00:19 UTC (rev 42785)
+++ public/yanel/trunk/src/build/yanel2resources.xsl 2009-05-11 08:04:48 UTC (rev 42786)
@@ -11,6 +11,7 @@
<xsl:param name="yanel.source.version" select="'NULL_yanel_source_version'"/>
<xsl:param name="maven.url" select="'NULL_maven_url'"/>
<xsl:param name="yanel.source.home" select="'NULL_yanel_source_home'"/>
+<xsl:param name="copy.resource-type-configs.to.webapp" select="'NULL_copy_resource-type-configs_to_webapp'"/>
<xsl:template match="/">
@@ -69,24 +70,24 @@
<mkdir dir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources"/>
<xsl:for-each select="/yanel:resource-types/yanel:resource-type">
- <xsl:if test="@copy-dir-name">
- <xsl:comment>TODO: Copy sources of resource type '<xsl:value-of select="@src"/>' to Yanel webapp folder ...</xsl:comment>
- <xsl:variable name="RT-home-dir">
- <xsl:choose>
- <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:when test="starts-with(@src, '@YANEL_SRC_DIR@')">
- <xsl:value-of select="@src"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('${build.dir}/', @src, '/build.xml')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources/{@copy-dir-name}">
- <fileset dir="{$RT-home-dir}" excludes="build/**, src/java/**, src/build/**, build.xml"/>
- </copy>
+ <xsl:if test="@copy-dir-name and $copy.resource-type-configs.to.webapp = 'true'">
+ <xsl:comment>Copy sources of resource type '<xsl:value-of select="@src"/>' to Yanel webapp folder ...</xsl:comment>
+ <xsl:variable name="RT-home-dir">
+ <xsl:choose>
+ <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
+ <xsl:value-of select="@src"/>
+ </xsl:when>
+ <xsl:when test="starts-with(@src, '@YANEL_SRC_DIR@')">
+ <xsl:value-of select="@src"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('${build.dir}/', @src, '/build.xml')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources/{@copy-dir-name}">
+ <fileset dir="{$RT-home-dir}" excludes="build/**, src/java/**, src/build/**, build.xml"/>
+ </copy>
</xsl:if>
<xsl:choose>
More information about the Yanel-commits
mailing list