From 214bb47106faf56b5b40a0b9e5cf61ed4a7b0c53 Mon Sep 17 00:00:00 2001
From: Darrell DeBoer Myrmidon User Guide Extending Ant Container Design
+ The Myrmidon-Ant1 Compatibility layer works by reusing most of the Ant1 code,
+ with tasks and datatypes
+ being prefixed with "ant1." in build files. Almost all of the main Ant1 tree
+ is included in the compatibility layer antlib. To insulate from changes in
+ the Ant1 tree, Ant1 class files are extracted from a jar, rather than
+ being compiled from scratch.
+
+ Here's how it works: The first time an Ant1 task is encountered, an Ant1
+ project is created, and stored in the TaskContext under the name "ant1.project".
+ The Ant1 versions of Task and Project have been extended, overriding core behaviour,
+ with Myrmidon-specific behaviour.
+
+ The updated version of Task implements Configurable, receiving it's
+ complete Task Model, and actually setting/adding/creating attributes
+ with the help of the IntrospectionHelper. This process is designed to
+ mimic the Ant1 configuration policy, although not all of the
+ subtle variations of configuration present in Ant1 are handled.
+
+ The updated version of Project will provide hooks into the Myrmidon TaskContext,
+ such as:
+ So at present, properties declared in Ant2 tasks are available to all Ant1 tasks,
+ and vice-versa. However, while a
+ The
+ The TransformingProjectBuilder (which is now the default builder for files
+ of type ".xml", applies a transformation stylesheet to the file, prefixing select
+ tasks (all at present) with "ant.". If a version attribute is encountered, the
+ file is not transformed
+
+ If you have a Myrmidon build file (eg with
+ When declaring a new task using the
+ Myrmidon will automatically handle Ant1 build files using the
+ Ant1 Compatibility layer. So, using an Ant1 build
+ file with Myrmidon should be as simple as:
+ This works as follows: When Myrmidon encounters a ".xml" build file which does not have a
+ Before building the Ant1 Compatibility layer, you need to build
+ Myrmidon, running the To build the compatibility layer, simply execute: from within the root directory of the Myrmidon source tree. Extending Ant Extending Ant Extending Ant Extending Ant Extending Ant Extending Ant Extending Ant
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/proposal/myrmidon/docs/buildfile.html b/proposal/myrmidon/docs/buildfile.html
index e0e06d47e..892185827 100644
--- a/proposal/myrmidon/docs/buildfile.html
+++ b/proposal/myrmidon/docs/buildfile.html
@@ -49,6 +49,8 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Overview
+
+
+
+
+
+
+
+ <ant1.path>
reference works fine
+ in other <ant1.XXX>
+ tasks, it's not visible to Ant2 tasks in the same build, and vice-versa.
+ <taskdef>
task works ok, registering the task with the TypeManager using the
+ "ant1." prefix. Only a couple of DataTypes (Path and Patternset) are working
+ as top-level types, but this should be just a matter of adding references to
+ the Ant1 version of TypeInstanceTask in the descriptor.
+
+
+
+
+
+ Using the compatibility layer
+
+
+
+
+
+
+
+
+
+
+ Using Ant1 tasks in a Myrmidon build file
+
+
+
+
+
+ version="2.0"
+ on the project element, you can use Ant1 tasks and datatypes by using
+ the "ant1." suffix on the regular element name.
+ Virtually all tasks and datatypes from Ant1.4.1 are available
+ in this way.
+ <ant1.taskdef>
+ task, don't prepend "ant1." to the taskname. This will be
+ done automatically by the taskdef task. However, you will need
+ to use the "ant1." prefix in all uses of that task.
+
+
+
+
+
+ Using an existing Ant1 build file
+
+
+
+
+
+ [myrmidon-command] -f ant1-build-file.xml
+ version
attribute on the top-level project
+ element, it assumes that it is an Ant1 build file. So all tasks are
+ interpreted as though they are prefixed with the "ant." name prefix.
+
+
+
+
+
+ Building the compatibility layer
+
+
+
+
+
+ dist-lite
target of the main build.
+ See the build instructions
+ for more details.ant -f ant1compat.xml
+
+
+
+
+
+
+ + Paths + + |
+ ++ |
@@ -101,9 +137,30 @@ |
- |
-The file data-types, such as
+<fileset>
and -<path>
, are some of the most widely used parts of Ant 1.x. - Unfortunately, they aren't particularly extensible.The file data-types, such as +
<fileset>
and + +<path>
, are some of the most widely used parts of Ant 1.x. + Unfortunately, they aren't particularly extensible. +
- Redesign the file data-types, replacing them with an interface-based API, plus a set of implementations. The API should use the VFS file -
FileObject
, rather thanjava.io.File
. - This process has started, in theantlib.vfile
package. + +FileObject
, rather than +java.io.File
. + This process has started, in the +antlib.vfile
package. +- File Selectors: -
+ +-
- Change
-AbstractNameFileSelector
to use Ant 1 style patterns - matches, rather than Globs patterns.- Add 'defaultexcludes' to
-DefaultFileSet
. Also add a - file selector implementation that matches everything except the default - excludes.- Add a name selector that loads patterns from a file.
-- Add more selector implementations: size and last-modified comparisons, - checksum comparison, byte-wise content comparison.
-+
+- Change +
+AbstractNameFileSelector
to use Ant 1 style patterns + matches, rather than Globs patterns. +- Add 'defaultexcludes' to +
+DefaultFileSet
. Also add a + file selector implementation that matches everything except the default + excludes. +- Add a name selector that loads patterns from a file.
+- Add more selector implementations: size and last-modified comparisons, + checksum comparison, byte-wise content comparison.
+- File conditions: -
+ +-
- Add more condition implementations that perform checks on files. - One that searches a path for a file would be useful.
-+
+- Add more condition implementations that perform checks on files. + One that searches a path for a file would be useful.
+- File Name Mappers: -
+ +-
- Change FileNameMapper.mapFileName() to take vfs.FileName objects.
-- Move the current mapper implementations across to antlib.
-+
+- Change FileNameMapper.mapFileName() to take vfs.FileName objects.
+- Move the current mapper implementations across to antlib.
+- File Sets: -
+ +-
- Add a file set implementation that provides the union of several - nested file sets (that is, a file set that merges several file sets - together).
-- Add a file set implementation that filters files that are up-to-date - WRT some other file. Alternatively, this might be better done as a - file selector.
-+
+- Add a file set implementation that provides the union of several + nested file sets (that is, a file set that merges several file sets + together).
+- Add a file set implementation that filters files that are up-to-date + WRT some other file. Alternatively, this might be better done as a + file selector.
+- Paths: -
+ +-
- Add path implementations that evaluate to the system classpath, - and the ant runtime classpath. Or, more generally, combine this with -
-ClassLoaderManager
to evaluate to the classpath of any - 'library' (e.g. system classpath, ant runtime, tools.jar, - an antlib, an installed extension, or the system classes of another JVM - for cross-compiling).+
+- Add path implementations that evaluate to the system classpath, + and the ant runtime classpath. Or, more generally, combine this with + +
+ClassLoaderManager
to evaluate to the classpath of any + 'library' (e.g. system classpath, ant runtime, tools.jar, + an antlib, an installed extension, or the system classes of another JVM + for cross-compiling). +- Port across the Ant 1 file filter proposal, once it is complete.
- Copy task: -
--
- Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.
-- Support a file name mapper.
-- Support file filters.
-- Detect and handle destination file name collisions.
-- Implement the
+<move>
,<delete>
, -<touch>
and<mkdir>
tasks on top + ++
+- Implement 'preservelastmodified', 'overwrite', and 'includeemptydirs'.
+- Support a file name mapper.
+- Support file filters.
+- Detect and handle destination file name collisions.
+- Implement the +
+ 'touch' and 'mkdir' into a single task. +<move>
, +<delete>
, + +<touch>
and +<mkdir>
tasks on top of the VFS and the new file data-types. Might be some scope for generalising - 'touch' and 'mkdir' into a single task.
lib
and ext
directories.lib
and
+ ext
directories.
+ ant-services.xml
descriptor.ant-services.xml
descriptor.
+ <http>
and <socket>
- conditions to an antlib. Need to resolve how these will be passed a logger.<uptodate>
task a condition, and move to
- an antlib.<is-set>
condition into is-set and is-true conditions.<if>
task to take any condition implementation.<if>
task.<available>
condition into separate conditions
- that test for the availability of a class, or a resource.crimson.jar
to bin/lib
in the distribution,
- and make to other jars via the extension mechanism.<http>
and
+ <socket>
+ conditions to an antlib. Need to resolve how these will be passed a logger.
+ <uptodate>
task a condition, and move to
+ an antlib.
+ <is-set>
condition into is-set and is-true conditions.
+ <if>
task to take any condition implementation.
+ <if>
task.
+ <available>
condition into separate conditions
+ that test for the availability of a class, or a resource.
+ crimson.jar
to
+ bin/lib
in the distribution,
+ and make to other jars via the extension mechanism.
+ Extending Ant
diff --git a/proposal/myrmidon/docs/vfs.html b/proposal/myrmidon/docs/vfs.html index 921acf275..c100d5f38 100644 --- a/proposal/myrmidon/docs/vfs.html +++ b/proposal/myrmidon/docs/vfs.html @@ -49,6 +49,8 @@Extending Ant
diff --git a/proposal/myrmidon/src/ant1compat/README.txt b/proposal/myrmidon/src/ant1compat/README.txt deleted file mode 100644 index c3926ba20..000000000 --- a/proposal/myrmidon/src/ant1compat/README.txt +++ /dev/null @@ -1,58 +0,0 @@ -Myrmidon Ant1 compatibility layer. - -This directory contains the source for the Ant1 compatibility layer. - -DESCRIPTION ------------ -The layer works by reusing most of the Ant1 code, with tasks and datatypes -being prefixed with "ant1." in build files. Almost all of the main Ant1 tree -is included in the compatibility layer antlib. To insulate from changes in -the Ant1 tree, Ant1 class files are extracted from a jar, rather than -being compiled from scratch. - -Here's how it works: The first time an Ant1 task is encountered, an Ant1 -project is created, and stored in the TaskContext. The Ant1 versions of Task -and Project have been extended, with Task implementing Configurable so that -it may can mimic the Ant1 configuration policy using the IntrospectionHelper. - -The idea is to provide hooks between the Ant1 project and the Myrmidon -project, eg - logging: done - properties: done - references: not done - Task definitions: done. - -So at present, while a+ The Myrmidon-Ant1 Compatibility layer works by reusing most of the Ant1 code, + with tasks and datatypes + being prefixed with "ant1." in build files. Almost all of the main Ant1 tree + is included in the compatibility layer antlib. To insulate from changes in + the Ant1 tree, Ant1 class files are extracted from a jar, rather than + being compiled from scratch. +
++ Here's how it works: The first time an Ant1 task is encountered, an Ant1 + project is created, and stored in the TaskContext under the name "ant1.project". + The Ant1 versions of Task and Project have been extended, overriding core behaviour, + with Myrmidon-specific behaviour. +
++ The updated version of Task implements Configurable, receiving it's + complete Task Model, and actually setting/adding/creating attributes + with the help of the IntrospectionHelper. This process is designed to + mimic the Ant1 configuration policy, although not all of the + subtle variations of configuration present in Ant1 are handled. +
++ The updated version of Project will provide hooks into the Myrmidon TaskContext, + such as:
+
+ So at present, properties declared in Ant2 tasks are available to all Ant1 tasks,
+ and vice-versa. However, while a <ant1.path>
reference works fine
+ in other <ant1.XXX>
+ tasks, it's not visible to Ant2 tasks in the same build, and vice-versa.
+
+ The <taskdef>
task works ok, registering the task with the TypeManager using the
+ "ant1." prefix. Only a couple of DataTypes (Path and Patternset) are working
+ as top-level types, but this should be just a matter of adding references to
+ the Ant1 version of TypeInstanceTask in the descriptor.
+
+ The TransformingProjectBuilder (which is now the default builder for files + of type ".xml", applies a transformation stylesheet to the file, prefixing select + tasks (all at present) with "ant.". If a version attribute is encountered, the + file is not transformed +
+
+ If you have a Myrmidon build file (eg with version="2.0"
+ on the project element, you can use Ant1 tasks and datatypes by using
+ the "ant1." suffix on the regular element name.
+ Virtually all tasks and datatypes from Ant1.4.1 are available
+ in this way.
+
+ When declaring a new task using the <ant1.taskdef>
+ task, don't prepend "ant1." to the taskname. This will be
+ done automatically by the taskdef task. However, you will need
+ to use the "ant1." prefix in all uses of that task.
+
+ Myrmidon will automatically handle Ant1 build files using the + Ant1 Compatibility layer. So, using an Ant1 build + file with Myrmidon should be as simple as:
+[myrmidon-command] -f ant1-build-file.xml+
+ This works as follows: When Myrmidon encounters a ".xml" build file which does not have a
+ version
attribute on the top-level project
+ element, it assumes that it is an Ant1 build file. So all tasks are
+ interpreted as though they are prefixed with the "ant." name prefix.
+
Before building the Ant1 Compatibility layer, you need to build
+ Myrmidon, running the dist-lite
target of the main build.
+ See the build instructions
+ for more details.
To build the compatibility layer, simply execute:
+ant -f ant1compat.xml+
from within the root directory of the Myrmidon source tree.
+ +