You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2005/01/19 16:45:07 UTC

svn commit: r125627 - /cocoon/branches/BRANCH_2_1_X /cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl

Author: cziegeler
Date: Wed Jan 19 07:45:05 2005
New Revision: 125627

URL: http://svn.apache.org/viewcvs?view=rev&rev=125627
Log:
Use src directory from gump.xml for building blocks
Modified:
   cocoon/branches/BRANCH_2_1_X/   (props changed)
   cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl

Modified: cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl
Url: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl?view=diff&rev=125627&p1=cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl&r1=125626&p2=cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl&r2=125627
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl	(original)
+++ cocoon/branches/BRANCH_2_1_X/tools/src/blocks-build.xsl	Wed Jan 19 07:45:05 2005
@@ -90,25 +90,26 @@
     <macrodef name="block-compile">
         <attribute name="name"/>
         <attribute name="package"/>
+        <attribute name="dir"/>
         <sequential>
         <!-- Test if this block has special build -->
           <if>
-            <available file="${{blocks}}/@{{name}}/build.xml"/>
+            <available file="@{{dir}}/build.xml"/>
             <then>
               <ant inheritAll="true"
                    inheritRefs="false"
                    target="main"
-                   antfile="${{blocks}}/@{{name}}/build.xml">
-                <property name="block.dir" value="${{blocks}}/@{{name}}"/>
+                   antfile="@{{dir}}/build.xml">
+                <property name="block.dir" value="@{{dir}}"/>
               </ant>
             </then>
           </if>
           <!-- Test if this block has mocks -->
           <if>
-            <available type="dir" file="${{blocks}}/@{{name}}/mocks/"/>
+            <available type="dir" file="@{{dir}}/mocks/"/>
             <then>
               <mkdir dir="${{build.blocks}}/@{{name}}/mocks"/>
-              <javac srcdir="${{blocks}}/@{{name}}/mocks"
+              <javac srcdir="@{{dir}}/mocks"
                      destdir="${{build.blocks}}/@{{name}}/mocks"
                      debug="${{compiler.debug}}"
                      optimize="${{compiler.optimize}}"
@@ -129,11 +130,11 @@
       -->
       <!-- Currently, we have no JVM dependent sources
       <condition property="dependend.vm" value="${{target.vm}}">
-        <available file="${{blocks}}/@{{name}}/java${{target.vm}}"/>
+        <available file="@{{dir}}/java${{target.vm}}"/>
       </condition>
       <condition property="dependend.vm" value="">
         <not>
-          <available file="${{blocks}}/@{{name}}/java${{target.vm}}"/>
+          <available file="@{{dir}}/java${{target.vm}}"/>
         </not>
       </condition>
       -->
@@ -144,22 +145,22 @@
              target="${{target.vm}}"
              nowarn="${{compiler.nowarn}}"
              compiler="${{compiler}}">
-        <src path="${{blocks}}/@{{name}}/java"/>
+        <src path="@{{dir}}/java"/>
         <!-- Currently, we have no JVM dependent sources
-        <src path="${{blocks}}/@{{name}}/java${{dependend.vm}}"/>
+        <src path="@{{dir}}/java${{dependend.vm}}"/>
         -->
         <classpath refid="@{{name}}.classpath"/>
         <exclude name="**/samples/**/*.java"/>
       </javac>
 
       <copy filtering="on" todir="${{build.blocks}}/@{{name}}/dest">
-        <fileset dir="${{blocks}}/@{{name}}/java">
+        <fileset dir="@{{dir}}/java">
           <patternset refid="unprocessed.sources"/>
         </fileset>
       </copy>
 
       <copy filtering="off" todir="${{build.blocks}}/@{{name}}/dest">
-        <fileset dir="${{blocks}}/@{{name}}/java">
+        <fileset dir="@{{dir}}/java">
           <include name="**/Manifest.mf"/>
           <include name="META-INF/**"/>
         </fileset>
@@ -174,7 +175,7 @@
         <istrue value="${{include.sources-in-jars}}"/>
         <then>
           <jar jarfile="${{build.blocks}}/@{{name}}-block.jar" update="true">
-            <fileset dir="${{blocks}}/@{{name}}/java">
+            <fileset dir="@{{dir}}/java">
               <include name="**/*.java"/>
             </fileset>
           </jar>
@@ -185,7 +186,7 @@
         <istrue value="${{include.sources-jars}}"/>
         <then>
           <jar jarfile="${{build.blocks}}/@{{name}}-block.src.jar">
-            <fileset dir="${{blocks}}/@{{name}}/java">
+            <fileset dir="@{{dir}}/java">
               <include name="**/*.java"/>
             </fileset>
           </jar>
@@ -204,9 +205,9 @@
              target="${{target.vm}}"
              nowarn="${{compiler.nowarn}}"
              compiler="${{compiler}}">
-            <src path="${{blocks}}/@{{name}}/java"/>
+            <src path="@{{dir}}/java"/>
             <!-- Currently, we have no JVM dependent sources
-            <src path="${{blocks}}/@{{name}}/java${{dependend.vm}}"/>
+            <src path="@{{dir}}/java${{dependend.vm}}"/>
             -->
             <classpath refid="@{{name}}.classpath"/>
             <include name="**/samples/**/*.java"/>
@@ -218,23 +219,24 @@
 
    <macrodef name="block-patch">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
-          <xpatch file="${{build.webapp}}/sitemap.xmap" srcdir="${{blocks}}">
-            <include name="@{{name}}/conf/*.xmap"/>
+          <xpatch file="${{build.webapp}}/sitemap.xmap" srcdir="@{{dir}}">
+            <include name="conf/*.xmap"/>
           </xpatch>
-          <xpatch file="${{build.webapp}}/WEB-INF/cocoon.xconf" srcdir="${{blocks}}" addcomments="true">
-            <include name="@{{name}}/conf/*.xconf"/>
+          <xpatch file="${{build.webapp}}/WEB-INF/cocoon.xconf" srcdir="@{{dir}}" addcomments="true">
+            <include name="conf/*.xconf"/>
           </xpatch>
-          <xpatch file="${{build.webapp}}/WEB-INF/logkit.xconf" srcdir="${{blocks}}">
-            <include name="@{{name}}/conf/*.xlog"/>
+          <xpatch file="${{build.webapp}}/WEB-INF/logkit.xconf" srcdir="@{{dir}}">
+            <include name="conf/*.xlog"/>
           </xpatch>
-          <xpatch file="${{build.webapp}}/WEB-INF/web.xml" srcdir="${{blocks}}">
-            <include name="@{{name}}/conf/*.xweb"/>
+          <xpatch file="${{build.webapp}}/WEB-INF/web.xml" srcdir="@{{dir}}">
+            <include name="conf/*.xweb"/>
           </xpatch>
 
           <!-- generate sitemap entries
           <sitemap-components sitemap="${{build.webapp}}/sitemap.xmap"
-                              source="${{blocks}}/@{{name}}/java"
+                              source="@{{dir}}/java"
                               block="@{{name}}">
             <xsl:if test="@status='unstable'">
               <xsl:attribute name="stable">false</xsl:attribute>
@@ -250,7 +252,7 @@
                don't have own docs!
             <mkdir dir="${{build.context}}/xdocs/userdocs"/>
           <sitemap-components docDir="${{build.context}}/xdocs/userdocs"
-                              source="${{blocks}}/@{{name}}/java"
+                              source="@{{dir}}/java"
                               block="@{{name}}">
             <xsl:if test="@status='unstable'">
               <xsl:attribute name="stable">false</xsl:attribute>
@@ -265,35 +267,38 @@
 
     <macrodef name="block-roles">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
-            <xpatch file="${{build.dest}}/org/apache/cocoon/cocoon.roles" srcdir="${{blocks}}">
-                <include name="@{{name}}/conf/*.xroles"/>
+            <xpatch file="${{build.dest}}/org/apache/cocoon/cocoon.roles" srcdir="@{{dir}}">
+                <include name="conf/*.xroles"/>
             </xpatch>
         </sequential>
     </macrodef>
 
     <macrodef name="block-patch-samples">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
-            <xpatch file="${{build.webapp}}/samples/sitemap.xmap" srcdir="${{blocks}}">
-                <include name="@{{name}}/conf/*.samplesxpipe"/>
+            <xpatch file="${{build.webapp}}/samples/sitemap.xmap" srcdir="@{{dir}}">
+                <include name="conf/*.samplesxpipe"/>
             </xpatch>
-            <xpatch file="${{build.webapp}}/WEB-INF/cocoon.xconf" srcdir="${{blocks}}">
-                <include name="@{{name}}/conf/*.samplesxconf"/>
+            <xpatch file="${{build.webapp}}/WEB-INF/cocoon.xconf" srcdir="@{{dir}}">
+                <include name="conf/*.samplesxconf"/>
             </xpatch>
         </sequential>
     </macrodef>
 
     <macrodef name="block-samples">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
           <!-- Test if this block has samples -->
           <if>
-            <available file="${{blocks}}/@{{name}}/samples/sitemap.xmap"/>
+            <available file="@{{dir}}/samples/sitemap.xmap"/>
             <then>
               <copy filtering="on" todir="${{build.webapp}}/samples/blocks/@{{name}}">
-                <fileset dir="${{blocks}}/@{{name}}/samples"/>
-                <fileset dir="${{blocks}}/@{{name}}/conf" includes="*.xsamples"/>
+                <fileset dir="@{{dir}}/samples"/>
+                <fileset dir="@{{dir}}/conf" includes="*.xsamples"/>
               </copy>
               <!-- copy sample classes -->
               <copy todir="${{build.webapp.classes}}" filtering="off">
@@ -306,17 +311,18 @@
 
     <macrodef name="block-lib">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
           <!-- if this block has a lib directory copy those too (deprecated) -->
           <if>
-            <available type="dir" file="${{blocks}}/@{{name}}/lib"/>
+            <available type="dir" file="@{{dir}}/lib"/>
             <then>
               <echo>
               NOTICE: the preferred method of including library dependencies in your block
               is by putting them in lib/optional and then declaring them in gump.xml.
               </echo>
               <copy filtering="off" todir="${{build.webapp.lib}}">
-                <fileset dir="${{blocks}}/@{{name}}/lib">
+                <fileset dir="@{{dir}}/lib">
                   <include name="*.jar"/>
                   <exclude name="servlet*.jar"/>
                 </fileset>
@@ -325,10 +331,10 @@
           </if>
           <!-- Test if this block has global WEB-INF files -->
           <if>
-            <available type="dir" file="${{blocks}}/@{{name}}/WEB-INF/"/>
+            <available type="dir" file="@{{dir}}/WEB-INF/"/>
             <then>
               <copy filtering="on" todir="${{build.webapp.webinf}}">
-                <fileset dir="${{blocks}}/@{{name}}/WEB-INF/">
+                <fileset dir="@{{dir}}/WEB-INF/">
                   <include name="**"/>
                 </fileset>
               </copy>
@@ -339,15 +345,16 @@
 
     <macrodef name="block-tests">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
           <!-- Test if this block has tests -->
           <if>
-            <available file="${{blocks}}/@{{name}}/test"/>
+            <available file="@{{dir}}/test"/>
             <then>
               <mkdir dir="${{build.blocks}}/@{{name}}/test"/>
 
               <copy todir="${{build.blocks}}/@{{name}}/test" filtering="on">
-                <fileset dir="${{blocks}}/@{{name}}/test" excludes="**/*.java"/>
+                <fileset dir="@{{dir}}/test" excludes="**/*.java"/>
               </copy>
 
               <javac destdir="${{build.blocks}}/@{{name}}/test"
@@ -357,7 +364,7 @@
                      target="${{target.vm}}"
                      nowarn="${{compiler.nowarn}}"
                      compiler="${{compiler}}">
-                <src path="${{blocks}}/@{{name}}/test"/>
+                <src path="@{{dir}}/test"/>
                 <classpath>
                   <path refid="@{{name}}.classpath"/>
                   <path refid="test.classpath"/>
@@ -393,13 +400,14 @@
 
     <macrodef name="block-prepare-anteater-tests">
         <attribute name="name"/>
+        <attribute name="dir"/>
         <sequential>
           <!-- Test if this block has Anteater tests -->
           <if>
-            <available file="${{blocks}}/@{{name}}/test/anteater"/>
+            <available file="@{{dir}}/test/anteater"/>
             <then>
               <copy todir="${{build.test}}/anteater">
-                <fileset dir="${{blocks}}/@{{name}}/test/anteater"/>
+                <fileset dir="@{{dir}}/test/anteater"/>
                 <mapper type="glob" from="*.xml" to="@{{name}}-*.xml"/>
               </copy>
             </then>
@@ -558,7 +566,7 @@
             <srcfiles dir="${{java}}" includes="**/*.java,**/package.html"/>
             <srcfiles dir="${{deprecated.src}}" includes="**/*.java,**/package.html"/>
             <xsl:for-each select="$cocoon-blocks">
-              <srcfiles dir="${{blocks}}/{substring-after(@name,'cocoon-block-')}/java" includes="**/*.java,**/package.html"/>
+              <srcfiles dir="{@dir}/java" includes="**/*.java,**/package.html"/>
             </xsl:for-each>
           </uptodate>
           <istrue value="${{internal.exclude.javadocs}}"/>
@@ -645,7 +653,7 @@
           <include name="**"/>
         </packageset>
         <xsl:for-each select="$cocoon-blocks">
-          <packageset dir="${{blocks}}/{substring-after(@name,'cocoon-block-')}/java">
+          <packageset dir="{@dir}/java">
             <include name="**"/>
           </packageset>
         </xsl:for-each>
@@ -682,7 +690,9 @@
           </xsl:for-each>
         </xsl:if>
       </xsl:attribute>
-      <block-compile name="{$block-name}" package="{translate(package/text(), '.', '/')}"/>
+      <block-compile name="{$block-name}" 
+                     package="{translate(package/text(), '.', '/')}"
+                     dir="{@dir}"/>
     </target>
 
     <target name="{@name}-patch" unless="internal.exclude.block.{$block-name}">
@@ -697,7 +707,7 @@
           </xsl:for-each>
         </xsl:if>
       </xsl:attribute>
-      <block-patch name="{$block-name}"/>
+      <block-patch name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-roles" unless="internal.exclude.block.{$block-name}">
@@ -710,11 +720,11 @@
           </xsl:for-each>
         </xsl:attribute>
       </xsl:if>
-      <block-roles name="{$block-name}"/>
+      <block-roles name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-patch-samples" unless="internal.exclude.block.{$block-name}">
-        <block-patch-samples name="{$block-name}"/>
+        <block-patch-samples name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-samples" unless="internal.exclude.block.{$block-name}">
@@ -727,7 +737,7 @@
           </xsl:for-each>
         </xsl:attribute>
       </xsl:if>
-      <block-samples name="{$block-name}"/>
+      <block-samples name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-lib" unless="internal.exclude.block.{$block-name}">
@@ -751,7 +761,7 @@
           </fileset>
         </copy>
       </xsl:if>
-      <block-lib name="{$block-name}"/>
+      <block-lib name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-prepare" unless="internal.exclude.block.{$block-name}">
@@ -777,7 +787,7 @@
           </fileset>
         </xsl:if>
         <!-- include the block/lib directory (deprecated) -->
-        <fileset dir="${{blocks}}/{$block-name}">
+        <fileset dir="{@dir}">
           <include name="lib/*.jar"/>
         </fileset>
         <pathelement location="${{build.blocks}}/{$block-name}/mocks"/>
@@ -801,11 +811,11 @@
           </xsl:for-each>
         </xsl:if>
       </xsl:attribute>
-      <block-tests name="{$block-name}"/>
+      <block-tests name="{$block-name}" dir="{@dir}"/>
     </target>
 
     <target name="{@name}-prepare-anteater-tests" unless="internal.exclude.block.{$block-name}">
-        <block-prepare-anteater-tests name="{$block-name}"/>
+        <block-prepare-anteater-tests name="{$block-name}" dir="{@dir}"/>
     </target>
   </xsl:template>
 </xsl:stylesheet>