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.
The org.apache.tools.ant.module.api.AntTargetExecutor allows execution of Ant scripts. However it seems to create its *own* output window. This creates multiple output windows each time an Ant script/target combination is executed. If an OuputStream is passed using the org.apache.tools.ant.module.api.AntTargetExecutor.Env object, it throws a Not Supported or some such exception. Provide some way to execute Ant scripts and make the output go to an OutputStream (to an output window) controlled by user code. Basically user may want to execute multiple Ant scripts as part of a single logical operation and make the output go to same output window. It would be even better if no output window was created implicitly. Then the user could use the org.apache.tools.ant.module.spi.AntLogger (registered using the META-INF/services) mechanism, capture the output of Ant scripts and show the output in wizard, dialog or some other UI.
For reference, what are the intended use cases for such a feature? Please list them in detail.
Use case: Ant is integrated into NetBeans. Ant has a lot of built-in tasks like Copy, Move, Zip, Unzip and so on. The programmer wants to use these tasks as steps in some wizard/dialog based operation. The programmer wants to capture the output of such tasks, massage/process/filter it and show it in a text area/ editor pane inside the wizard/dialog. The output should *not* go to the output window/tab of the IDE main window as the wizard/dialog may be modal and may be hidin g the output window.
Right, but I would like something more detailed - what concretely would you want to use it for? It is best to know the context for an RFE so that I don't implement something which in fact is useless to you.
Concrete use case: I am implementing migration of a project. I am supporting an in-place migration. To do that I am using the New Project wizard of NetBeans (Import Old Project choice implemented using an TemplateWizard.Iterator mechanism). In the wizard iterator I collect the location of original project and a folder where the original project will be backed up. When the user clicks the Finish button I perform the following steps in the instantiate() method of the iterator: 1. Invoke an Ant script/target1 to backup the original project. 2. Programatically create a NetBeans Web project. 3. Invoke an Ant script/target2 to copy several artifacts from backed up project to the newly created Web project. 4. Programatically post-process the project. Form the user's perspective this is a single operation. Implementation wise it a combination of Ant script invocations and programatic operations. I want to seamlessly show the progress of each step in the wizard itself. I do not want any output windows opened/created. I hope this much detail is sufficient.
OK, should be possible I think. May not be trivial. I can't promise when I'll get to it - for 4.2 if I have the time.
Cf. issue #43072.
See also issue #60947.
Still no recorded use case. Sandip's use case does not make much sense to me; you surely do not need to run Ant just to copy a few files.
You can close this. My use case is no longer there.
I'll leave open in case another use case turns up.
I agree with Jesse when he says "you surely do not need to run Ant just to copy a few files", but there are special cases when this can't be changed. My case consist of a lot of legacy projects that uses "handwritten" Ant scripts to compile, copy, zip, unpack, zip again (in a jar or war) and copy to target folder. The official IDE here is IBM RAD (unfortunatelly) and, when I use NetBeans, I must keep these ant scripts intact. I use NB "project with existing sources" feature to develop locally, without adding NB's scripts to SVN, but, when I want to deploy an application, I must perform a lot of manual tasks that could be done in a wizard, just like Sandip reported.
I don't follow the use case here. If you have some existing Ant script with some complicated logic, fine - run it. Why do you need to capture output into a string? (There is no need to create a module with a wizard just to bind an Ant target to a menu item or similar; just right-click a target and use Create Shortcut.)
It is really ugly, but the script prints out some information that must be readden and copied to another file and etc. I don't know if it was Sandip case, but, IMHO, this is the kind of need that appears when we deal with legacy code that can't be refactored.
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss