ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/tools/xsl build.xsl
Date Thu, 16 May 2002 01:28:29 GMT
adammurdoch    02/05/15 18:28:29

  Modified:    aut      project.xml
               site/docs project-descriptor.html todo.html
               site/src/xdocs project-descriptor.xml todo.xml
               tools/xsl build.xsl
  Log:
  Added top-level <additional-build> element to project descriptor,
  which allows Jars to be built but not included in the project
  output (test Jars, for example).
  
  Revision  Changes    Path
  1.9       +8 -8      jakarta-ant-myrmidon/aut/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/project.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.xml	10 May 2002 06:27:31 -0000	1.8
  +++ project.xml	16 May 2002 01:28:28 -0000	1.9
  @@ -16,17 +16,17 @@
           <fileset dir="../lib" includes="*.jar"/>
       </classpath>
   
  +    <!-- Patterns for including/excluding source files from the project -->
  +    <compilePatterns>
  +        <exclude name="org/apache/aut/vfs/provider/smb/**/*.java"
  +                 unless="jcifs.present" />
  +        <exclude name="org/apache/aut/vfs/provider/ftp/**/*.java"
  +                 unless="netcomp.present" />
  +    </compilePatterns>
  +
       <!-- Build details -->
       <build>
           <sourceDirectory>src/java</sourceDirectory>
  -
  -        <!-- Patterns for including/excluding source files from the project -->
  -        <compilePatterns>
  -            <exclude name="org/apache/aut/vfs/provider/smb/**/*.java"
  -                     unless="jcifs.present" />
  -            <exclude name="org/apache/aut/vfs/provider/ftp/**/*.java"
  -                     unless="netcomp.present" />
  -        </compilePatterns>
   
           <!-- The jar to build -->
           <jar>
  
  
  
  1.3       +87 -38    jakarta-ant-myrmidon/site/docs/project-descriptor.html
  
  Index: project-descriptor.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/project-descriptor.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project-descriptor.html	9 May 2002 07:39:57 -0000	1.2
  +++ project-descriptor.html	16 May 2002 01:28:28 -0000	1.3
  @@ -59,7 +59,7 @@
             <li>      <a href="./task.html">My First Task</a>
     </li>
           </ul>
  -      <p><strong>Extending Ant</strong></p>
  +      <p><strong>Extending Myrmidon</strong></p>
       <ul>
             <li>      <a href="./configuring.html">Configuration HOWTO</a>
     </li>
  @@ -124,6 +124,29 @@
                     <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          <a href="#build">additional-build</a>
  +        </font>
  +  </td>
  +                      <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          The details of how to compile and assemble the project's
  +                additional Jars.  These are Jar files that are assembled as
  +                part of the build, but not included as part of the project
  +                output.  For example, test Jar files.
  +        </font>
  +  </td>
  +                      <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          yes
  +        </font>
  +  </td>
  +      </tr>
  +                  <tr>
  +                  <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
             <a href="#build">build</a>
           </font>
     </td>
  @@ -152,8 +175,30 @@
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
             The project classpath, used for compiling the project
  -                source, and unit tests.  This is an Ant <code>&lt;path&gt;</code>
  -                data-type.
  +                Jars, unit tests, and additional Jars.  This is an Ant
  +                <code>&lt;path&gt;</code> data-type.
  +        </font>
  +  </td>
  +                      <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          no
  +        </font>
  +  </td>
  +      </tr>
  +                  <tr>
  +                  <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          compilePatterns
  +        </font>
  +  </td>
  +                      <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  +      valign="top" align="left">
  +    <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  +          The include and exclude patterns to use when compiling the
  +                project Jars, unit tests, and additional Jars.  This is an
  +                Ant <code>&lt;patternset&gt;</code> data-type.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -340,9 +385,13 @@
       </td></tr>
       <tr><td>
         <blockquote>
  -                        <p>The <code>&lt;build&gt;</code> element
describes how to compile the
  -            project and assemble it into Jar files.  The <code>&lt;build&gt;</code>
  -            element may contain the following nested elements:</p>
  +                        <p>The <code>&lt;build&gt;</code> and
<code>&lt;additional-build&gt;</code>
  +            elements describes how to compile and assemble a set of Jar files.
  +            The <code>&lt;build&gt;</code> element describes the Jar
files
  +            included as part of the project's output.  The
  +            <code>&lt;additional-build&gt;</code> describes Jar files
that are
  +            not included in the project's output, such as test files.
  +            These elements may contain the following nested elements:</p>
                                     <table>
                 <tr>
                     <td bgcolor="#039acc" colspan="" rowspan="" 
  @@ -368,19 +417,24 @@
                     <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          <a href="#jar">antlib</a>
  +          classpath
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          Defines an antlib output file.
  +          The classpath to use for compiling the Jars.
  +                    This is appended to the project classpath.  This is
  +                    an Ant <code>&lt;path&gt;</code> data-type.  Note
that
  +                    the Ant runtime is not included in the compile classpath.
  +                    To include the Ant runtime, add an empty <code>&lt;ant-runtime&gt;</code>
  +                    element to this <code>&lt;classpath&gt;</code>
element.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          yes
  +          no
           </font>
     </td>
         </tr>
  @@ -388,24 +442,21 @@
                     <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          classpath
  +          compilePatterns
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          The classpath to use for compiling the project source.
  -                    This is appended to the project classpath.  This is
  -                    an Ant <code>&lt;path&gt;</code> data-type.  Note
that
  -                    the Ant runtime is not included in the compile classpath.
  -                    To include the Ant runtime, add an empty <code>&lt;ant-runtime&gt;</code>
  -                    element to the <code>&lt;classpath&gt;</code> element.
  +          The patternset to use when compiling the project source.
  +                    This is an Ant <code>&lt;patternset&gt;</code>.
 These are
  +                    added to the project compile patterns.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          no
  +          yes
           </font>
     </td>
         </tr>
  @@ -413,14 +464,13 @@
                     <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          compilePatterns
  +          <a href="#jar">jar</a>
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          The patternset to use when compiling the project source.
  -                    This is an Ant <code>&lt;patternset&gt;</code>.
  +          Defines a Jar output file.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -434,19 +484,20 @@
                     <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          <a href="#jar">jar</a>
  +          lib-path
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          Defines a Jar output file.
  +          Defines the directory to place the assembled Jar files
  +                    (<code>&lt;additional-build&gt;</code> only).
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          yes
  +          no
           </font>
     </td>
         </tr>
  @@ -462,7 +513,8 @@
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
             Additional Ant tasks to perform before compiling
                       the source.  This can be used, for example, to check for
  -                    the availability of various libraries.
  +                    the availability of various libraries (<code>&lt;build&gt;</code>
  +                    only).
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -667,12 +719,9 @@
       </td></tr>
       <tr><td>
         <blockquote>
  -                        <p>The <code>&lt;antlib&gt;</code> and
<code>&lt;jar&gt;</code> elements
  -            define antlib and jar output files, respectively.  There is no
  -            difference between these elements, except the output file name.
  -            A manifest and antlib descriptors are generated for the output file.
  -            The <code>&lt;antlib&gt;</code> and <code>&lt;jar&gt;</code>
elements
  -            may take the following nested elements:</p>
  +                        <p>A <code>&lt;jar&gt;</code> element
defines a jar file produced by
  +            the build.  A manifest and antlib descriptors are generated for the Jar.
  +            A <code>&lt;jar&gt;</code> element may take the following
nested elements:</p>
                                     <table>
                 <tr>
                     <td bgcolor="#039acc" colspan="" rowspan="" 
  @@ -766,7 +815,7 @@
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          Additional files to include in the output file.  This
  +          Additional files to include in the Jar.  This
                       is an Ant <code>&lt;fileset&gt;</code> datatype.
           </font>
     </td>
  @@ -787,8 +836,8 @@
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          A unique short name for the output file.  This is used
  -                    in the output file name, and the names of generated files.
  +          A unique short name for the Jar.  This is used
  +                    in the file name, and the names of generated files.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -809,7 +858,7 @@
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
             Controls whether antlib descriptors are generated for
  -                    the output file.  Descriptors are generated by default.
  +                    the Jar.  Descriptors are generated by default.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -829,7 +878,7 @@
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          See the <code>&lt;jar&gt;</code> Ant task.
  +          See the Ant <code>&lt;jar&gt;</code> task.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -849,8 +898,8 @@
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          Specifies the name of the output file.  By default, the
  -                    name is generated from the id and current version.
  +          Specifies the name of the Jar.  By default, the
  +                    name is generated from the Jar Id and current project version.
           </font>
     </td>
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
  @@ -870,7 +919,7 @@
                         <td bgcolor="#a0ddf0" colspan="" rowspan="" 
         valign="top" align="left">
       <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  -          Specifies which classes to include in the output file.
  +          Specifies which classes to include in the Jar.
                       This is an Ant <code>&lt;patternset&gt;</code>.
           </font>
     </td>
  
  
  
  1.5       +2 -1      jakarta-ant-myrmidon/site/docs/todo.html
  
  Index: todo.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/docs/todo.html,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- todo.html	9 May 2002 07:39:57 -0000	1.4
  +++ todo.html	16 May 2002 01:28:28 -0000	1.5
  @@ -61,7 +61,7 @@
             <li>      <a href="./task.html">My First Task</a>
     </li>
           </ul>
  -      <p><strong>Extending Ant</strong></p>
  +      <p><strong>Extending Myrmidon</strong></p>
       <ul>
             <li>      <a href="./configuring.html">Configuration HOWTO</a>
     </li>
  @@ -574,6 +574,7 @@
                           <p>The Ant 1 Compatibility layer is still in early stages
of development.
                   </p>
                                   <ul>
  +                    <li>Update ant.jar and optional.jar to ant1.5 beta.</li>
                       <li>Get a version of <code>&lt;antcall&gt;</code>
working.</li>
                       <li>
                       Provide hooks between Ant 1 references and Myrmidon properties.
  
  
  
  1.4       +44 -13    jakarta-ant-myrmidon/site/src/xdocs/project-descriptor.xml
  
  Index: project-descriptor.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/src/xdocs/project-descriptor.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- project-descriptor.xml	10 May 2002 06:27:32 -0000	1.3
  +++ project-descriptor.xml	16 May 2002 01:28:28 -0000	1.4
  @@ -24,6 +24,15 @@
               <tr><th>Element</th><th>Description</th><th>Multivalued</th></tr>
   
               <tr>
  +                <td><a href="#build">additional-build</a></td>
  +                <td>The details of how to compile and assemble the project's
  +                additional Jars.  These are Jar files that are assembled as
  +                part of the build, but not included as part of the project
  +                output.  For example, test Jar files.</td>
  +                <td>yes</td>
  +            </tr>
  +
  +            <tr>
                   <td><a href="#build">build</a></td>
                   <td>The details of how to compile the project and assemble it
                   into jar files.</td>
  @@ -33,8 +42,16 @@
               <tr>
                   <td>classpath</td>
                   <td>The project classpath, used for compiling the project
  -                source, and unit tests.  This is an Ant <code>&lt;path&gt;</code>
  -                data-type.</td>
  +                Jars, unit tests, and additional Jars.  This is an Ant
  +                <code>&lt;path&gt;</code> data-type.</td>
  +                <td>no</td>
  +            </tr>
  +
  +            <tr>
  +                <td>compilePatterns</td>
  +                <td>The include and exclude patterns to use when compiling the
  +                project Jars, unit tests, and additional Jars.  This is an
  +                Ant <code>&lt;patternset&gt;</code> data-type.</td>
                   <td>no</td>
               </tr>
   
  @@ -97,28 +114,34 @@
           </table>
   
           <subsection name="Build Definition" anchor="build">
  -            <p>The <code>&lt;build&gt;</code> element describes
how to compile the
  -            project and assemble it into Jar files.  The <code>&lt;build&gt;</code>
  -            element may contain the following nested elements:</p>
  +            <p>The <code>&lt;build&gt;</code> and <code>&lt;additional-build&gt;</code>
  +            elements describes how to compile and assemble a set of Jar files.
  +            The <code>&lt;build&gt;</code> element describes the Jar
files
  +            included as part of the project's output.  The
  +            <code>&lt;additional-build&gt;</code> describes Jar files
that are
  +            not included in the project's output, such as test files.
  +            These elements may contain the following nested elements:</p>
   
               <table>
                   <tr><th>Element</th><th>Description</th><th>Multivalued</th></tr>
   
                   <tr>
                       <td>classpath</td>
  -                    <td>The classpath to use for compiling the project source.
  -                    This is appended to the project classpath.  This is
  -                    an Ant <code>&lt;path&gt;</code> data-type.  Note
that
  -                    the Ant runtime is not included in the compile classpath.
  -                    To include the Ant runtime, add an empty <code>&lt;ant-runtime&gt;</code>
  -                    element to the <code>&lt;classpath&gt;</code> element.</td>
  +                    <td>The classpath to use for compiling the Jars. This is
  +                    an Ant <code>&lt;path&gt;</code> data-type.  This
classpath
  +                    is appended to the project classpath.  Note that the Ant
  +                    runtime is not included in the compile classpath.  To
  +                    include the Ant runtime, add an empty
  +                    <code>&lt;ant-runtime&gt;</code> element to this
  +                    <code>&lt;classpath&gt;</code> element.</td>
                       <td>no</td>
                   </tr>
   
                   <tr>
                       <td>compilePatterns</td>
                       <td>The patternset to use when compiling the project source.
  -                    This is an Ant <code>&lt;patternset&gt;</code>.</td>
  +                    This is an Ant <code>&lt;patternset&gt;</code>
data-type.
  +                    This patternset is added to the project compile patternset.</td>
                       <td>yes</td>
                   </tr>
   
  @@ -129,10 +152,18 @@
                   </tr>
   
                   <tr>
  +                    <td>lib-path</td>
  +                    <td>Defines the directory to place the assembled Jar files
  +                    (<code>&lt;additional-build&gt;</code> only).</td>
  +                    <td>no</td>
  +                </tr>
  +
  +                <tr>
                       <td>prepare</td>
                       <td>Additional Ant tasks to perform before compiling
                       the source.  This can be used, for example, to check for
  -                    the availability of various libraries.</td>
  +                    the availability of various libraries (<code>&lt;build&gt;</code>
  +                    only).</td>
                       <td>no</td>
                   </tr>
   
  
  
  
  1.3       +1 -0      jakarta-ant-myrmidon/site/src/xdocs/todo.xml
  
  Index: todo.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/src/xdocs/todo.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- todo.xml	9 May 2002 07:39:23 -0000	1.2
  +++ todo.xml	16 May 2002 01:28:28 -0000	1.3
  @@ -290,6 +290,7 @@
                   <p>The Ant 1 Compatibility layer is still in early stages of development.
                   </p>
                   <ul>
  +                    <li>Update ant.jar and optional.jar to ant1.5 beta.</li>
                       <li>Get a version of <code>&lt;antcall&gt;</code>
working.</li>
                       <li>
                       Provide hooks between Ant 1 references and Myrmidon properties.
  
  
  
  1.18      +111 -75   jakarta-ant-myrmidon/tools/xsl/build.xsl
  
  Index: build.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/tools/xsl/build.xsl,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- build.xsl	15 May 2002 10:11:55 -0000	1.17
  +++ build.xsl	16 May 2002 01:28:28 -0000	1.18
  @@ -58,12 +58,9 @@
               <path id="project.class.path">
                   <xsl:copy-of select="classpath/*|classpath/@*"/>
               </path>
  -            <path id="compile.class.path">
  -                <path refid="project.class.path"/>
  -                <path>
  -                    <xsl:copy-of select="build/classpath/*[name() != 'ant-runtime']|build/classpath/@*"/>
  -                </path>
  -            </path>
  +            <patternset id="project.compile.patternset">
  +                <xsl:copy-of select="compilePatterns/*|compilePatterns/@*"/>
  +            </patternset>
               <path id="test.class.path">
                   <path refid="project.class.path"/>
                   <path>
  @@ -73,16 +70,6 @@
               <path id="xdoclet.class.path">
                   <fileset dir="${{tools.dir}}/xdoclet" includes="*.jar"/>
               </path>
  -            <path id="project.source.path">
  -                <xsl:for-each select="build/sourceDirectory">
  -                    <pathelement location="{.}"/>
  -                </xsl:for-each>
  -            </path>
  -            <patternset id="project.compile.patternset">
  -                <xsl:for-each select="build/compilePatterns">
  -                    <xsl:copy-of select="*|@*"/>
  -                </xsl:for-each>
  -            </patternset>
   
               <!-- General purpose targets -->
   
  @@ -120,8 +107,9 @@
                   <available property="jdk1.3+" classname="java.lang.StrictMath" />
                   <available property="jdk1.4+" classname="java.lang.CharSequence" />
   
  -                <!-- taskdef the antlib descriptor task, necessary -->
  -                <xsl:if test="build/jar[not(includeDescriptors = 'false')]|unitTest[not(includeDescriptors='false')]"
>
  +                <!-- taskdef the antlib descriptor task, necessary
  +                     TODO - get rid of the hard-code project name below. -->
  +                <xsl:if test="not(id = 'myrmidon-buildtools')" >
                       <taskdef name="antlib-descriptor"
                           classname="org.apache.myrmidon.build.AntlibDescriptorTask">
                           <classpath>
  @@ -135,37 +123,34 @@
                   <xsl:copy-of select="build/prepare/*"/>
               </target>
   
  -            <target name="compile-src" depends="prepare">
  -                <xsl:if test="build/sourceDirectory">
  -                    <mkdir dir="${{build.classes}}"/>
  -
  -                    <!-- Compile all classes -->
  -                    <javac
  -                        destdir="${{build.classes}}"
  -                        debug="${{build.debug}}"
  -                        optimize="${{build.optimize}}"
  -                        deprecation="${{build.deprecation}}"
  -                        target="1.2">
  -                        <xsl:if test="not(build/classpath/ant-runtime)">
  -                            <xsl:attribute name="includeAntRuntime">false</xsl:attribute>
  -                        </xsl:if>
  -                        <classpath refid="compile.class.path"/>
  -                        <src refid="project.source.path"/>
  -                        <patternset refid="project.compile.patternset"/>
  -                    </javac>
  -
  -                    <!-- copy resources to same location as .class files -->
  -                    <copy todir="${{build.classes}}">
  -                        <xsl:for-each select="build/sourceDirectory">
  -                            <fileset dir="{.}">
  -                                <exclude name="**/*.java"/>
  -                            </fileset>
  -                        </xsl:for-each>
  -                    </copy>
  +            <target name="compile" description="Compiles the project source">
  +                <xsl:attribute name="depends">
  +                    <xsl:text>main-compile</xsl:text>
  +                    <xsl:for-each select="additional-build">, <xsl:value-of select="concat('build',
position(), '-compile')"/></xsl:for-each>
  +                    <xsl:text>, compile-tests</xsl:text>
  +                </xsl:attribute>
  +            </target>
   
  -                </xsl:if>
  +            <target name="jars" depends="compile, main-jars" description="Builds the
project jar files">
  +                <xsl:attribute name="depends">
  +                    <xsl:text>compile, main-jars</xsl:text>
  +                    <xsl:for-each select="additional-build">, <xsl:value-of select="concat('build',
position(), '-jars')"/></xsl:for-each>
  +                </xsl:attribute>
               </target>
   
  +            <!-- Compile and Jar the project source -->
  +            <xsl:apply-templates select="build">
  +                <xsl:with-param name="build-id">main</xsl:with-param>
  +                <xsl:with-param name="build-classes">${build.classes}</xsl:with-param>
  +                <xsl:with-param name="build-lib">${build.lib}</xsl:with-param>
  +            </xsl:apply-templates>
  +
  +            <!-- Compile additional source -->
  +            <xsl:apply-templates select="additional-build">
  +                <xsl:with-param name="build-id" select="concat('build', position())"/>
  +                <xsl:with-param name="build-classes" select="concat('${build.dir}/build',
position(), '/classes')"/>
  +            </xsl:apply-templates>
  +
               <xsl:choose>
                   <xsl:when test="unitTest">
                       <patternset id="project.test.patternset">
  @@ -175,13 +160,11 @@
                           </xsl:for-each>
                       </patternset>
   
  -                    <target name="compile" depends="compile-src, compile-tests"/>
  -
                       <target name="fail-no-junit" unless="junit.present">
                           <fail>Could not find JUnit in the project classpath.  Cannot
compile the unit tests.</fail>
                       </target>
   
  -                    <target name="compile-tests" depends="compile-src, fail-no-junit"
if="junit.present">
  +                    <target name="compile-tests" depends="main-compile, fail-no-junit"
if="junit.present">
                           <mkdir dir="${{test.classes}}"/>
   
                           <!-- Compile all classes -->
  @@ -264,40 +247,22 @@
                   </xsl:when>
   
                   <xsl:otherwise>
  -                    <target name="compile" depends="compile-src"/>
  +                    <target name="compile-tests"/>
                       <target name="test" depends="jars">
                           <echo>This project has no unit tests.</echo>
                       </target>
                   </xsl:otherwise>
               </xsl:choose>
   
  -            <target name="jars-prepare" depends="compile">
  -                <mkdir dir="${{build.lib}}"/>
  -            </target>
  -
  -            <!-- Generate the depends list for "jars".
  -                 This is a list of dependent targets, one for each antlib -->
  -            <xsl:variable name="jars-depends">
  -                <xsl:for-each select="build/jar">
  -                    <xsl:text>, jar-</xsl:text>
  -                    <xsl:value-of select="id"/>
  -                </xsl:for-each>
  -            </xsl:variable>
  -
  -            <target name="jars" depends="jars-prepare{$jars-depends}" description="Builds
the project jar files"/>
  -
  -            <!-- Generate the dependent targets for "jars", one for each antlib -->
  -            <xsl:apply-templates select="build/jar"/>
  -
               <target name="javadocs" description="Generates the javadocs">
                   <xsl:if test="build/sourceDirectory">
                       <mkdir dir="${{dist.javadocs}}"/>
                       <javadoc
                           destdir="${{dist.javadocs}}">
  -                        <classpath refid="compile.class.path" />
  +                        <classpath refid="main.class.path" />
                           <xsl:for-each select="build/sourceDirectory">
                               <packageset dir="{.}">
  -                                <patternset refid="project.compile.patternset"/>
  +                                <patternset refid="main.compile.patternset"/>
                               </packageset>
                           </xsl:for-each>
                           <doclet name="com.sun.tools.doclets.standard.Standard">
  @@ -370,7 +335,77 @@
           </project>
       </xsl:template>
   
  +    <xsl:template match="build|additional-build">
  +        <xsl:param name="build-id"/>
  +        <xsl:param name="build-classes"/>
  +        <xsl:param name="build-lib" select="lib-dir"/>
  +
  +        <path id="{$build-id}.class.path">
  +            <path refid="project.class.path"/>
  +            <path>
  +                <xsl:copy-of select="classpath/*[name() != 'ant-runtime']|classpath/@*"/>
  +            </path>
  +        </path>
  +        <path id="{$build-id}.source.path">
  +            <xsl:for-each select="sourceDirectory">
  +                <pathelement location="{.}"/>
  +            </xsl:for-each>
  +        </path>
  +        <patternset id="{$build-id}.compile.patternset">
  +            <patternset refid="project.compile.patternset"/>
  +            <xsl:for-each select="compilePatterns">
  +                <xsl:copy-of select="*|@*"/>
  +            </xsl:for-each>
  +        </patternset>
  +
  +        <target name="{$build-id}-compile" depends="prepare">
  +            <xsl:if test="sourceDirectory">
  +                <mkdir dir="{$build-classes}"/>
  +
  +                <!-- Compile all classes -->
  +                <javac
  +                    destdir="{$build-classes}"
  +                    debug="${{build.debug}}"
  +                    optimize="${{build.optimize}}"
  +                    deprecation="${{build.deprecation}}"
  +                    target="1.2">
  +                    <xsl:if test="not(classpath/ant-runtime)">
  +                        <xsl:attribute name="includeAntRuntime">false</xsl:attribute>
  +                    </xsl:if>
  +                    <classpath refid="{$build-id}.class.path"/>
  +                    <src refid="{$build-id}.source.path"/>
  +                    <patternset refid="{$build-id}.compile.patternset"/>
  +                </javac>
  +
  +                <!-- copy resources to same location as .class files -->
  +                <copy todir="{$build-classes}">
  +                    <xsl:for-each select="sourceDirectory">
  +                        <fileset dir="{.}">
  +                            <exclude name="**/*.java"/>
  +                        </fileset>
  +                    </xsl:for-each>
  +                </copy>
  +            </xsl:if>
  +        </target>
  +
  +        <target name="{$build-id}-jars">
  +            <xsl:attribute name="depends">
  +                <xsl:value-of select="concat($build-id, '-compile')"/>
  +                <xsl:for-each select="jar">, jar-<xsl:value-of select="id"/></xsl:for-each>
  +            </xsl:attribute>
  +        </target>
  +
  +        <xsl:apply-templates select="jar">
  +            <xsl:with-param name="build-id" select="$build-id"/>
  +            <xsl:with-param name="build-classes" select="$build-classes"/>
  +            <xsl:with-param name="build-lib" select="$build-lib"/>
  +        </xsl:apply-templates>
  +    </xsl:template>
  +
       <xsl:template match="jar">
  +        <xsl:param name="build-id"/>
  +        <xsl:param name="build-lib"/>
  +        <xsl:param name="build-classes"/>
           <xsl:variable name="patterns" select="patternset"/>
   
           <target name="jar-{id}-test-omit" if="xdoclet.omit">
  @@ -382,7 +417,7 @@
                         property="{id}-xdoclet.omit">
                   <xsl:for-each select="../sourceDirectory">
                       <srcfiles dir="{.}">
  -                        <patternset refid="project.compile.patternset"/>
  +                        <patternset refid="{$build-id}.compile.patternset"/>
                           <xsl:copy-of select="$patterns"/>
                       </srcfiles>
                   </xsl:for-each>
  @@ -400,12 +435,12 @@
                       rolesDescriptorName="ant-roles.xml">
                       <xsl:for-each select="../sourceDirectory">
                           <fileset dir="{.}">
  -                            <patternset refid="project.compile.patternset"/>
  +                            <patternset refid="{$build-id}.compile.patternset"/>
                               <xsl:copy-of select="$patterns"/>
                           </fileset>
                       </xsl:for-each>
                       <classpath refid="xdoclet.class.path"/>
  -                    <classpath refid="compile.class.path"/>
  +                    <classpath refid="{$build-id}.class.path"/>
                       <classpath path="${{java.class.path}}"/>
                   </antlib-descriptor>
               </xsl:if>
  @@ -414,6 +449,7 @@
           <target name="jar-{id}" depends="jar-{id}-descriptors">
   
               <mkdir dir="${{build.conf}}/{id}"/>
  +            <mkdir dir="{$build-lib}"/>
   
               <manifest file="${{build.conf}}/{id}/manifest.mf" mode="update">
                   <!-- Add extension info -->
  @@ -464,8 +500,8 @@
                   </xsl:choose>
               </xsl:variable>
   
  -            <jar jarfile="${{build.lib}}/{$jarName}"
  -                basedir="${{build.classes}}"
  +            <jar jarfile="{$build-lib}/{$jarName}"
  +                basedir="{$build-classes}"
                   compress="${{build.compress}}"
                   manifest="${{build.conf}}/{id}/manifest.mf" >
                   <metainf dir="${{build.conf}}/{id}" excludes="manifest.mf"/>
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message