cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-cocoon2/tools/src blocks-build.xsl
Date Mon, 16 Sep 2002 15:34:36 GMT
nicolaken    2002/09/16 08:34:36

  Modified:    tools/src blocks-build.xsl
  Log:
    <action dev="NKB" type="add">
     Added initial support for compilation of Cocoon blocks, and migrated
     Fop and Batik classes and configuration to the src/blocks dir.
     Blocks that need Avalon components not yet supported.
    </action>
  
  Revision  Changes    Path
  1.2       +150 -93   xml-cocoon2/tools/src/blocks-build.xsl
  
  Index: blocks-build.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/tools/src/blocks-build.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- blocks-build.xsl	28 Aug 2002 17:46:56 -0000	1.1
  +++ blocks-build.xsl	16 Sep 2002 15:34:36 -0000	1.2
  @@ -11,109 +11,166 @@
      </xsl:template>
   
      <xsl:template match="module">
  +      <target name="cocoon-core">
  +         <ant antfile="build.xml" target="package" />
  +      </target>
  +
  +      <target name="all">
  +         <xsl:attribute name="depends">cocoon-core
  +         <xsl:for-each select="project">,
  +         <xsl:value-of select="@name" />
  +         </xsl:for-each>
  +         </xsl:attribute>
  +      </target>
  +
  +      <target name="-single-project">
  +         <path id="currentblock.classpath">
  +            <fileset>
  +               <xsl:attribute name="dir">${lib.dir}</xsl:attribute>
  +
  +               <include name="**/*.jar" />
  +            </fileset>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${build.dir}</xsl:attribute>
  +
  +               <include>
  +                  <xsl:attribute name="name">${name}*.jar</xsl:attribute>
  +               </include>
  +            </fileset>
  +         </path>
  +
  +         <property name="currentblock.dir">
  +            <xsl:attribute name="value">${blocks.dir}/${currentblock.name}</xsl:attribute>
  +         </property>
  +
  +         <property name="currentblock.java.dir">
  +            <xsl:attribute name="value">${currentblock.dir}/java</xsl:attribute>
  +         </property>
  +
  +         <property name="currentblock.conf.dir">
  +            <xsl:attribute name="value">${currentblock.dir}/conf</xsl:attribute>
  +         </property>
  +
  +         <property name="build.currentblock.dir">
  +            <xsl:attribute name="value">${build.blocks.root}/${currentblock.name}</xsl:attribute>
  +         </property>
  +
  +         <property name="build.currentblock.src">
  +            <xsl:attribute name="value">${build.currentblock.dir}/src</xsl:attribute>
  +         </property>
  +
  +         <property name="build.currentblock.dest">
  +            <xsl:attribute name="value">${build.currentblock.dir}/dest</xsl:attribute>
  +         </property>
  +
  +         <mkdir>
  +            <xsl:attribute name="dir">${build.currentblock.src}</xsl:attribute>
  +         </mkdir>
  +
  +         <mkdir>
  +            <xsl:attribute name="dir">${build.currentblock.dest}</xsl:attribute>
  +         </mkdir>
  +
  +         <copy filtering="on">
  +            <xsl:attribute name="todir">${build.currentblock.src}</xsl:attribute>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${currentblock.java.dir}</xsl:attribute>
  +
  +               <include name="**/*.java" />
  +            </fileset>
  +         </copy>
  +
  +         <copy filtering="off">
  +            <xsl:attribute name="todir">${build.currentblock.dest}</xsl:attribute>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${currentblock.java.dir}</xsl:attribute>
  +
  +               <include name="**/Manifest.mf" />
   
  -     <target name="cocoon-core">
  -        <ant antfile="build.xml" target="package"/>
  -     </target>
  -      
  -     <target name="all">
  -       <xsl:attribute name="depends">cocoon-core<xsl:for-each select = "project">,<xsl:value-of
select="@name" /></xsl:for-each></xsl:attribute>   
  -     </target>
  -     
  -     <xsl:apply-templates select="project" />
  +               <include name="META-INF/**" />
  +            </fileset>
  +         </copy>
   
  +         <copy filtering="off">
  +            <xsl:attribute name="todir">${build.currentblock.dest}</xsl:attribute>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${currentblock.conf.dir}</xsl:attribute>
  +
  +               <include name="**/*.x*" />
  +            </fileset>
  +         </copy>
  +
  +         <copy filtering="off">
  +            <xsl:attribute name="todir">${build.blocks.root}</xsl:attribute>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${currentblock.conf.dir}</xsl:attribute>
  +
  +               <include name="**/*.x*" />
  +            </fileset>
  +         </copy>
  +
  +<!-- A task to change the roles file. It is used to add optional components -->
  +         <taskdef name="roles-tool" classname="XConfToolTask">
  +            <xsl:attribute name="classpath">${tools.dir}/anttasks</xsl:attribute>
  +         </taskdef>
  +
  +<!-- Invoke the XConfTool to add optional roles for components -->
  +         <roles-tool extension="xroles">
  +            <xsl:attribute name="directory">${currentblock.conf.dir}</xsl:attribute>
  +
  +            <xsl:attribute name="configuration">${build.dest}/org/apache/cocoon/cocoon.roles</xsl:attribute>
  +         </roles-tool>
  +
  +         <echo message="Compiling block..." />
  +
  +         <javac>
  +            <xsl:attribute name="srcdir">${build.currentblock.src}</xsl:attribute>
  +
  +            <xsl:attribute name="destdir">${build.currentblock.dest}</xsl:attribute>
  +
  +            <classpath refid="currentblock.classpath" />
  +         </javac>
  +
  +         <jar>
  +            <xsl:attribute name="jarfile">${build.dir}/${currentblock.name}-block.jar</xsl:attribute>
  +
  +            <fileset>
  +               <xsl:attribute name="dir">${build.currentblock.dest}</xsl:attribute>
  +
  +               <include name="org/**" />
  +
  +               <include name="META-INF/**" />
  +            </fileset>
  +         </jar>
  +      </target>
  +
  +      <xsl:apply-templates select="project" />
      </xsl:template>
   
      <xsl:template match="project">
  -   
         <xsl:variable name="current-project-target" select="@name" />
  -      <xsl:variable name="block-name" select="substring-before(@name,'-block')"/>
  -       
  -      <target name="{$current-project-target}" if="cocoon.blocks.{$block-name}.include"
>
  -      
  -        <!-- if there is a dependency... -->
  +
  +      <xsl:variable name="block-name" select="substring-before(@name,'-block')" />
  +
  +      <target name="{$current-project-target}" if="cocoon.blocks.{$block-name}.include">
  +<!-- if there is a dependency... -->
            <xsl:if test="depend">
  -            <xsl:attribute name="depends">cocoon-core<xsl:for-each select="depend[not(@version)]">,<xsl:value-of
select="@project" /></xsl:for-each></xsl:attribute>
  +            <xsl:attribute name="depends">cocoon-core
  +            <xsl:for-each select="depend[not(@version)]">,
  +            <xsl:value-of select="@project" />
  +            </xsl:for-each>
  +            </xsl:attribute>
            </xsl:if>
   
  -    <path id="currentblock.classpath">
  -      <fileset><xsl:attribute name="dir">${lib.dir}</xsl:attribute>
  -        <include name="**/*.jar"/>
  -      </fileset>
  -      <fileset><xsl:attribute name="dir">${build.dir}</xsl:attribute>
     
  -        <include><xsl:attribute name="name">${name}*.jar</xsl:attribute></include>
  -      </fileset>
  -    </path>
  -
  -    <property name="currentblock.dir"><xsl:attribute name="value">${blocks.dir}/<xsl:value-of
select="$block-name" /></xsl:attribute></property>  
  -    <property name="currentblock.java.dir"><xsl:attribute name="value">${currentblock.dir}/java</xsl:attribute></property>
  -    <property name="currentblock.conf.dir"><xsl:attribute name="value">${currentblock.dir}/conf</xsl:attribute></property>
  -        
  -    <property name="build.currentblock.dir"><xsl:attribute name="value">${build.blocks.root}/<xsl:value-of
select="$block-name" /></xsl:attribute></property>
  -    <property name="build.currentblock.src"><xsl:attribute name="value">${build.currentblock.dir}/src</xsl:attribute></property>
  -    <property name="build.currentblock.dest"><xsl:attribute name="value">${build.currentblock.dir}/dest</xsl:attribute></property>
  -   
  -    <mkdir><xsl:attribute name="dir">${build.currentblock.src}</xsl:attribute></mkdir>
  -    <mkdir><xsl:attribute name="dir">${build.currentblock.dest}</xsl:attribute></mkdir>
  -        
  -    <copy filtering="on"><xsl:attribute name="todir">${build.currentblock.src}</xsl:attribute>
  -      <fileset><xsl:attribute name="dir">${currentblock.java.dir}</xsl:attribute>
  -        <include name="**/*.java"/>      
  -      </fileset>
  -    </copy>
  -
  -   <copy filtering="off"><xsl:attribute name="todir">${build.currentblock.dest}</xsl:attribute>
  -      <fileset><xsl:attribute name="dir">${currentblock.java.dir}</xsl:attribute>
  -        <include name="**/Manifest.mf"/>
  -        <include name="META-INF/**"/>
  -      </fileset>
  -    </copy>
  -
  -   <copy filtering="off"><xsl:attribute name="todir">${build.currentblock.dest}</xsl:attribute>
  -      <fileset><xsl:attribute name="dir">${currentblock.conf.dir}</xsl:attribute>
  -        <include name="**/*.x*"/>
  -      </fileset>
  -    </copy>
  -
  -   <copy filtering="off"><xsl:attribute name="todir">${build.blocks.root}</xsl:attribute>
  -      <fileset><xsl:attribute name="dir">${currentblock.conf.dir}</xsl:attribute>
  -        <include name="**/*.x*"/>
  -      </fileset>
  -    </copy>    
  -    
  -    <!-- A task to change the roles file. It is used to add optional components -->
  -    <taskdef name="roles-tool" classname="XConfToolTask"><xsl:attribute name="classpath">${tools.dir}/anttasks</xsl:attribute></taskdef>
  -    <!-- Invoke the XConfTool to add optional roles for components -->
  -    
  -    <roles-tool extension="xroles">
  -        <xsl:attribute name="directory">${currentblock.conf.dir}</xsl:attribute>
  -        <xsl:attribute name="configuration">${build.dest}/org/apache/cocoon/cocoon.roles</xsl:attribute>
              
  -    </roles-tool>            
  -                
  -    
  -    
  -    <echo message="Compiling block..."/>
  -
  -    <javac>
  -       <xsl:attribute name="srcdir">${build.currentblock.src}</xsl:attribute>
  -       <xsl:attribute name="destdir">${build.currentblock.dest}</xsl:attribute>
  -      <classpath refid="currentblock.classpath"/>
  -    </javac>
  -
  -
  -    <jar>
  -      <xsl:attribute name="jarfile">${build.dir}/<xsl:value-of select="$block-name"
/>-block.jar</xsl:attribute>
  -      <fileset>
  -        <xsl:attribute name="dir">${build.currentblock.dest}</xsl:attribute>
  -        <include name="org/**"/>
  -        <include name="META-INF/**"/>
  -      </fileset>
  -    </jar>
  -         
  -    
  -               
  +         <antcall target="-single-project">
  +            <param name="currentblock.name" value="{$block-name}" />
  +         </antcall>
         </target>
      </xsl:template>
   </xsl:stylesheet>
  -
   
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message