|
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
- <!-- Content Stylesheet for Site -->
-
-
- <!-- start the processing -->
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
-
- <meta name="author" value="Darrell DeBoer">
- <meta name="email" value="darrell at apache dot org">
-
- <title>Apache Myrmidon - Ant1 Compatibitlity Layer</title>
- </head>
-
- <body bgcolor="#ffffff" text="#000000" link="#525D76">
- <table border="0" width="100%" cellspacing="0">
- <!-- TOP IMAGE -->
- <tr>
- <td> <td colspan="2">
- <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
- </td>
- </td>
- <td valign="bottom"><div align="right"><b><font size="+3" color="#525D76">Apache Myrmidon</font></b></div></td>
- </tr>
- </table>
- <table border="0" width="100%" cellspacing="4">
- <tr><td colspan="2">
- <hr noshade="" size="1"/>
- </td></tr>
-
- <tr>
- <!-- LEFT SIDE NAVIGATION -->
- <td valign="top" nowrap="true">
- <p><strong>Myrmidon</strong></p>
- <ul>
- <li> <a href="./index.html">Introduction</a>
- </li>
- <li> <a href="./getinvolved.html">Get Involved</a>
- </li>
- <li> <a href="./user.html">Building Myrmidon</a>
- </li>
- <li> <a href="./todo.html">Todo List</a>
- </li>
- </ul>
- <p><strong>User Guide</strong></p>
- <ul>
- <li> <a href="./buildfile.html">Build file</a>
- </li>
- <li> <a href="./vfs.html">Virtual File System</a>
- </li>
- <li> <a href="./ant1compat.html">Ant1 Compatibility Layer</a>
- </li>
- <li> <a href="./differences.html">Differences to Ant1</a>
- </li>
- </ul>
- <p><strong>Extending Ant</strong></p>
- <ul>
- <li> <a href="./task.html">Task Writers HOWTO</a>
- </li>
- <li> <a href="./classloader.html">ClassLoader HOWTO</a>
- </li>
- <li> <a href="./librarys.html">Library HOWTO</a>
- </li>
- </ul>
- <p><strong>Container Design</strong></p>
- <ul>
- </ul>
- </td>
- <td align="left" valign="top">
- <table border="0" cellspacing="0" cellpadding="2" width="100%">
- <tr><td bgcolor="#525D76">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Overview"><strong>Overview</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <p>
- 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.
- </p>
- <p>
- 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.
- </p>
- <p>
- 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 <i>all</i> of the
- subtle variations of configuration present in Ant1 are handled.
- </p>
- <p>
- The updated version of Project will provide hooks into the Myrmidon TaskContext,
- such as:</p>
- <ul>
- <li>logging (done)</li>
- <li>properties (done)</li>
- <li>references (not yet done)</li>
- <li>Task defined by <taskdef> (done)</li>
- </ul>
- <p>
- So at present, properties declared in Ant2 tasks are available to all Ant1 tasks,
- and vice-versa. However, while a <code><ant1.path></code> reference works fine
- in other <code><ant1.XXX></code>
- tasks, it's not visible to Ant2 tasks in the same build, and vice-versa.
- </p>
- <p>
- The <code><taskdef></code> 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.
- </p>
- <p>
- 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
- </p>
- </blockquote>
- </td></tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="2" width="100%">
- <tr><td bgcolor="#525D76">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Using the compatibility layer"><strong>Using the compatibility layer</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <table border="0" cellspacing="0" cellpadding="2" width="100%">
- <tr><td bgcolor="#828DA6">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Using Ant1 tasks in a Myrmidon build file"><strong>Using Ant1 tasks in a Myrmidon build file</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <p>
- If you have a Myrmidon build file (eg with <code>version="2.0"</code>
- on the project element, you can use Ant1 tasks and datatypes by using
- the "ant1." suffix on the regular element name.
- Virtually <i>all</i> tasks and datatypes from Ant1.4.1 are available
- in this way.
- </p>
- <p>
- When declaring a new task using the <code><ant1.taskdef></code>
- task, <i>don't</i> 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.
- </p>
- </blockquote>
- </td></tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="2" width="100%">
- <tr><td bgcolor="#828DA6">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Using an existing Ant1 build file"><strong>Using an existing Ant1 build file</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <p>
- 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:</p>
- <pre>[myrmidon-command] -f ant1-build-file.xml</pre>
- <p>
- This works as follows: When Myrmidon encounters a ".xml" build file which does not have a
- <code>version</code> attribute on the top-level <code>project</code>
- 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.
- </p>
- </blockquote>
- </td></tr>
- </table>
- </blockquote>
- </td></tr>
- </table>
- <table border="0" cellspacing="0" cellpadding="2" width="100%">
- <tr><td bgcolor="#525D76">
- <font color="#ffffff" face="arial,helvetica,sanserif">
- <a name="Building the compatibility layer"><strong>Building the compatibility layer</strong></a>
- </font>
- </td></tr>
- <tr><td>
- <blockquote>
- <p>Before building the Ant1 Compatibility layer, you need to build
- Myrmidon, running the <code>dist-lite</code> target of the main build.
- See <a href="user.html#Building Myrmidon">the build instructions</a>
- for more details.</p>
- <p>To build the compatibility layer, simply execute:</p>
- <pre>ant -f ant1compat.xml</pre>
- <p>from within the root directory of the Myrmidon source tree.</p>
- </blockquote>
- </td></tr>
- </table>
- </td>
- </tr>
-
- <!-- FOOTER -->
- <tr><td colspan="2">
- <hr noshade="" size="1"/>
- </td></tr>
- <tr><td colspan="2">
- <div align="center"><font color="#525D76" size="-1"><em>
- Copyright © 2000-2002, Apache Software Foundation
- </em></font></div>
- </td></tr>
- </table>
- </body>
- </html>
- <!-- end the processing -->
-
-
-
|