|
Re: Why does JET not re-create files on jet2java [message #63910 is a reply to message #63886] |
Wed, 08 July 2009 13:38 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Aart:
The contents of the jet2java are created by the JET 'builder'. The builder
is an incremental compiler that translates each .jet file into a .java
file when it detects that the .jet file has changed.
If you delete the contents of jet2java, the builder does nothing - it is
only triggered by changes to the .jet files. This behavior is similar to
the Eclipse Java builder - if you go into a Java project's bin directory
and delete .class files, they do not get recreated automatically.
So, what to do? Force a full rebuild:
1) Click Project > Clean...
2) Choose either 'Clean all projects' or 'Clean projects selected below'.
If you choose the second, check the your JET project.
The error you are seeing on running the JET project is an indication that
the Java classes corresponding to your JET templates could not be found
(because you deleted them).
So, to summarize, jet2java is created by the JET builder (aka compiler).
Like a Java project's bin directory, it is necessary for the execution of
the JET project. It is not the result of the execution of the JET project.
If you are looking for the results of executing your JET project, you need
to take a look at templates/main.jet. This JET template controls the
execution of other JET templates, and is responsible for determining where
template output is written.
Control of template output is typically done via the <ws:file> tag:
<ws:file
path="workspace-relative-path-for-the-output"
template=" project-relative-path-to-the-jet-template-that-creates-the-c ontent "/>
A very simple main.jet template would be the following:
<ws:file path="{$org.eclipse.jet.resource.project.name}/hello.txt"
template="templates/hello.jet"/>
This tag executes the template 'templates/hello.jet' and writes the
resulting output to a file hello.txt in the root of the project containing
the input to the JET project. (The text
{$org.eclipse.jet.resource.project.name} is a reference to the project
name containing the input.)
In most real-world JET transformations, the location of the output is
determined in one of two ways:
1) derived from the location of the input to the JET transformation
2) derived from content contained in the input to the JET transformation
Does this help?
Paul
|
|
|
|
Powered by
FUDForum. Page generated in 0.02956 seconds