Hi,

I have been working for a while on how to remove the need to much with the 
classpath in order to use ANT.
The idea is to have a very small loader which is used as the basis to load all 
the actual classes of ANT1.

The bulk of the loader (MainClassLoader) is based on AntClassLoader code after 
removing all references to
ANT defined objects. The next step would be to rewrite AntClassLoader as an 
extension of this class which
should be extremely simple to do.

Here is the code I have, it is not in the current ANT packages hierarchy, that 
is for you to concider.
MainClassLoader may be a candidate for jakarta-commons.

This code makes the java.class.path by simply "antloader.jar" which means that 
tasks that require to look at
this property in order to do its job may need some rework (e.g., jikes).

Jose Alberto

<?xml version="1.0"?>

<project name="local" default="libs" >

  <taskdef name="antjar" classname="org.apache.tools.ant.taskdefs.Antjar" />
  <property name="src" location="src" />
  <property name="classes" location="classes" />
  <property name="contrib" location="local_contrib.jar" />
  <property name="antloader" value="antloader.jar" />

  <target name="libs" depends="compile" >
    <jar file="${contrib}" >
      <metainf dir=".">
        <include name="antlib.xml" />
      </metainf>
      <fileset dir="${classes}" >
        <include name="org/**" />
	<exclude name="org/apache/ant/loader/**" />
      </fileset>
    </jar>
   <jar file="${antloader}" basedir="${classes}" >
     <include name="org/apache/ant/loader/**" />
     <manifest>
       <attribute name="Main-Class" 
                  value="org.apache.ant.loader.AntLoader" />
     </manifest>
   </jar>
  </target>

  <target name="compile" >
    <mkdir dir="${classes}" />
    <javac srcdir="${src}" destdir="${classes}" >
     <include name="org/**/*.java" />
    </javac>
  </target>

  <target name="clean" >
    <delete dir="${classes}" />
    <delete>
      <fileset dir=".">
        <include name="*.jar" />
      </fileset>
    </delete>
  </target>

</project>

Attachment: antloader.jar
Description: Binary data

Attachment: ant1
Description: Binary data

<<attachment: ant1.bat>>

Attachment: MainClassLoader.java
Description: Binary data

Attachment: AntLoader.java
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to