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

             Bug #: 52922
           Summary: The <ant> task propagates ant.project.name even if
                    inheritAll is false
           Product: Ant
           Version: 1.8.3
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: [email protected]
        ReportedBy: [email protected]
    Classification: Unclassified


The <ant> task doesn't appear to honor the built-in ant.project.name property
even if the inheritAll attribute is set.

If I have one build file, build.xml:

<project name="abuild">
    <target name="run">
        <property name="aprop" value="one" />
        <ant antfile="build-other.xml" target="doit" useNativeBasedir="true"
inheritAll="false" />
    </target>
</project>

and the build-other.xml is:

<project>
    <target name="doit">
        <echo message="${aprop}" />
        <echo message="${ant.project.name}" />
    </target>
</project>

I get output like this when I execute the build.xml run target:

C:\Development\projects\ant-playground\ant-project-name-via-ant-task>ant run
Buildfile:
C:\Development\projects\ant-playground\ant-project-name-via-ant-task\build.xml

run:

doit:
     [echo] ${aprop}
     [echo] abuild

BUILD SUCCESSFUL
Total time: 0 seconds

I would not have expected the ant.project.name property to be set.

Unless, that is, ant.project.name is treated as a "user property" (i.e., one
passed on the command line) in which case I understand the behavior.  I'm not
sure it's what I want, nor is this documented anywhere I could find.

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

Reply via email to