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.
For my Javapolis preso, it actually took considerable work to locate a project which worked really well with Project With Existing Ant Script - that is, the wizard would find all the targets with no problems. JEdit turned out to the be the best bet. A few minor improvements to the search heuristics could help this make a great first impression for a wider variety of projects (and this is an important first impression to make - this is feature is a "delighter"). Suggestions: If no "build" target, check for "compile" target If no "compile" target, check for "[xxx].jar" target (optional: look for things that call javac and if only one use that?) If no "javadoc" target check for "javadocs", "docs", "doc", optionally anything that invokes the javadoc task... A quick survey of a few open source projects would probably suffice to find the most common patterns for target naming and make sure they work well.
Implemented in TargetMappingPanel - currently just looks for Ant target names exactly matching IDE command name, which is not enough. BTW we may need to make an API change to support this well - the constructor for TargetDescriptor (org.netbeans.modules.ant.freeform.spi) only permits one String defaultTarget, but it should probably be a list of regular expressions matching likely targets, or something like that.
Created attachment 19548 [details] proposed API change
This is trivial change in not yet released API and therefore I would like to do incompatible change and fix all clients. This is friend API and so I know all the clients. The change is in TargetDescriptor which attribute will be changed from String (name of Ant target to which IDE action usually maps) to List of regular expressions. Thanks for review.
I guess that's a List<String>? Or List<Pattern>?
List<String>. I will add the comment to signature. Or do you think it should be Pattern? It would be more efficient but on the other hand performance is not concern here and String is simpler for clients.
Neccessary API change finished. Initial list of regular expressions is: build = "build", "compile", "jar", "dist", "all", ".*jar.*" clean = "clean", ".*clean.*" javadoc = "javadoc", "javadocs", "docs", "doc", ".*javadoc.*", ".*doc.*" run = "run", "start", ".*run.*", ".*start.*" test = "test", ".*test.*" debug = "debug", ".*debug.*" Can be easily extended/changed. Tested on couple of foreign Ant projects and work way better. Fill free to suggest other expressions or directly fix it in ant/freeform/src/org/netbeans/modules/ant/freeform/ui/TargetMappingPanel.java Fixed in: Checking in ant/freeform/manifest.mf; new revision: 1.7; previous revision: 1.6 Checking in ant/freeform/src/org/netbeans/modules/ant/freeform/spi/TargetDescriptor.java; new revision: 1.3; previous revision: 1.2 Checking in ant/freeform/src/org/netbeans/modules/ant/freeform/ui/TargetMappingPanel.java; new revision: 1.29; previous revision: 1.28 Checking in java/freeform/nbproject/project.xml; new revision: 1.5; previous revision: 1.4 Checking in web/freeform/nbproject/project.xml; new revision: 1.5; previous revision: 1.4 Checking in web/freeform/src/org/netbeans/modules/web/freeform/WebProjectNature.java; new revision: 1.4; previous revision: 1.3 Checking in j2ee/ejbfreeform/nbproject/project.xml; new revision: 1.6; previous revision: 1.5 Checking in j2ee/ejbfreeform/src/org/netbeans/modules/j2ee/ejbfreeform/EJBProjectNature.java; new revision: 1.6; previous revision: 1.5
*** Issue 53540 has been marked as a duplicate of this issue. ***