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=36955>.
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=36955


[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Additional Comments From [EMAIL PROTECTED]  2007-09-04 01:55 -------
Despite the claim to the contrary in file WHATSNEW, this bug is NOT fixed in
version 1.7.0.

This is what WHATSNEW says:

* Defer reference process. Bugzilla 36955, 34458, 37688.
  This may break build files in which a reference was set in a target which was
never executed. Historically, Ant would set the reference early on, during parse
time, so the datatype would be defined. Now it requires the reference to have
been in a bit of the build file which was actually executed. If you get an error
about an undefined reference, locate the reference and move it somewhere where
it is used, or fix the depends attribute of the target in question to depend on
the target which defines the reference/datatype.

---

Here is a test script to prove the point:

<?xml version="1.0" encoding="UTF-8"?>
<project name="test" default="test">
    <echo message="${ant.version}"/>
    <target name="never-call">
        <path id="test.path" path="."/>
    </target>
    <target name="test">
        <condition property="test.path.set" else="false">
            <isreference refid="test.path"/>
        </condition>
        <echo message="test.path setting = ${test.path.set}"/>
    </target>
</project>

---

Here are the results from the test:

C:\work>ant -f test_build.xml
Buildfile: test_build.xml
     [echo] Apache Ant version 1.7.0 compiled on December 13 2006

test:
Warning: Reference test.path has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support 
referencing ids defined in non-executed targets.
     [echo] test.path setting = true

BUILD SUCCESSFUL
Total time: 0 seconds
C:\work>

If the fix was in place I would expect "[echo] test.path setting = false".

---

Further info - comment in reply posted to '[EMAIL PROTECTED]':

I've just tested this with svn trunk compiled today (1.7.1alpha) and I get the
same behaviour - an 'unexecuted' target containing the ref and an executed
target using the ref and the ref set:

[EMAIL PROTECTED]:~/workspace/ant-core-trunk$ ant -f test-id.xml
Buildfile: test-id.xml
     [echo] Apache Ant version 1.7.1alpha compiled on August 30 2007

test:
Warning: Reference test.path has not been set at runtime, but was found during
build file parsing, attempting to resolve. Future versions of Ant may support 
referencing ids defined in non-executed targets.
     [echo] test.path setting = true

BUILD SUCCESSFUL
Total time: 0 seconds
[EMAIL PROTECTED]:~/workspace/ant-core-trunk$

---

Further info - another comment in reply posted to '[EMAIL PROTECTED]':

The behavior as described in the WHATSNEW is what was initially was done.
However this broke too many builds - with references to out-of-band ids. So the
code was modified to store all the out-of-band ids and if the reference could
not be found, to look up that and if found to use that reference and to output a
long message.

In ant 1.8.0, this out-of-band resolution will probably be removed. One could
change the <isreference> implementation to report false for out-of-band
references, but I do not think that is a good idea.



-- 
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to