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: | allow source groups with non-existing rootFolder | ||
---|---|---|---|
Product: | projects | Reporter: | Milos Kleint <mkleint> |
Component: | Generic Infrastructure | Assignee: | Milos Kleint <mkleint> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | apireviews, jglick |
Priority: | P3 | Keywords: | API, API_REVIEW_FAST |
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Bug Depends on: | 195253 | ||
Bug Blocks: | 96266, 97170, 143633 | ||
Attachments: |
initial diff
maven impl maven impl api and implementation in maven projects use by junit modules |
Description
Milos Kleint
2007-04-27 09:50:36 UTC
Created attachment 42932 [details]
initial diff
Created attachment 42933 [details]
maven impl
Created attachment 42934 [details]
maven impl
an easier to integrate solution would be to create a new interface like SourceGroupProvider that would reside in project's lookup. the signature could be SourceGroup createSourceGroup(String type, String hint); where type is something like java, doc_root, scala, resource etc. and the hint would be some kind of constant that would let us distinguish between test java sources and regular java sources for example. That would be sufficient for junit support in #96266 for #97170 we would need an additional method like SourceGroupCreator createSourceGroup(String type, String hint) that would just expose an instance of SourceGroupCreator . That would have methods like File getRoot() + String getName() and also a SourceGroup createSourceGroup() method for the final SG creation. That could be reused in form module+maven hack which currently relies on "resource" sourcegroup getting eagerly created. jglick: viable for 7.0? to me it seems to be much easier to integrate than the initial idea and could be easy enough to use.. SourceGroupModifierImplementation would I guess be the appropriate name for the project service, by analogy with ClassPathModifierImplementation, and then SourceGroupModifier for an API. Your SourceGroupCreator could also be called a SourceGroupFuture, perhaps. I think it is feasible for 7.0 if you want to prepare it. Clearly all project types would benefit from having an impl, so they can add a test root. Created attachment 76794 [details]
api and implementation in maven projects
Created attachment 76795 [details]
use by junit modules
api change included along with a sample implementation in maven projects. the second attachment patches the junit module to make use of the new api, please note that I took the minimum changes approach to patching junit, it could be rewritten more effectively. please review thanks for review, I will integrate tomorrow api contract and maven project type implementation: http://hg.netbeans.org/main/rev/d2c4d648ef70 use in junit module: http://hg.netbeans.org/main/rev/e2a4b4dc410a use in swingapp module http://hg.netbeans.org/main/rev/f931ce14eec2 http://hg.netbeans.org/main/rev/eba9336b8def Please add a note to Project.getLookup Javadoc suggesting that a SourceGroupModifierImplementation be included. Assuming that impls are added for j2seproject, apisupport.project, etc., we should consider whether various New Project wizards ought to create the test source root by default, if it is now so easy to add tests later. Complete the Javadoc for Future. Sorry for the late review and if I am missing something obvious, but [JG01] what is the purpose of createSourceGroupFuture? The Future object does not provide any more information than what you passed to cSGF. You could just call cSG later if that's what you wanted. I thought the whole purpose of this was to have a method such as URL getFutureRootFolder() which would not actually create the SourceGroup yet - but there is no such method, and nothing in SGMI to support it. Nor is there any usage in o.n.m.junit.wizards.* where I would expect it (because you do not want to actually create the folder unless and until Finish is clicked). added javadoc and a new method in SGMI to make sure to create a Future object only if the creation of the SG for the given hint+type is supported. http://hg.netbeans.org/main/rev/7d3ac2fb6af3 http://hg.netbeans.org/main/rev/3108ea12487f the future object is not used in junit module because I took the path of least resistance there. delaying of fileobject creation in the wizard seems like a more complex task, I don't unfortunately have time nor expertise for that.. I'll look into the java module templates if they are simpler to convert, if not I guess we should remove the Future class until it's really needed. Integrated into 'main-golden', will be available in build *200902220201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/d2c4d648ef70 User: Milos Kleint <mkleint@netbeans.org> Log: #102711 add api that allows to create SourceGroups of given type if not pre-existing. Includes implementation for maven project's main and test java source roots. (In reply to comment #11) > Assuming that impls are added for j2seproject, apisupport.project, etc., we > should consider whether various New Project > wizards ought to create the test source root by default, if it is now so easy > to add tests later. See: bug #195254 |