[Yanel-commits] rev 42616 - public/yanel/trunk/src/build

michi at wyona.com michi at wyona.com
Tue May 5 15:38:32 CEST 2009


Author: michi
Date: 2009-05-05 15:38:32 +0200 (Tue, 05 May 2009)
New Revision: 42616

Modified:
   public/yanel/trunk/src/build/yanel2resources.xsl
Log:
check on source attribute

Modified: public/yanel/trunk/src/build/yanel2resources.xsl
===================================================================
--- public/yanel/trunk/src/build/yanel2resources.xsl	2009-05-05 13:10:58 UTC (rev 42615)
+++ public/yanel/trunk/src/build/yanel2resources.xsl	2009-05-05 13:38:32 UTC (rev 42616)
@@ -75,27 +75,29 @@
 <xsl:for-each select="/yanel:resource-types/yanel:resource-type">
 
     <xsl:if test="@copy-dir-name">
-      <xsl:comment>TODO: Copy sources ...</xsl:comment>
-    <xsl:choose>
-      <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
+      <xsl:comment>Copy sources of resource type '<xsl:value-of select="@src"/>' to Yanel webapp folder ...</xsl:comment>
+      <xsl:choose>
+        <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
     <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources/{@copy-dir-name}">
       <fileset dir="{@src}" excludes="build/**, src/java/**, src/build/**, build.xml"/>
     </copy>
-      </xsl:when>
-      <xsl:when test="starts-with(@src, '@YANEL_SRC_DIR@')">
+        </xsl:when>
+        <xsl:when test="starts-with(@src, '@YANEL_SRC_DIR@')">
     <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources/{@copy-dir-name}">
       <fileset dir="{@src}" excludes="build/**, src/java/**, src/build/**, build.xml"/>
     </copy>
-      </xsl:when>
-      <xsl:otherwise>
+        </xsl:when>
+        <xsl:otherwise>
     <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/resources/{@copy-dir-name}">
       <fileset dir="${{build.dir}}/{@src}" excludes="build/**, src/java/**, src/build/**, build.xml"/>
     </copy>
-      </xsl:otherwise>
-    </xsl:choose>
+        </xsl:otherwise>
+      </xsl:choose>
     </xsl:if>
 
     <xsl:choose>
+      <xsl:when test="@src">
+    <xsl:choose>
       <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
     <copy todir="${{build.dir}}/webapps/{$servlet.context.prefix}/WEB-INF/lib">
       <fileset dir="{@src}/build/lib"/>
@@ -112,6 +114,11 @@
     </copy>
       </xsl:otherwise>
     </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <echo>WARN: No 'src' attribute specified (package: <xsl:value-of select="@package"/>)</echo>
+      </xsl:otherwise>
+    </xsl:choose>
 </xsl:for-each>
   </target>
 
@@ -154,6 +161,8 @@
     </xsl:otherwise>
   </xsl:choose>
 
+  <xsl:choose>
+    <xsl:when test="@src">
     <xsl:choose>
       <xsl:when test="starts-with(@src, '/') or string-length(substring-before(@src, ':/'))='1'">
     <ant inheritAll="false" antfile="{@src}/build.xml" target="copy-dependencies">
@@ -183,6 +192,11 @@
     </ant>
       </xsl:otherwise>
     </xsl:choose>
+    </xsl:when>
+    <xsl:otherwise>
+      <echo>WARN: No 'src' attribute specified (package: <xsl:value-of select="@package"/>)</echo>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:for-each>
   </target>
 </project>



More information about the Yanel-commits mailing list