You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2012/03/21 16:06:15 UTC

DO NOT REPLY [Bug 52960] New: import file with 'as' and referencing target with prefix broken in some circumstances

https://issues.apache.org/bugzilla/show_bug.cgi?id=52960

             Bug #: 52960
           Summary: import file with 'as' and referencing target with
                    prefix broken in some circumstances
           Product: Ant
           Version: 1.8.3
          Platform: PC
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: jasondonmoyer@gmail.com
    Classification: Unclassified


Created attachment 28491
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28491
three build scripts to reproduce the issue

I have a fairly complex build process that relies upon importing several build
scripts and target overriding that has been working for several older versions
of Ant that no longer works with the 1.8.3 release.

I have attached three simple ant scripts which allow you to reproduce the
problem.  After unpacking the attached zip, run the following command and you
should get the same output as below.  Running this same command in Ant 1.8.2
works correctly.


C:\dev\test\ant_defect>ant -v clean
Apache Ant(TM) version 1.8.3 compiled on February 26 2012
Trying the default build file: build.xml
Buildfile: C:\dev\test\ant_defect\build.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jdk1.6.0_30\jre
Detected OS: Windows 7
parsing buildfile C:\dev\test\ant_defect\build.xml with URI =
file:/C:/dev/test/
ant_defect/build.xml
Project base dir set to: C:\dev\test
parsing buildfile
jar:file:/C:/tools/apache-ant-1.8.3/lib/ant.jar!/org/apache/to
ols/ant/antlib.xml with URI =
jar:file:/C:/tools/apache-ant-1.8.3/lib/ant.jar!/o
rg/apache/tools/ant/antlib.xml from a zip file
Importing file C:\dev\test\ant_defect\x.xml from
C:\dev\test\ant_defect\build.xm
l
Overriding previous definition of reference to ant.projectHelper
parsing buildfile C:\dev\test\ant_defect\x.xml with URI =
file:/C:/dev/test/ant_
defect/x.xml
Already defined in main or a previous import, ignore clean
Importing file C:\dev\test\ant_defect\compile.xml from
C:\dev\test\ant_defect\x.
xml
Overriding previous definition of reference to ant.projectHelper
parsing buildfile C:\dev\test\ant_defect\compile.xml with URI =
file:/C:/dev/tes
t/ant_defect/compile.xml
Already defined in main or a previous import, ignore initProperties
Overriding previous definition of reference to ant.projectHelper
Overriding previous definition of reference to ant.projectHelper
Importing file C:\dev\test\ant_defect\compile.xml from
C:\dev\test\ant_defect\bu
ild.xml
Skipped already imported file:
   C:\dev\test\ant_defect\compile.xml


BUILD FAILED
Target "compile.initProperties" does not exist in the project "common test". It
is used from target "initProperties".
        at org.apache.tools.ant.Project.tsort(Project.java:1912)
        at org.apache.tools.ant.Project.tsort(Project.java:1919)
        at org.apache.tools.ant.Project.tsort(Project.java:1919)
        at org.apache.tools.ant.Project.topoSort(Project.java:1820)
        at org.apache.tools.ant.Project.topoSort(Project.java:1783)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:811)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Total time: 0 seconds

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

DO NOT REPLY [Bug 52960] import file with 'as' and referencing target with prefix broken in some circumstances

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52960

jasondonmoyer@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jasondonmoyer@gmail.com
         OS/Version|                            |All

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

[Bug 52960] import file with 'as' and referencing target with prefix broken in some circumstances

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52960

Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Stefan Bodewig <bo...@apache.org> ---
this happens because compile.xml is not imported at all the second time.  The
manual says so much:

> It is possible to include the same file more than once by using different prefixes, it is not possible to import the same file more than once.

To be fair I'm not sure it said so is 1.8.3.

In your case you want to use include for compile.xml inside of build.xml.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 52960] import file with 'as' and referencing target with prefix broken in some circumstances

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=52960

--- Comment #1 from jasondonmoyer@gmail.com ---
also an issue with Ant 1.8.4

-- 
You are receiving this mail because:
You are the assignee for the bug.