This quide describes an initial approach for the builder and code
generation. It assumes basic eclipse knowledge.
In this document we will create two builders for a project. In the
javadoc builder, a builder is directly associated with a tempalte. Also
a builder basically parses a set of files, and uses this template to
generate something. Let's the hands on.
bootstrap
Create a java project (it doesn't really need to be a java project, but
since we will basically work with java files, this makes sense...)
Create a Car class and House class (these classes won't have anything
special for now)
Adding the first builder
The first builder we will add is a simple class list builder. This
builder has little sense beyond getting started with code generation.
Go to the project properties page. click on javadocbuilder, click on
new button. a window with some tabs should appear.
In the name and description type whay you want, the builder doesn't use
this, it's just for user-friendlyness that these exist. Go the template
tab. In this page there is a combo with template sources, these combo
is dynamic, and gets the templatesources from the plugin extensions.
Default download comes with four template sources (http, filesystem,
workspace and internal) using these requires configuring them in the
preferences pages, but for now, select the internal template source. A
few templates shoudl appear. Note that clicking on a template shows the
description of the template.
Choose the class list template.
The template comes with some defaults that will automatically be set,
note that the configuration tab contains an output name and the project
source folders.
click ok.
The builder is now ready, this builder will be invoked on every
modification, since the builder merges all source into one single file,
this file is regenerated always. Try deleting the file, you should see
it appear again.
Another check you can do, is go to the project properties, and click
onthe builders page, the Javadocbuilder should be there too.
Things to try now:
go to the internal plugin, and copy the templates to a location in your
local filesystem, add that directory in the filesystem preferences, and
tweak that templates to see how to generate different contents.