You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Alejandro Abdelnur <al...@sun.com> on 2001/09/02 04:40:24 UTC

[PATCH] ant1.4B2 - ant task, added fallbackantfile attribute

i've modified the the org.apache.tools.ant.taskdefs.Ant class to
support a fallback ant file in case the antfile specified does not
exist.

the build file specified in the fallbackantfile attribute will be used
if 
the file specified in the antfile is not found.

    <target name="buildModule" if="module">
        <ant target="build"
            antfile="${module}/config/buildModule.xml"
            fallbackantfile="default/config/buildModule.xml"/>
    </target>


attached you'll find the modified Ant.java file.

regards.

a

[PATCH] ant1.4, pluggable Target and Project implementations

Posted by Alejandro Abdelnur <al...@sun.com>.
i need to change the behavior of some Project and Target methods, but i did not
want to keep merging my changes into newer versions.

so i've modified ant 1.4 to support pluggable Project and Target
implementations, it follows the same pattern as the tasks and types, a
../ant/defaults.properties file specifies the implementation to use.

the ObjectFactory loads the defaults.properties in Main.
Main and Ant classes use the factory to create Project instances.
ProjectHelper uses the factory to create Target instances.

(i did not modify optional tasks, there are 2)

the Target class has been modified to change the visibility of the
testIfCondition and testUnlessCondition method (from private to protected) and
added getIf() and getUnless().

at the very end of the ProjectHelper class is commented out a version of the
replaceProperties() method that handles embedded variables, ie: ${a${b}}.

i did not retrofit the ProjectHelper to this pattern as it's a mix of static
and instance methods, this requires some thought.

would you please consider including this changes into the core ?

thxs and regards.

a


Re: [PATCH] ant1.4B2 *

Posted by Peter Donald <do...@apache.org>.
Hi,

fallback, looping and property-overide are features that can be implemented 
as extra tasks. However I don't think they will ever make it into core. I 
would just extend the tasks for your local installation. Something like 
<xant ... />, <xproperty ... />

For logic in if/unless elements for targets - this has been rejected a few 
times because it would invariably lead to people wanting extra logic 
operators such as !=, <, >, <=, >=, ~, ||, && ... So instead we have a 
condition task that will support some/all of these features eventually.

*DEFAULT* has also been rejected in the past much for same reasons as above 
features (we don't want ant to become a scripting language) so prolly wont 
make it into core either.

-- 
Cheers,

Pete

--------------------------------
 These aren't the droids you're 
 looking for. Move along. 
--------------------------------