This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 46722 - new project with existing ant script wizard rejects valid build.xml files
Summary: new project with existing ant script wizard rejects valid build.xml files
Status: CLOSED DUPLICATE of bug 45066
Alias: None
Product: projects
Classification: Unclassified
Component: Ant (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks: 42682
  Show dependency tree
 
Reported: 2004-07-29 05:40 UTC by bwl
Modified: 2006-03-24 10:12 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
a build file that demonstrates the problem (4.05 KB, text/plain)
2004-07-30 00:08 UTC, bwl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description bwl 2004-07-29 05:40:25 UTC
If you attempt to create a new project with an 
existing ant script, the wizard rejects valid 
build files, with the message "The chosen build 
script is not a valid Ant script".  Apart from 
being wrong (it is a valid Ant script) it is also 
very unhelpful, since it gives no indication what 
it has an issue with.

Curiously, it seems to have parsed the script in 
the first place, because it correctly pulls out 
and displays the project name.

This is in the 28July2004 nightly build.
Comment 1 _ ttran 2004-07-29 08:35:17 UTC
can you attach the build.xml?
Comment 2 _ ttran 2004-07-29 13:58:00 UTC
-> P2, not dataloss
Comment 3 Jesse Glick 2004-07-29 16:23:45 UTC
Works OK for me in the current trunk. Have made some changes recently
which I think were not in the dev build you mention. No example build
script or other steps to reproduce attached, so can only guess what
problem you were actually running into.

Note that scripts with no 'default' or 'basedir' attr will in general
not be treated by the IDE as Ant scripts (though you can use them in
this wizard) because <project> (perhaps with 'name') is not
distinctive enough to be identified as an Ant script rather than
something else. XML files with a namespaced root element named
{antlib:org.apache.tools.ant}project will however always be treated as
Ant scripts.

Regardless of what the wizard prompts you, as a workaround you can
always edit the generated project.xml to use whatever you please.
Comment 4 bwl 2004-07-30 00:08:12 UTC
Created attachment 16569 [details]
a build file that demonstrates the problem
Comment 5 Jesse Glick 2004-07-30 00:13:05 UTC
Ah, the line

<import file="${tools.dir}/../build/build-common.xml"/>

is responsible.
Comment 6 Jesse Glick 2004-07-30 00:13:29 UTC

*** This issue has been marked as a duplicate of 45066 ***
Comment 7 bwl 2004-07-30 01:38:46 UTC
Yes the use of "import" was the reason that the build script was being
rejected.  I haven't tried todays build but based on Jesse's comments
suspect that there are still several problems:

1) Handling of import
2) The IDE rejects files but doesn't explain why.
3) If you correct the build file (remove the import) and try
reselecting it in the wizard, the wizard does not refresh - i.e. still
rejects it.  You need to copy it to a new file name and select it.
4) basedir attribute should not be required - it is optional for Ant.


Comment 8 Jesse Glick 2004-07-30 18:37:06 UTC
First of all, I have not yet committed the fix for #45066.

Second, for any other problems please file fresh individual issues
with steps to reproduce.

Re. handling of import - what about it? See discussion in #45066.

Re. the IDE rejects files but doesn't explain why - when #45066 is
fixed it will not reject any well-formed XML file.

Re. wizard does not refresh - applies only to that which was fixed
several days ago, AFAIK.

Re. basedir attribute should not be required - sorry, but the
designers of Ant failed to force it to be qualified with a namespace,
so an interactive environment that can display any kind of XML file
has to look for something distinctive, or it would miscategorize Maven
project files etc. As mentioned elsewhere, an XML file not recognized
as an Ant script can still be used in a freeform project, but not
edited/displayed specifically as an Ant script. Not much more can be
done AFAIK.

*** This issue has been marked as a duplicate of 45066 ***
Comment 9 Marian Mirilovic 2005-07-12 10:18:07 UTC
closed
Comment 10 Jesse Glick 2005-08-29 18:35:47 UTC
See issue #62752: computed filenames in <import> now supported for many common
cases. (Not yet <property env="..."> however.)