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 68999 - Add empty targets to harness for customizability
Summary: Add empty targets to harness for customizability
Status: RESOLVED WONTFIX
Alias: None
Product: apisupport
Classification: Unclassified
Component: Harness (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-20 09:24 UTC by numeropi
Modified: 2008-11-08 14:45 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description numeropi 2005-11-20 09:24:51 UTC
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.
Comment 1 tomwheeler 2007-06-08 16:45:03 UTC
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.
Comment 2 Jesse Glick 2007-06-08 17:40:20 UTC
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.
Comment 3 tomwheeler 2007-06-08 19:41:52 UTC
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.
Comment 4 Jesse Glick 2007-06-08 20:11:40 UTC
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>
Comment 5 ghartmann 2008-11-08 14:45:14 UTC
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...