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.
Regular projects have empty ant targets designed to be overriden: -pre-init -post-init -pre-compile -post-compile and many more. The build harness in contrast does not seem to have any of these. I propose that placeholder targets be added. My use case is: I have a library wrapper project that depends on a regular project that is being developed concurrently. As the wrapper module picks up the wrapped .jar only once from its original location, I'd like to be able to override the build process so that it builds and copies the wrapped jar from ${project.wrapped}/dist to ${project.wrapper}/release/modules/ext. I could hand-edit the generated build files, but to me the proposed enhancement seems cleaner and more useful in general.
Jesse, this would be useful to me as well. If it would be possible to get this into 6.0, I would be happy to work this issue.
If you want to work on it, you have one week (till June 15). I would like to see concrete use cases for the new targets, since I can see plenty of build.xml's in netbeans.org with various targets successfully overridden using the current harness. The actual use case mentioned by the reporter is really a duplicate of issue #70894, which I think is valuable but requires more complex work, described in that issue.
As I had written earlier, having these pre/post hooks would would be helpful to me. But I'm doing something very specific and unusual, I've been trying to think of a widespread and compelling need for this. Aside from consistency with freeform project build scripts, I can't think of one. The non-exhaustive list in harness/README documents more than 30 targets, so a complete implementation would add at least 60 more. Just adding pre and post hooks for a few major targets like clean, compile and jar would be easy enough, but would almost certainly leave some developers needing to override other targets anyway (like test, javahelp or run). Since overridding existing targets to add pre/post hooks is already documented in the harness/README and there is no compelling reason to add them directly into the harness, I think it is best to close the issue. However, if anyone can think of a convincing reason to have this after all, I remain committed to doing the implementation.
OK. Note that with Ant, adding a post hook (with no special placeholder target) is a little easier than a pre hook, e.g. <target name="compile" depends="MYPRJ-impl.compile"> <extra-stuff/> </target> vs. <target name="compile" depends="??"> <extra-stuff/> <antcall target="MYPRJ-impl.compile"/> </target>
My use case is to compile JasperReport report files. In my regular J2SE project I use the -post-compile to compile .jrxml to .jasper files. After many hours of searching I found the netbeans-extra target inside the harness build script which I could use for compiling my reports. Maybe someone has the same problem and this comment can help...