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/proposal/myrmidon/src/manifest ant-descriptor.template ant-roles.template builtin-ant-roles.template core-ant-descriptor.template
Date Wed, 20 Feb 2002 11:31:52 GMT
adammurdoch    02/02/20 03:31:52

  Modified:    proposal/myrmidon antlib.xml build.xml
  Added:       proposal/myrmidon/src/make/org/apache/myrmidon/build
                        AntlibJarTask.java
               proposal/myrmidon/src/manifest ant-descriptor.template
                        ant-roles.template
  Removed:     proposal/myrmidon/src/manifest builtin-ant-roles.template
                        core-ant-descriptor.template
  Log:
  * Renamed the template files.
  * Added an <antlib-jar> task to the build, for Jar-ing up antlibs.
  
  Revision  Changes    Path
  1.4       +7 -10     jakarta-ant/proposal/myrmidon/antlib.xml
  
  Index: antlib.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/antlib.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- antlib.xml	3 Feb 2002 01:11:14 -0000	1.3
  +++ antlib.xml	20 Feb 2002 11:31:52 -0000	1.4
  @@ -56,24 +56,21 @@
         <fileset dir="${java.dir}">
           <include name="${antlib.include}/*.java" />
         </fileset>
  -      <template templateFile="${manifest.dir}/core-ant-descriptor.template"
  +      <template templateFile="${manifest.dir}/ant-descriptor.template"
                   destinationfile="${antlib.descriptor}"/>
  -      <template templateFile="${manifest.dir}/builtin-ant-roles.template"
  +      <template templateFile="${manifest.dir}/ant-roles.template"
                   destinationfile="${antlib.role.descriptor}"/>
       </xdoclet>
     </target>
   
     <!-- Creates the jars file -->
     <target name="jar" depends="xdoclet">
  -    <jar jarfile="${build.lib}/${antlib.name}.atl" basedir="${build.classes}">
  +    <antlib-jar jarfile="${build.lib}/${antlib.name}.atl"
  +                basedir="${build.classes}"
  +                descriptor="${gen.dir}/${antlib.descriptor}"
  +                rolesDescriptor="${gen.dir}/${antlib.role.descriptor}">
         <include name="${antlib.include}" />
  -      <zipfileset dir="${gen.dir}" fullpath="META-INF/ant-descriptor.xml">
  -        <include name="${antlib.descriptor}"/>
  -      </zipfileset>
  -      <zipfileset dir="${gen.dir}" fullpath="META-INF/ant-roles.xml">
  -        <include name="${antlib.role.descriptor}"/>
  -      </zipfileset>
  -    </jar>
  +    </antlib-jar>
     </target>
   
   </project>
  
  
  
  1.60      +23 -26    jakarta-ant/proposal/myrmidon/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/build.xml,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- build.xml	20 Feb 2002 07:20:21 -0000	1.59
  +++ build.xml	20 Feb 2002 11:31:52 -0000	1.60
  @@ -182,6 +182,16 @@
   
     </target>
   
  +  <!-- Compiles and installs the custom build tasks -->
  +  <target name="custom-tasks">
  +      <property name="custom-tasks-dir" value="${build.dir}/tasks"/>
  +      <mkdir dir="${custom-tasks-dir}"/>
  +      <javac srcdir="src/make" destdir="${custom-tasks-dir}">
  +      </javac>
  +      <taskdef name="antlib-jar" classname="org.apache.myrmidon.build.AntlibJarTask">
  +          <classpath location="${custom-tasks-dir}"/>
  +      </taskdef>
  +  </target>
   
     <!-- Compiles the source code -->
     <target name="compile" depends="check_for_optional_packages">
  @@ -292,7 +302,7 @@
     </target>
   
     <!-- Creates the jars file -->
  -  <target name="jars" depends="compile">
  +  <target name="jars" depends="custom-tasks, compile">
   
       <mkdir dir="${build.lib}"/>
   
  @@ -302,9 +312,12 @@
         <include name="org/apache/myrmidon/launcher/*" />
       </jar>
   
  -    <jar jarfile="${build.lib}/myrmidon-api.jar"
  -         basedir="${build.classes}"
  -         manifest="${manifest.dir}/myrmidon-api.mf">
  +    <antlib-jar jarfile="${build.lib}/myrmidon-api.jar"
  +                basedir="${build.classes}"
  +                manifest="${manifest.dir}/myrmidon-api.mf"
  +                rolesDescriptor="${manifest.dir}/builtin-ant-roles.xml"
  +                descriptor="${manifest.dir}/builtin-ant-descriptor.xml"
  +                servicesDescriptor="${manifest.dir}/core-services.xml" >
         <include name="org/apache/myrmidon/api/*" />
         <include name="org/apache/myrmidon/aspects/*" />
         <include name="org/apache/myrmidon/converter/*" />
  @@ -316,19 +329,7 @@
   <!--      <include name="org/apache/myrmidon/*" />
         <include name="org/apache/myrmidon/components/**"/>
         <include name="org/apache/myrmidon/frontends/*" /> -->
  -
  -      <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  -        <include name="builtin-ant-roles.xml"/>
  -      </zipfileset>
  -
  -      <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  -        <include name="builtin-ant-descriptor.xml"/>
  -      </zipfileset>
  -
  -      <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-services.xml">
  -        <include name="core-services.xml"/>
  -      </zipfileset>
  -    </jar>
  +    </antlib-jar>
   
   <!--
       <jar jarfile="${build.lib}/myrmidon-framework.jar"
  @@ -391,18 +392,14 @@
       </ant>
       -->
   
  -    <jar jarfile="${build.lib}/selftest.atl"
  +    <antlib-jar jarfile="${build.lib}/selftest.atl"
            basedir="${build.classes}"
  -         manifest="${manifest.dir}/selftest.mf">
  +         manifest="${manifest.dir}/selftest.mf"
  +         descriptor="${manifest.dir}/selftest-ant-descriptor.xml"
  +         rolesDescriptor="${manifest.dir}/empty-roles.xml">
         <include name="org/apache/antlib/selftest/**" />
         <exclude name="org/apache/antlib/selftest/extension1/**" />
  -      <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-descriptor.xml">
  -        <include name="selftest-ant-descriptor.xml"/>
  -      </zipfileset>
  -      <zipfileset dir="${manifest.dir}" fullpath="META-INF/ant-roles.xml">
  -        <include name="empty-roles.xml"/>
  -      </zipfileset>
  -    </jar>
  +    </antlib-jar>
   
       <jar jarfile="${build.lib}/selftest-extension1.jar"
            basedir="${build.classes}"
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/make/org/apache/myrmidon/build/AntlibJarTask.java
  
  Index: AntlibJarTask.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included  with this distribution in
   * the LICENSE.txt file.
   */
  package org.apache.myrmidon.build;
  
  import org.apache.tools.ant.taskdefs.Jar;
  import org.apache.tools.ant.types.ZipFileSet;
  import org.apache.tools.ant.BuildException;
  import java.io.File;
  
  /**
   * An Ant 1.x task to assemble a Myrmidon Antlib.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/02/20 11:31:52 $
   */
  public class AntlibJarTask
      extends Jar
  {
      private File m_roleDescriptor;
      private File m_typeDescriptor;
      private File m_serviceDescriptor;
  
      public void setRolesDescriptor( final File roleDescriptor )
      {
          m_roleDescriptor = roleDescriptor;
      }
  
      public void setDescriptor( final File typeDescriptor )
      {
          m_typeDescriptor = typeDescriptor;
      }
  
      public void setServicesDescriptor( final File serviceDescriptor )
      {
          m_serviceDescriptor = serviceDescriptor;
      }
  
      public void execute() throws BuildException
      {
          maybeAddFile( m_roleDescriptor, "META-INF/ant-roles.xml" );
          maybeAddFile( m_typeDescriptor, "META-INF/ant-descriptor.xml" );
          maybeAddFile( m_serviceDescriptor, "META-INF/ant-services.xml" );
  
          super.execute();
      }
  
      private void maybeAddFile( final File file, final String path )
      {
          if( file == null )
          {
              return;
          }
          if( ! file.isFile() )
          {
              throw new BuildException( "File \"" + file + "\" does not exist or is not a
file." );
          }
  
          // Create a ZipFileSet for this file, and pass it up.
          final ZipFileSet fs = new ZipFileSet();
          fs.setDir( file.getParentFile() );
          fs.setIncludes( file.getName() );
          fs.setFullpath( path );
          addFileset( fs );
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/manifest/ant-descriptor.template
  
  Index: ant-descriptor.template
  ===================================================================
  <ant-lib version="1.0">
  
    <types>
  
      <XDtClass:forAllClasses type="org.apache.myrmidon.api.Task" extent="hierarchy">
        <XDtClass:ifHasClassTag tagName="ant:task">
          <task name="<XDtClass:classTagValue tagName="ant:task" paramName="name"/>"
                classname="<XDtClass:fullClassName/>"/>
        </XDtClass:ifHasClassTag>
      </XDtClass:forAllClasses>
  
      <XDtClass:forAllClasses type="org.apache.myrmidon.framework.DataType" extent="hierarchy">
        <XDtClass:ifHasClassTag tagName="ant:data-type">
          <data-type name="<XDtClass:classTagValue tagName="ant:data-type" paramName="name"/>"
                classname="<XDtClass:fullClassName/>"/>
          <task name="<XDtClass:classTagValue tagName="ant:data-type" paramName="name"/>"
                classname="org.apache.myrmidon.framework.TypeInstanceTask"/>
        </XDtClass:ifHasClassTag>
      </XDtClass:forAllClasses>
  
      <XDtClass:forAllClasses type="org.apache.myrmidon.converter.Converter">
        <XDtClass:ifHasClassTag tagName="ant:converter">
          <converter classname="<XDtClass:fullClassName/>"
                     source="<XDtClass:classTagValue tagName="ant:converter" paramName="source"/>"
                     destination="<XDtClass:classTagValue tagName="ant:converter" paramName="destination"/>"/>
        </XDtClass:ifHasClassTag>
      </XDtClass:forAllClasses>
  
    </types>
  
  </ant-lib>
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/manifest/ant-roles.template
  
  Index: ant-roles.template
  ===================================================================
  <roles version="1.0">
      <XDtClass:forAllClasses abstract="true">
        <XDtClass:ifHasClassTag tagName="ant:role">
          <role shorthand="<XDtClass:classTagValue tagName="ant:role" paramName="shorthand"/>"
                name="<XDtClass:fullClassName/>"/>
        </XDtClass:ifHasClassTag>
      </XDtClass:forAllClasses>
  </roles>
  
  
  

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