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 130030 - Add extensions target (like "-post-jar") to Module and Module Suite projects
Summary: Add extensions target (like "-post-jar") to Module and Module Suite projects
Status: RESOLVED WONTFIX
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-13 13:35 UTC by remonet
Modified: 2008-03-14 14:04 UTC (History)
0 users

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 remonet 2008-03-13 13:35:24 UTC
Standard J2SE project allows user to extends build process in a non-invasive way by overriding dedicated targets such as
"-pre-jar", "-post-jar", "-pre-compile", ...

It is impossible to do such customization with Module and Module Suite projects. It would be really useful to extend
build with, for example, "-post-branding", "-pre-build-zip", "-post-nbm", ...
Comment 1 Jesse Glick 2008-03-13 17:11:30 UTC
Probably will not bother adding such targets for NBM projects. It is indeed possible to do such hooks. For
-pre-something, use

<target name="something"><!-- according to needs: depends="init" -->
  <custom/>
  <antcall target="myprj-impl.something"/>
</>

For -post-something, use

<target name="something" depends="myprj-impl.something">
  <custom/>
</target>

Would be nice if Ant better supported before and after "methods" for targets, and perhaps in 1.8.0 it will, but this
works in the meantime.
Comment 2 remonet 2008-03-14 14:04:46 UTC
Thank you for the quick reply.
I took a closer look at ant. If anyone needs it, here is a more detailed "workaround" example:

In build.xml, first define a new task

    <target name="-pre-build-zip">
        ...
    </target>

and then redefined the one you want to extend

    <target name="build-zip" depends="-pre-build-zip">
      <!-- Could add your -pre- code here instead -->
      <subant target="build-zip" buildpath="." antfile="nbproject/build-impl.xml"/>
      <!-- Could add your -post- code here -->
    </target>