You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2007/07/24 17:27:58 UTC
DO NOT REPLY [Bug 42964] New: - wrong target invoked (when project name is prefix of target name?)
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=42964>.
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=42964
Summary: wrong target invoked (when project name is prefix of
target name?)
Product: Ant
Version: 1.7.0
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: normal
Priority: P2
Component: Core
AssignedTo: dev@ant.apache.org
ReportedBy: dave@watersheep.org
Apache Ant version 1.7.0 compiled on December 13 2006
If you take the two files below and run ant on build.xml:
- on Ant 1.6.5, the correct target "special.compile" executes;
- on Ant 1.7.0, the incorrect target "compile" executes.
It seems to be something to do with the project name in special.xml - if you
give it any value other than "special", then the correct target executes.
--- build.xml ---
<project default="start">
<import file="special.xml"/>
<target name="start" depends="special.compile" />
</project>
------
--- special.xml ---
<project name="special">
<target name="special.compile">
<echo>GOOD special.compile</echo>
</target>
<target name="compile">
<echo>BAD compile</echo>
</target>
</project>
------
Outputs:
D:\antbug>set ANT_HOME=c:\tools\apache-ant-1.6.5
D:\antbug>%ANT_HOME%\bin\ant
Buildfile: build.xml
special.compile:
[echo] GOOD special.compile
start:
BUILD SUCCESSFUL
Total time: 0 seconds
D:\antbug>set ANT_HOME=c:\tools\apache-ant-1.7.0
D:\antbug>%ANT_HOME%\bin\ant
Buildfile: build.xml
special.compile:
[echo] BAD compile
start:
BUILD SUCCESSFUL
Total time: 0 seconds
--
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
DO NOT REPLY [Bug 42964] - wrong target invoked (when project name is prefix of target name?)
Posted by bu...@apache.org.
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=42964>.
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=42964
peterreilly@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |gillouxGaillard@wanadoo.fr
------- Additional Comments From peterreilly@apache.org 2007-10-24 02:59 -------
*** Bug 43686 has been marked as a duplicate of this bug. ***
--
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
DO NOT REPLY [Bug 42964] - wrong target invoked (when project name is prefix of target name?)
Posted by bu...@apache.org.
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=42964>.
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=42964
peterreilly@apache.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
------- Additional Comments From peterreilly@apache.org 2007-07-24 09:13 -------
Indeed, the targets have been changed slightly for imported files.
For example take the example:
example.xml :
<project name="example">
<target name="build"/>
</project>
build.xml:
<project name="main">
<import file="example.xml"/>
</project>
This would have one target - "build"
however, the build file
<project name="main">
<import file="example.xml"/>
<target name="build"/>
</project>
would have two targets "build" (in build.xml) and "example.build"
in (example.xml).
This made it difficult to write reusable import build files, so
for ant 1.7.0 the "example.build" target was always created (as
well as the overriddable "build" target).
Your example would generate three targets:
"compile" (bound to special.xml/compile)
"special.compile" (bound to special.xml/compile)
and
"special.special.compile" (bound to special.xml/special.compile)
It probably should be:
"compile" (bound to special.xml/compile)
"special.compile" (bound to special.xml/special.compile)
and
"special.special.compile" (bound to special.xml/special.compile)
I will see what can be done.
--
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
DO NOT REPLY [Bug 42964] - wrong target invoked (when project name is prefix of target name?)
Posted by bu...@apache.org.
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=42964>.
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=42964
gillouxGaillard@wanadoo.fr changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |major
------- Additional Comments From gillouxGaillard@wanadoo.fr 2007-10-24 05:17 -------
Increased severity since it blocks moving from 1.6.x to 1.7.0.
My opinion is that there is no good choice between the proposed ones. The
project defines a namespace for targets names. If the import allows overriding
targets, overriding should be made clear in the target declaration (e.g with a
overrides="") of the overriding target, and the project-name qualifier prebended
with (e.g.) ':' instead of '.' (ala xsd).
--
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
DO NOT REPLY [Bug 42964] - wrong target invoked (when project name is prefix of target name?)
Posted by bu...@apache.org.
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=42964>.
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=42964
------- Additional Comments From ddevienne@gmail.com 2007-07-24 08:39 -------
FYI, there was a change a few months back to systematically alias target names
with a version called <project-name>.<target-name>. Prior to this change, this
was only done when a target name conflict was detected during an import. The
rational was that it was better to always do this, to have predictable results
(I think Steve Loughran) argued for this)
The bug you describes sounds related to this change.
--
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