ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 38040] New: - <presetdef> inherited across <ant> even when properties are not
Date Mon, 26 Dec 2005 14:26:39 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=38040>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=38040

           Summary: <presetdef> inherited across <ant> even when properties
                    are not
           Product: Ant
           Version: 1.6.5
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: jglick@netbeans.org


Consider

---%<--- a.xml
<project basedir="." default="x">
    <target name="x">
        <property name="l" value="error"/>
        <presetdef name="echo">
            <echo level="${l}"/>
        </presetdef>
        <echo>This should be an "error".</echo>
        <ant antfile="b.xml" inheritall="false" inheritrefs="false"/>
    </target>
</project>
---%<--- b.xml
<project basedir="." default="x">
    <target name="x">
        <echo>This should be a regular message.</echo>
    </target>
</project>
---%<---

Now run Ant (1.6.5 or dev) on a.xml:

---%<---
Buildfile: a.xml

x:
Trying to override old definition of task echo
This should be an "error".

x:

BUILD FAILED
a.xml:8: The following error occurred while executing this line:
b.xml:3: ${l} is not a legal value for this attribute
---%<---

Same if you name the preset 'echol' and use <echol>...</> in a.xml and b.xml.
Or
you can use the 'message' attribute and get output like this:

---%<---
Buildfile: a.xml

x:
Trying to override old definition of task echo
default message

x:
${m}

BUILD SUCCESSFUL
---%<---

The problem here is that the preset is getting copied from one project to a
subproject, even when nothing else is. And of course the preset cannot work in
the subproject without the definitions it needs.

I would expect that with inheritrefs="false", the subproject would not receive
presetdefs from the parent project. Maybe these are not technically "references"
as far as Ant internals are concerned, but it is part of the environment, and it
is getting copied.

Or perhaps there should be some optional inheritdefs="false" attribute to
prevent automatic copying of special taskdefs, presetdefs, macrodefs, etc. from
the parent project to the subproject. Somehow it should be possible to make the
<ant/> task work more or less like <exec executable="ant" .../>, i.e. start the
subproject with a clean environment.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message