langtools and NetBeans

Jonathan Gibbons Jonathan.Gibbons at Sun.COM
Fri Dec 12 16:31:52 PST 2008

This is for folk who work on the langtools source code using NetBeans.
If you don't use NetBeans, or don't use the standard NetBeans projects
provuded with the langtools repository, then this does not apply to you.

Currently, NetBeans does not support well the notion of a number of
related components within a single project.   The GUI provides facilitoes
for building, running and debugging the project as a whole, with a notion
of a single "main" class.  This does not fit well with the "langtools" 
which contains a number of separate but related tools. It is not always
desirable to build all the tools all the time when you are working on a
feature in just one, and with many tools, there is no notion of a single
distinguished "main" class to be invoked by the Run and Debug buttons.

For all these reasons, the "langtools" repository currently contains a
number of projects, one per tool. This allows developers to focus on
a particular tool, while still being able to build everything as needed.
This has worked acceptably well for NetBeans 5 through NetBeans 6.1.
There have been some minor quirks: because of the way NetBeans
proactively reads sibling projects even if they have not been opened,
it can sometimes get confused as to which project a source file belongs
to.  For the most part, these quirks have been cosmetic, such as an
unexpected title in the window title bar.

However, in NetBeans 6.5, the quirks have become more serious.
NetBeans' confusion over having multiple sibling projects with overlapping
sources has increased, and now more serious issues can arise, such
as building the wrong target in the build files.

While it would be nice to wave a magic wand to have NetBeans handle these
projects better, it is simpler to reconsider NetBeans support within the
langtools repository.

I've attached a proposed patch, which changes langtools to provide just
a single "langtools" project instead of the the existing family of projects.
The default for building this project is to build all the tools. The default
for running and debugging this project is to use a small popup dialog that
allows you to specify which tool you wish to work on, and what command line
args you wish to use. These values can optionally be saved so that you do
not have to handle the popup dialog every time you use the Run button.
In addition, there is a new item on the project's context menu: "select 
This allows you to explicitly focus on a single tool, for building as 
well as
running. You can also use that item to deselect any earlier choice.

The new mechanism is somewhat similar to the new configuration mechanism
in NetBeans 6.5; however that mechanism is only available for standard
projects, and not freeform projects, as is langtools.  And, this new 
works with NetBeans 6 and 6.1 as well as NetBeans 6.5, so there is no need
to roll forward to using NetBeans 6.5 to use this new project.

The patch is a preview, to give folk who use NetBeans for langtools a chance
to give feedback, before we push this to the main repository, perhaps 
early in January.  Comment and feedback welcome.

-- Jonathan Gibbons

-------------- next part --------------
An HTML attachment was scrubbed...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: langtools.patch
Type: text/x-patch
Size: 115755 bytes
Desc: not available
Url : 

More information about the compiler-dev mailing list