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.
Summary: | API to notify J2SE Project extensions about build script update. | ||
---|---|---|---|
Product: | java | Reporter: | Tomas Zezula <tzezula> |
Component: | Project | Assignee: | apireviews <apireviews> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dkonecny, pjiricka, psomol |
Priority: | P2 | Keywords: | API, API_REVIEW_FAST |
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | TASK | Exception Reporter: | |
Attachments: | Diff dile (API + Java Web Start rewritten) |
Description
Tomas Zezula
2013-02-21 07:42:09 UTC
Created attachment 131644 [details]
Diff dile (API + Java Web Start rewritten)
Just remarking that this proposal will affect also future FX support integration with SE project. Technical question. If I understand it right then after the patch it would look like this: when build-impl is (re)generated, JWS (or other SE extender) is notified and that triggers also (re)generation of extender's build script; but that in turn can lead to another build-impl regeneration in case the new extender's build script requires changes in the internal dependencies among these two scripts. Would not it help if a notification came even before build-impl regeneration, where the notification would carry the info on new api version, so that the extending build script could first remove its old dependencies even before build-impl is actually generated (ant thus to save one of the build-impl regenerations) ? Is this technically possible and/or is it worth the effort ? I better ask before we establish the new interface. I understand this API will for now be only used in Java SE project type, but in case it is needed in other Ant-based project types later, would it be useful to move the GeneratedFilesInterceptor and GeneratedFilesInterceptorSupport classes to a more general place? E.g. into java.api.common: org.netbeans.modules.java.api.common.ant.GeneratedFilesInterceptor org.netbeans.modules.java.api.common.util.GeneratedFilesInterceptorSupport They don't seem to be specific to Java SE project type. >If I understand it right then after the patch it would look >like this: when build-impl is (re)generated, JWS (or other SE extender) is >notified and that triggers also (re)generation of extender's build script. Right >but that in turn can lead to another build-impl regeneration in case the new >extender's build script requires changes in the internal dependencies among >these two scripts. Yes > Is this technically possible and/or is it worth the effort ? Yes, it's possible. Originally I had these two methods (beforeGenerate, afterGenerate) however I didn't found any use case for the first one. The number of build-impl.xml generation is the same or even higher in case when you remove the extension before you actually regenerate build-impl.xml as the AntBuildExtener.removeExtension() modifies project.xml which needs to be saved. The extension itself should not depend on information stored in J2SE build-impl.xml file as it's derived from the project.xml, so it does not need the previous state of the build-impl.xml. Other problem is that the afterGenerate will need to get a update result and in case that the update was not successful restore the original state which it has broken in beforeGenerate to be failure atomic. There are currently no use cases for this API except of the JFX. If such use case appears the API belongs to the project/ant as it relates to the GeneratedFilesHelper. Something like: class GeneratedFilesHelper { static interface Interceptor { .... } ... } One forgotten note about generic nature of this API. Due to the project system threading (the APH is not fully reentrant) the project (J2SE) needs to ensure that the call to GeneratedFilesInterceptor is a tail call of the ProjectXmlSavedHook.projectXMLSaved() and the whole ProjectXmlSavedHook.projectXMLSaved() runs in exclusive mode. The first is hard to request in general. In case of the general API the same threading limitations as in the ProjectXMLSavedHook is required. If there is other use case than JFX and such a limitation is OK for it I can move the API to project/ant. From EE/Web tier point of view I'm OK with this API being available only to J2SE project for now as we do not have any requirement for it. Fixed jet-main 563b72ae9cb9 Integrated into 'main-golden', will be available in build *201302282300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/563b72ae9cb9 User: Tomas Zezula <tzezula@netbeans.org> Log: #226433:API to notify J2SE Project extensions about build script update applied to FX http://hg.netbeans.org/jet-main/rev/4ac5963ee7ca Integrated into 'main-golden', will be available in build *201303132300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/4ac5963ee7ca User: Petr Somol <psomol@netbeans.org> Log: #226433 - API to notify J2SE Project.. applied to FX |