ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Ant2 Proposal
Date Tue, 08 May 2001 16:23:41 GMT
As Pete has kicked off the Ant2 design discussion, I have decided to commit
my Ant2 proposal which I am calling mutant. You won't see a commit message
since the check-in was rather large. I have been using Mutant as a base for
experiments and exploring some Ant2 ideas.

I have just committed all the current code and I will be working on design
notes in the coming days to give a better understanding about how mutant is
structured and why it dos things in particular ways. As I have been working
on the core infrastructure, there are currently only two tasks - <echo> and
<property>. They are enough to give you a feel for how it works if you are
into reading code. There is a short description at the end of this mail of
some features.

One of the things I am experimenting with is running Ant remotely and
building projects from remote build files. If you want a teaser for this,
try downloading this jar
http://www.apache.org/~conor/ant/lib/egg.jar

Then run it with this commandline, passing the four arguments indicated. If
you have a copy of crimson/jaxp on your machine, you can replace the second
argument with a local file:/ url to the crimson.jar.

java -jar egg.jar
http://www.apache.org/~conor/ant
http://www.apache.org/~conor/ant/lib/parser/crimson.jar
-f
http://www.apache.org/~conor/test.ant

It is a little bit of fun, only works if you don't go through a proxy and
its quite slow.. If it doesn't work for you then let me know but don't lose
any sleep over it - I won't.

Mutant features:

I have a bootstrapLoader which will bootstrap the build. At the moment it
doesn't do the build since I am not sure how the Ant2 packaging will need
to work but the concept is working. I am using Ant-1 to do the build at the
moment. There may be issues with locating tools.jar for some JDK
installations - I'll work through those later.

The ant.bat/ant.sh files are very simple (so simple I don't have any yet).
You can start Ant with
java -jar build\lib\frontend.jar

There is a class AntLocator which figures out where Ant is being run from,
where the Parser jars are, the library directory, etc.

You can set the base of a project to a remote directory
<project name="ant test" base="http://www.apache.org/~conor">

File resolution (actually URL resolution) then occurs relative to this URL.
Also, you can set URLs in tasks directly - so
    <property file="http://www.apache.org/~conor/test.properties"/>

All this remote stuff seems pretty cool to me and I think could be useful
to CJAN style operations (and I voted against specific CJAN support).

I have separated the build model (Project/Target/Task/TaskElement) from the
execution framework (ExecutionManager/ExecutionFrame/ExecutionTask).
The latter should be able to be reused without a full project model,
although
I haven't set that up yet.

I support <import> and <include> operations in the project. Include
components are defined in <fragment> elements. Projects can be included for
extension purposes (defining new targets). The import is similar to AntFarm
except no project path concept. You name the imported project and specify
its location explicitly vis
    <import name="test2" project="test2.ant"/>

I have pluggable converters so that the IntrospectionHelper (I renamed it
ClassIntrospector) can be pretty much independent from the rest of Ant. It
no longer requires the Project to be passed in the attribute setter methods
to pick up the File conversion. It is also no longer a singleton since you
configure it with a set of converters (per project/frame). Converters are
defined in the library's ANT-INF/. The following is my current version
<antlib>
   <taskdef name="property"
classname="org.apache.ant.component.core.Property"/>
   <converter target="java.io.File"
classname="org.apache.ant.component.core.FileConverter"/>
   <converter target="java.net.URL"
classname="org.apache.ant.component.core.URLConverter"/>
</antlib>

I have rewritten the XML parsing.

There is no concept of a datatype in the build model. A datatype is a task
which modifies the state of the execution frame. This takes out all the
datatype special cases and lets you run tasks either inside or outside
targets. Simple project files of the form
  <project>
     <javac ...>
     <jar ...>
  </project>
will be possible.

Cheers
Conor.




Mime
View raw message