Bug 16587 - [ExternalTools] Ant script with comments before project declaration cannot be parsed
Summary: [ExternalTools] Ant script with comments before project declaration cannot be...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P1 critical (vote)
Target Milestone: 2.0 F2   Edit
Assignee: Ryan Cooper CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
: 16755 17855 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-21 11:33 EDT by Rodrigo Peretti CLA
Modified: 2002-09-18 13:58 EDT (History)
6 users (show)

See Also:


Attachments
Example that do not have comments but fails (923 bytes, text/plain)
2002-05-22 09:33 EDT, Rodrigo Peretti CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rodrigo Peretti CLA 2002-05-21 11:33:44 EDT
build 20020520

If an Ant script has a comment before the project declaration, the script 
cannot be parsed.
Comment 1 DJ Houghton CLA 2002-05-21 16:12:05 EDT
The following basic script works ok in build 2002-05-21b.

<?xml version="1.0" encoding="UTF-8"?>
<!-- foo -->
<project name="foo" default="init">
<target name="init">
<echo message="bar"/>
</target>
</project>

Note that if you remove the <target> element and its children then it fails 
with the same error message indicated above. (presumably expected behaviour)
Comment 2 DJ Houghton CLA 2002-05-21 16:39:16 EDT
Note that this works OK when using the External Tools history drop down but 
NOT ok when using the "Run Ant" from the context menu.
Comment 3 Rodrigo Peretti CLA 2002-05-22 09:18:26 EDT
*** Bug 16755 has been marked as a duplicate of this bug. ***
Comment 4 Rodrigo Peretti CLA 2002-05-22 09:32:42 EDT
There was another example posted on the newsgroup that does not work. We 
should test this one as well. Attaching file.
Comment 5 Rodrigo Peretti CLA 2002-05-22 09:33:12 EDT
Created attachment 939 [details]
Example that do not have comments but fails
Comment 6 Nick Edgar CLA 2002-05-23 11:49:45 EDT
Released Rodrigo's patch to use Xerces.  Need to verify that it fixes the above 
case.
Comment 7 Rodrigo Peretti CLA 2002-05-27 12:15:09 EDT
*** Bug 17855 has been marked as a duplicate of this bug. ***
Comment 8 Ryan Cooper CLA 2002-05-27 14:46:18 EDT
Attachment 939 [details] refers to files that aren't included.
Comment 9 Simon Arsenault CLA 2002-05-29 10:29:06 EDT
The original problem (comment at begining of ant script file) has been fixed. 
In build > 2002-05-21

Rodrigo, can you open another PR for the attachment you added. It does not seem 
related to the problem this PR represents. Also, if you could mention in the PR 
what the problem is with the attached ant script (could you also paste the ant 
script directly in the message, we are having problems looking at the 
attachment). If it is no longer a problem, then no new PR is needed.
Comment 10 Rodrigo Peretti CLA 2002-05-29 10:35:06 EDT
Instead of clicking on the attachment, just use (in IE) the option "Save 
target as...) so you can check it with any text editor. The problem was the 
same as with comments (Could not parse Ant script).
Comment 11 Scott Rutledge CLA 2002-05-29 11:40:34 EDT
I'm still getting this problem with the 0528 build. If I remove the comment from the build.xml, it 
works fine.
Comment 12 Simon Arsenault CLA 2002-05-29 12:35:31 EDT
Please verify this again. Scott, can you attach the build.xml file that is 
failing for you with the 05/28 build?
Comment 13 Scott Rutledge CLA 2002-05-29 12:40:46 EDT
I'm able to replicate with this simple script:

<!--
-->
<project name="Test" 
default="make">
   <target name="make">
   </target>
</project>

Using the Run Ant... 
action results in a "Could not parse Ant file." error dialog. Removing the comment fixes it.
Comment 14 Simon Arsenault CLA 2002-05-29 14:00:57 EDT
Scott - are you using the integration build 05/28 or the nightly build 05/28. 
If the integration build, then yes this problem is still there because we've 
not submitted anything since freeze 1 build. The nightly build is off the head 
stream so it would have the latest and greatest (and dangerous?) code. We did 
actually submit something for the 05/29 integration build. Using that build, we 
could not reproduce the problem. Please reopen if you can.
Comment 15 Scott Rutledge CLA 2002-05-29 15:00:20 EDT
Just tried I0529, works great.