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/src/stylesheets build.xsl build.dvsl
Date Tue, 16 Apr 2002 11:10:25 GMT
adammurdoch    02/04/16 04:10:25

  Modified:    .        build.xml
               api      project.xml
               aut      project.xml
               buildtools project.xml
               container project.xml
               framework README.txt
  Added:       src/stylesheets build.xsl
  Removed:     src/stylesheets build.dvsl
  Log:
  * Rewrote build file stylesheet to use xslt, rather than dvsl.
  
  * Jar manifests are now generated from the project descriptor, using the
    <extension> and <attribute> elements to provide the details (and, yes, the
    format is same as <jarfile-manifest>.  Have yet to add <depends> and
    <optional>).
  
  Revision  Changes    Path
  1.4       +16 -12    jakarta-ant-myrmidon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/build.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.xml	15 Apr 2002 09:55:44 -0000	1.3
  +++ build.xml	16 Apr 2002 11:10:24 -0000	1.4
  @@ -9,18 +9,22 @@
       </target>
   
       <target name="build-files" description="Generates the project build files">
  -        <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask">
  -          <classpath>
  -            <fileset dir="tools/velocity-dvsl">
  -              <include name="*.jar" />
  -            </fileset>
  -          </classpath>
  -        </taskdef>
  -
  -        <dvsl in="buildtools/project.xml" out="buildtools/sample-build.xml" style="src/stylesheets/build.dvsl"/>
  -        <dvsl in="api/project.xml" out="api/sample-build.xml" style="src/stylesheets/build.dvsl"/>
  -        <dvsl in="aut/project.xml" out="aut/sample-build.xml" style="src/stylesheets/build.dvsl"/>
  -        <dvsl in="container/project.xml" out="container/sample-build.xml" style="src/stylesheets/build.dvsl"/>
  +        <style in="buildtools/project.xml"
  +               out="buildtools/sample-build.xml"
  +               style="src/stylesheets/build.xsl"
  +               processor="trax" />
  +        <style in="api/project.xml"
  +               out="api/sample-build.xml"
  +               style="src/stylesheets/build.xsl"
  +               processor="trax" />
  +        <style in="aut/project.xml"
  +               out="aut/sample-build.xml"
  +               style="src/stylesheets/build.xsl"
  +               processor="trax" />
  +        <style in="container/project.xml"
  +               out="container/sample-build.xml"
  +               style="src/stylesheets/build.xsl"
  +               processor="trax" />
       </target>
   
   </project>
  
  
  
  1.3       +3 -0      jakarta-ant-myrmidon/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	15 Apr 2002 09:55:44 -0000	1.2
  +++ project.xml	16 Apr 2002 11:10:24 -0000	1.3
  @@ -30,6 +30,9 @@
           <!-- The jar to build -->
           <jar>
               <id>myrmidon-api</id>
  +            <extension extension-name="myrmidon.api"
  +                       specification-version="1.0"
  +                       implementation-version="1.0"/>
           </jar>
   
       </build>
  
  
  
  1.3       +4 -0      jakarta-ant-myrmidon/aut/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/project.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project.xml	15 Apr 2002 09:55:44 -0000	1.2
  +++ project.xml	16 Apr 2002 11:10:25 -0000	1.3
  @@ -38,6 +38,10 @@
           <!-- The jar to build -->
           <jar>
               <id>myrmidon-aut</id>
  +            <extension
  +                extension-name="myrmidon.aut"
  +                specification-version="1.0"
  +                implementation-version="1.0"/>
           </jar>
   
           <!-- Patterns for including/excluding unit tests -->
  
  
  
  1.2       +2 -1      jakarta-ant-myrmidon/buildtools/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/buildtools/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	15 Apr 2002 09:55:44 -0000	1.1
  +++ project.xml	16 Apr 2002 11:10:25 -0000	1.2
  @@ -3,15 +3,16 @@
       <id>myrmidon-buildtools</id>
       <currentVersion>1.0</currentVersion>
       <inceptionYear>2000-2002</inceptionYear>
  +    <package>org.apache.myrmidon.build</package>
   
       <build>
           <sourceDirectory>src/java</sourceDirectory>
           <classpath>
               <fileset dir="../tools/xdoclet" includes="*.jar"/>
           </classpath>
  -        <generateDescriptors>false</generateDescriptors>
           <jar>
               <id>myrmidon-buildtools</id>
  +            <includeDescriptors>false</includeDescriptors>
           </jar>
       </build>
   
  
  
  
  1.2       +8 -0      jakarta-ant-myrmidon/container/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/project.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- project.xml	15 Apr 2002 09:55:45 -0000	1.1
  +++ project.xml	16 Apr 2002 11:10:25 -0000	1.2
  @@ -17,6 +17,9 @@
   
           <jar>
               <id>myrmidon-container</id>
  +            <extension extension-name="myrmidon.container"
  +                       specification-version="1.0"
  +                       implementation-version="1.0"/>
               <patterns>
                   <exclude name="org/apache/myrmidon/launcher/**" />
                   <exclude name="org/apache/myrmidon/interfaces/**" />
  @@ -24,12 +27,17 @@
           </jar>
           <jar>
               <id>myrmidon-container-api</id>
  +            <extension extension-name="myrmidon.container.api"
  +                       specification-version="1.0"
  +                       implementation-version="1.0"/>
               <patterns>
                   <include name="org/apache/myrmidon/interfaces/**" />
               </patterns>
           </jar>
           <jar>
               <id>myrmidon-launcher</id>
  +            <includeDescriptors>false</includeDescriptors>
  +            <attribute name="Main-Class" value="org.apache.myrmidon.launcher.Main"/>
               <patterns>
                   <include name="org/apache/myrmidon/launcher/**" />
               </patterns>
  
  
  
  1.2       +5 -5      jakarta-ant-myrmidon/framework/README.txt
  
  Index: README.txt
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/README.txt,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- README.txt	14 Apr 2002 09:34:11 -0000	1.1
  +++ README.txt	16 Apr 2002 11:10:25 -0000	1.2
  @@ -1,17 +1,17 @@
                      Myrmidon Framework
                      ------------------
   
  -The Myrmidon is a collection of classes which can be used to accelerate
  -the construction of ant tasks.
  +The Myrmidon Framework is a collection of classes which can be used to
  +accelerate the construction of ant tasks.
   
   Getting Started:
   ----------------
   
  -If you downloaded a source release of the component then you 
  -will need to build the component. Directions for building the 
  +If you downloaded a source release of the component then you
  +will need to build the component. Directions for building the
   component are located in BUILDING.txt
   
  -If you downloaded a binary release, or a release with both binary 
  +If you downloaded a binary release, or a release with both binary
   and source then it is recomended you look over the documentation
   in docs/index.html - and then look into the examples/ directory
   for examples of the component in action.
  
  
  
  1.1                  jakarta-ant-myrmidon/src/stylesheets/build.xsl
  
  Index: build.xsl
  ===================================================================
  <xsl:stylesheet version="1.0"
                  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                  xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
                  extension-element-prefixes="redirect">
      <xsl:output indent="yes" omit-xml-declaration="yes"/>
  
      <xsl:template match="/project">
          <xsl:comment>This is a generated file - do not edit.</xsl:comment>
          <project name="{name}" default="main">
  
              <xsl:comment>
  Give user a chance to override without editing this file (and without
  typing -D each time he compiles it)
  </xsl:comment>
              <property file="ant.properties"/>
              <property file="../ant.properties"/>
              <property file="${{user.home}}/.ant.properties"/>
  
              <xsl:comment>External resources</xsl:comment>
              <property name="stylesheet.dir" value="../src/stylesheets"/>
              <property name="tools.dir" value="../tools"/>
  
              <xsl:comment>Settings used to configure compile environment</xsl:comment>
              <property name="build.debug" value="on"/>
              <property name="build.optimize" value="off"/>
              <property name="build.deprecation" value="off"/>
              <property name="build.compress" value="false"/>
  
              <xsl:comment>Location of intermediate products</xsl:comment>
              <property name="build.dir" value="build"/>
              <property name="build.lib" value="${{build.dir}}/lib"/>
              <property name="build.conf" value="${{build.dir}}/conf"/>
              <property name="build.classes" value="${{build.dir}}/classes"/>
              <property name="build.reports" value="${{build.dir}}/reports"/>
              <property name="build.tests" value="${{build.dir}}/test"/>
  
              <xsl:comment>Set the properties for distribution directories</xsl:comment>
              <property name="dist.dir" value="dist"/>
              <property name="dist.javadocs" value="${{dist.dir}}/docs/api"/>
  
              <xsl:comment>property indicating directory where all distribution archives
are placed</xsl:comment>
              <property name="dist.base" value="distributions"/>
  
              <xsl:comment>Properties for running the unit tests</xsl:comment>
              <property name="test.classes" value="${{build.tests}}/classes"/>
              <property name="junit.fork" value="false"/>
              <property name="junit.failonerror" value="true"/>
              <property name="single.test" value="*"/>
  
              <path id="project.class.path">
                  <xsl:copy-of select="build/classpath/*"/>
              </path>
              <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:copy-of select="build/compilePatterns/*"/>
              </patternset>
  
              <target name="main" depends="jars" description="Builds the project jars"
/>
              <target name="rebuild" depends="clean, main" description="Rebuilds the project
jars" />
  
              <target name="clean" description="Cleans up the project">
                  <delete file="checkstyle.cache"/>
                  <delete dir="${{build.dir}}" />
                  <delete dir="${{dist.dir}}" />
                  <delete>
                      <fileset dir="." includes="**/*~" defaultexcludes="no"/>
                  </delete>
              </target>
  
              <target name="real-clean" depends="clean" description="Cleans up the project,
including distributions">
                  <delete dir="${{dist.base}}" />
              </target>
  
              <target name="prepare">
                  <available property="junit.present"
                             classname="junit.framework.TestCase"/>
                  <xsl:if test="not(build/jar/includeDescriptors[. = 'false'])" >
                      <taskdef name="antlib-descriptor"
                          classname="org.apache.myrmidon.build.AntlibDescriptorTask">
                          <classpath>
                              <path refid="xdoclet.class.path"/>
                              <fileset dir="../buildtools/build/lib" includes="*.jar"/>
                          </classpath>
                      </taskdef>
                  </xsl:if>
  
                  <!-- Custom tasks -->
                  <xsl:copy-of select="build/prepare/*"/>
              </target>
  
              <target name="compile-src" depends="prepare">
                  <mkdir dir="${{build.classes}}"/>
  
                  <!-- Compile all classes -->
                  <javac
                      destdir="${{build.classes}}"
                      debug="${{build.debug}}"
                      optimize="${{build.optimize}}"
                      deprecation="${{build.deprecation}}"
                      target="1.2">
                      <classpath refid="project.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>
  
              <xsl:choose>
                  <xsl:when test="build/unitTestSourceDirectory">
                      <target name="warn-no-junit" unless="junit.present">
                          <echo>WARNING: Could not find JUnit in the project classpath.
 Skipping the unit tests.</echo>
                      </target>
  
                      <target name="compile-tests" depends="compile-src, warn-no-junit"
if="junit.present">
                          <mkdir dir="${{test.classes}}"/>
  
                          <!-- Compile all classes -->
                          <javac
                              destdir="${{test.classes}}"
                              debug="${{build.debug}}"
                              optimize="${{build.optimize}}"
                              deprecation="${{build.deprecation}}"
                              target="1.2">
                              <classpath location="${{build.classes}}"/>
                              <classpath refid="project.class.path"/>
                              <src location="{build/unitTestSourceDirectory}"/>
                              <patternset refid="project.compile.patternset"/>
                          </javac>
  
                          <!-- copy resources to same location as .class files -->
                          <copy todir="${{test.classes}}">
                              <fileset dir="{build/unitTestSourceDirectory}">
                                  <exclude name="**/*.java"/>
                              </fileset>
                          </copy>
                      </target>
  
                      <target name="test" depends="compile-tests" if="junit.present" description="Runs
the unit tests">
  
                          <mkdir dir="${{build.tests}}"/>
  
                          <junit fork="${{junit.fork}}"
                              haltonfailure="${{junit.failonerror}}"
                              printsummary="yes" >
  
                              <classpath refid="project.class.path"/>
                              <classpath location="${{build.classes}}"/>
                              <classpath location="${{test.classes}}"/>
  
                              <sysproperty key="test.basedir" value="${{test.classes}}"/>
  
                              <formatter type="xml"/>    <!-- xml reports for junitreport
-->
                              <formatter type="plain"/>  <!-- text reports for humans
    -->
  
                              <batchtest todir="${{build.tests}}">
                                  <fileset dir="${{test.classes}}">
                                      <include name="**/${{single.test}}TestCase.class"/>
                                      <exclude name="**/Abstract*"/>
                                      <xsl:copy-of select="build/unitTestPatterns/*"/>
                                  </fileset>
                              </batchtest>
                          </junit>
  
                      </target>
                  </xsl:when>
                  <xsl:otherwise>
                      <target name="test">
                          <echo>This project has no unit tests.</echo>
                      </target>
                  </xsl:otherwise>
              </xsl:choose>
  
              <target name="jars" depends="compile-src" description="Builds the project
jar files">
                  <xsl:if test="build/unitTestSourceDirectory">
                      <xsl:attribute name="depends">compile-src, compile-tests</xsl:attribute>
                  </xsl:if>
                  <mkdir dir="${{build.lib}}"/>
                  <xsl:apply-templates select="build/jar"/>
              </target>
  
              <target name="javadocs" description="Generates the javadocs">
                  <mkdir dir="${{dist.javadocs}}"/>
                  <javadoc
                      destdir="${{dist.javadocs}}">
                      <classpath refid="project.class.path" />
                      <sourcepath refid="project.source.path" />
                      <xsl:for-each select="package">
                          <package name="{.}.*"/>
                      </xsl:for-each>
                      <doclet name="com.sun.tools.doclets.standard.Standard">
                          <param name="-author"/>
                          <param name="-version"/>
                          <param name="-doctitle" value="{name} v{currentVersion}"/>
                          <param name="-windowtitle" value="{name} v{currentVersion}"/>
                          <param name="-link" value="http://java.sun.com/j2se/1.4/docs/api/"/>
                          <param name="-link" value="http://java.sun.com/j2ee/sdk_1.3/techdocs/api/"/>
                          <param name="-link" value="http://jakarta.apache.org/avalon/api/"/>
                          <param name="-bottom"
                              value="&quot;Copyright &#169; {inceptionYear} Apache
Jakarta Project. All Rights Reserved.&quot;"/>
                      </doclet>
                  </javadoc>
              </target>
  
              <!-- Creates the distribution -->
              <target name="dist"
                      depends="jars, test, javadocs"
                      description="Creates the distribution">
  
                  <mkdir dir="${{dist.dir}}"/>
                  <copy todir="${{dist.dir}}">
                      <fileset dir="${{build.lib}}" includes="*.jar"/>
                      <fileset dir=".." includes="LICENSE.txt, KEYS"/>
                      <fileset dir="." includes="README.txt"/>
                  </copy>
  
                  <mkdir dir="${{dist.base}}"/>
  
                  <xsl:variable name="distname" select="concat(id, '-', currentVersion)"/>
  
                  <zip zipfile="${{dist.base}}/{$distname}-bin.zip" compress="true">
                      <zipfileset dir="${{dist.dir}}" prefix="{$distname}"/>
                  </zip>
  
                  <!--
                    <tarfileset prefix=""> is not supported by released ant
                    but when it is we should enable this across all of the products
                  <tar longfile="gnu" tarfile="${{dist.base}}/{$distname}-bin.tar">
                    <tarfileset dir="${{dist.dir}}"
                                username="ant"
                                prefix="{$distname}"
                                group="ant"/>
                  </tar>
  
                  <gzip zipfile="${{dist.base}}/{$distname}-bin.tar.gz"
                        src="${{dist.base}}/{$distname}-bin.tar"/>
  
                    Need to switch this on too
                  <bzip2 zipfile="${{dist.base}}/{$distname}-bin.tar.bz2"
                         src="{$distname}-bin.tar"/>
  
                  <delete file="${{dist.base}}/{$distname}-bin.tar"/>
  
                  <checksum fileext=".md5">
                    <fileset dir="${{dist.base}}" />
                  </checksum>
                  -->
              </target>
  
              <!-- Extra targets -->
              <xsl:copy-of select="build/additionalTargets/*"/>
  
          </project>
      </xsl:template>
  
      <xsl:template match="jar">
          <!-- Generate the manifest -->
          <redirect:write file="{id}.mf">Manifest-Version: 1.0
  Created-By: Apache Ant Project
  <xsl:for-each select="extension">Extension-Name: <xsl:value-of select="@extension-name"/>
  Specification-Vendor: Jakarta Apache Project
  Specification-Version: <xsl:value-of select="@specification-version"/>
  Implementation-Vendor: Jakarta Apache Project
  Implementation-Vendor-Id: org.apache.jakarta
  Implementation-Version: <xsl:value-of select="@implementation-version"/></xsl:for-each>
  <xsl:for-each select="attribute"><xsl:value-of select="@name"/>: <xsl:value-of
select="@value"/></xsl:for-each>
  </redirect:write>
  
          <mkdir dir="${{build.conf}}/{id}"/>
  
          <!-- Generate the descriptors -->
          <xsl:if test="not(includeDescriptors[. = 'false'])">
              <xsl:variable name="patterns">
                  <patternset>
                      <xsl:copy-of select="patterns/*"/>
                  </patternset>
              </xsl:variable>
              <antlib-descriptor
                  destdir="${{build.conf}}/{id}"
                  libName="{id}"
                  descriptorName="ant-descriptor.xml"
                  rolesDescriptorName="ant-roles.xml">
                  <xsl:for-each select="../sourceDirectory">
                      <fileset dir="{.}">
                          <patternset refid="project.compile.patternset"/>
                          <xsl:copy-of select="$patterns"/>
                      </fileset>
                  </xsl:for-each>
                  <classpath refid="xdoclet.class.path"/>
                  <classpath refid="project.class.path"/>
                  <classpath path="${{java.class.path}}"/>
              </antlib-descriptor>
          </xsl:if>
  
          <copy todir="${{build.conf}}/{id}" file="../LICENSE.txt"/>
  
          <jar jarfile="${{build.lib}}/{id}-{/project/currentVersion}.jar"
              basedir="${{build.classes}}"
              compress="${{build.compress}}"
              manifest="{id}.mf">
              <metainf dir="${{build.conf}}/{id}" />
              <patternset>
                  <xsl:copy-of select="patterns/*"/>
              </patternset>
          </jar>
      </xsl:template>
  
      <xsl:template match="text()"></xsl:template>
  
  
  </xsl:stylesheet>
  
  
  

--
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