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 42681 - Support projectization of non-netbeans.org modules
Summary: Support projectization of non-netbeans.org modules
Status: RESOLVED FIXED
Alias: None
Product: www
Classification: Unclassified
Component: Builds & Repositories (show other bugs)
Version: 4.x
Hardware: All All
: P1 blocker with 1 vote (vote)
Assignee: Jesse Glick
URL:
Keywords:
: 51333 52937 56507 (view as bug list)
Depends on:
Blocks: 42680 58280
  Show dependency tree
 
Reported: 2004-05-01 16:49 UTC by Jesse Glick
Modified: 2005-09-05 10:06 UTC (History)
9 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Initial work (68.60 KB, patch)
2005-04-20 01:55 UTC, Jesse Glick
Details | Diff
Continued work (should be enough for NB to build itself OK) (21.57 KB, application/octet-stream)
2005-04-20 20:44 UTC, Jesse Glick
Details
Continued work (1 of 2) (23.12 KB, application/octet-stream)
2005-04-21 21:06 UTC, Jesse Glick
Details
Continued work (2 of 2) (3.38 KB, application/octet-stream)
2005-04-21 21:07 UTC, Jesse Glick
Details
More progress; NB itself builds, and you can again work on netbeans.org modules with apisupport/project correctly (36.42 KB, application/octet-stream)
2005-04-23 00:27 UTC, Jesse Glick
Details
Further progress; working on apisupport recognition of external modules (38.90 KB, application/octet-stream)
2005-04-25 23:37 UTC, Jesse Glick
Details
A few more fixes... seems possible to open external projects with correct in-IDE classpath etc. (but still testing) (42.75 KB, application/octet-stream)
2005-04-27 17:25 UTC, Jesse Glick
Details
More work... it actually seems to work to open an external module in the IDE and build it, including intra- and inter-suite dependencies; no unit testing support yet (48.55 KB, application/octet-stream)
2005-04-27 22:47 UTC, Jesse Glick
Details
Unit testing working, context menu in Projects nicer, ... (52.56 KB, application/octet-stream)
2005-04-28 01:30 UTC, Jesse Glick
Details
Documented and nearing completion. (73.10 KB, application/octet-stream)
2005-04-28 04:27 UTC, Jesse Glick
Details
Commit log (80.30 KB, text/plain)
2005-04-28 05:54 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2004-05-01 16:49:23 UTC
Need to be able to take a NB build (i.e. the
platform cluster plus zero or more additional
clusters) and build projectized modules against
it, without them needing to be in the
cvs.netbeans.org tree.

This means that nbbuild/templates/*.xml and some
other nbbuild/*.{xml,properties}; nbantext.jar;
etc.; all need to be included in the binary build
in some special directory ("kit" or something).
projectized.xml would refer to this kit (you would
need to define some Ant property to refer to a
"cluster path") and apisupport/project would too.

Ideally the platform cluster dir would have the
main stuff, and other cluster dirs would have just
have some information listing their own modules
(if it could not be determined quickly on the fly).

Probably modules.xml should not be included as it
only applies to building against a source tree.
TBD whether the SourceForBinaryQueryImplementation
in apisupport/project should support finding
sources for a foreign cluster this way.

There are various issues that will arise; this has
not been thoroughly designed yet.
Comment 1 Jesse Glick 2004-11-09 22:44:25 UTC
*** Issue 51333 has been marked as a duplicate of this issue. ***
Comment 2 Jesse Glick 2005-01-05 02:10:00 UTC
*** Issue 52937 has been marked as a duplicate of this issue. ***
Comment 3 Nam Nguyen 2005-03-16 07:11:29 UTC
*** Issue 56507 has been marked as a duplicate of this issue. ***
Comment 4 Nam Nguyen 2005-03-16 07:15:53 UTC
I attached a patch to solve hard-coding 'nbbuild' name in issue 56507 which I
closed as duplicate of this issue (I filed that issue before rereading Jesse email).
Comment 5 Rich Unger 2005-03-16 19:03:44 UTC
This can, of course, be done on a limited basis now with the cluster build
harness.  However, I think the ideal solution would not involve an external
build directory like nbbuild/ at all (or, at least, just for the core,
non-module stuff in the CVS tree, and unnecessary for building a cluster of
modules).
Comment 6 Jesse Glick 2005-04-19 17:56:59 UTC
This is my main task right now. Not simple.
Comment 7 Jesse Glick 2005-04-19 21:45:12 UTC
An initial question is how to get rid of modules.xml. Need some way of figuring
out, starting from an NBM project, what "nearby" modules are, in terms of the
info in modules.xml: source path, JAR path, and code name base. Proposed
algorithm, for both apisupport/project and ParseProjectXml:

1. Make <path> optional in project.xml /2: deleted for nb.org modules, and for
external modules, to mean path within an external module suite.

2. If ${nb_all} is defined (which is done consistently for nb.org modules in
nbbuild/default-properties.xml, and may be done for external modules where there
is an NB source association too, indirectly thru some "NB platform definition"
properties file), scan for NBM projects among ${nb_all}/{*,*/*,*/*/*}. Since no
nb.org modules are more than three dirs deep, this should work for now. For
reference, on my laptop, echo */{,*/,*/*/}nbproject/project.xml only takes a
second or so, but we need to add some XML parsing and so on; should try to cache
the result (per ${nb_all}) within one Ant build (for PPX) and in
apisupport/project (at runtime).

3. If <path> is defined, use it to infer a root for the external module suite,
and scan e.g. ${root}/{*,*/*}, i.e. permit modules two levels deep. (Could be
made deeper as needed, but best to limit the scan for performance reasons.)
Again, need to cache result by ${root}. If you aren't referring to those other
modules, no problem, but you can if you want (using <module-dependency>).

4. If ${nb_all} was *not* defined (for an external module), netbeans.dest.dir
must be defined (so you can build!), so first scan
${netbeans.dest.dir}/*/modules/*.jar for entries w/o source path.

4a. (The source path is only important for ParseProjectXml to find Class-Path
extensions. Currently this uses an odd hack but that should be deleted and
<class-path-extension> searched for in project.xml. If there is no source, the
JAR manifest must be used instead - it is preferable to use a source path
because use of <binary-origin> or <extra-compilation-unit> in the subproject
helps to avoid needless classpath rescanning. apisupport/project of course uses
the source path for various purposes, but if not found, oh well - if you don't
have sources, it won't use any.)

Other fine points not related to modules.xml:

1. All external modules will I guess build into the "extra" cluster of your
${netbeans.dest.dir}. So it should be easy to clean them from
${netbeans.dest.dir} (just delete this whole cluster). If you want them
somewhere else in a real app, that's fine - write some separate Ant script to
move them (or just pack them into a ZIP with a different prefix, as Ant makes it
easy to do).

1a. If you want to keep a pristine reference copy of your NB platform and not
trust deletion of extra/, make a temp copy somewhere and set
${netbeans.dest.dir} to that instead.

2. No initial support for building a whole module suite at once - you can
(pretty) easily write this yourself. Should be possible later, using
<build-prerequisite> declarations.
Comment 8 Rich Unger 2005-04-19 22:04:54 UTC
Sounds good, for the most part.  I'm concerned about your "fine point" #1.  You
say that, if I want my modules in a cluster other than 'extra', I can just copy
them to another cluster, or rename the prefix.  But what about
${netbeans.dest.dir}/moduleCluster.properties?

Is there a reason why adding a cluster element to the module's project.xml is a
bad idea?
Comment 9 Jesse Glick 2005-04-19 23:00:43 UTC
So what about moduleCluster.properties? This file is junk, used only during the
build AFAIK. It can just be deleted, or if not, its contents do not matter after
you have finished building.

Re. defining an explicit cluster from an NBM project - could probably be
supported to let project.properties set ${cluster.dir} or something. Will see.
Comment 10 Jesse Glick 2005-04-20 01:55:52 UTC
Created attachment 21743 [details]
Initial work
Comment 11 Michal Zlamal 2005-04-20 16:07:57 UTC
The patch seems good to me.
Comment 12 Jesse Glick 2005-04-20 17:10:10 UTC
Well I'm just starting - there will be more changes, especially in
apisupport/project.
Comment 13 Jesse Glick 2005-04-20 20:44:27 UTC
Created attachment 21781 [details]
Continued work (should be enough for NB to build itself OK)
Comment 14 Jesse Glick 2005-04-21 20:16:26 UTC
Minor adjustment: for external modules, ${nb_all} is not interpreted by
<parseprojectxml> at all; it is not needed for anything. apisupport/project will
however look for a property ${netbeans.sources} (path format) to use for source
association at development time.
Comment 15 Jesse Glick 2005-04-21 21:06:50 UTC
Created attachment 21805 [details]
Continued work (1 of 2)
Comment 16 Jesse Glick 2005-04-21 21:07:32 UTC
Created attachment 21806 [details]
Continued work (2 of 2)
Comment 17 Jesse Glick 2005-04-21 21:08:27 UTC
I would put this all into a branch, but I would have to branch *every* module
(to upgrade /1 -> /2 in project.xml), and it would take soooo long in CVS, it's
not worth it. :-(
Comment 18 Jesse Glick 2005-04-23 00:27:22 UTC
Created attachment 21842 [details]
More progress; NB itself builds, and you can again work on netbeans.org modules with apisupport/project correctly
Comment 19 Jesse Glick 2005-04-25 23:37:46 UTC
Created attachment 21856 [details]
Further progress; working on apisupport recognition of external modules
Comment 20 Jesse Glick 2005-04-27 17:25:27 UTC
Created attachment 21895 [details]
A few more fixes... seems possible to open external projects with correct in-IDE classpath etc. (but still testing)
Comment 21 Jesse Glick 2005-04-27 22:47:40 UTC
Created attachment 21897 [details]
More work... it actually seems to work to open an external module in the IDE and build it, including intra- and inter-suite dependencies; no unit testing support yet
Comment 22 Jesse Glick 2005-04-28 01:30:32 UTC
Created attachment 21900 [details]
Unit testing working, context menu in Projects nicer, ...
Comment 23 Jesse Glick 2005-04-28 04:27:18 UTC
Created attachment 21901 [details]
Documented and nearing completion.
Comment 24 Jesse Glick 2005-04-28 05:54:21 UTC
Implemented.
Comment 25 Jesse Glick 2005-04-28 05:54:56 UTC
Created attachment 21903 [details]
Commit log