| 
| Why does JET not re-create files on jet2java [message #63886] | Wed, 08 July 2009 06:05  |  | 
| Eclipse User  |  |  |  |  | Hi, 
 In order to try to understand and control the JET mechanism I deleted the
 content of the 'jet2java' folder, expecting that the files would be
 generated when executing the related JET transformation. Instead I got an
 error:
 'Could not load JET template'. The suggestions found in FAQ seemed not
 applicable. Quickfix on the error msg suggested that I had to provide a
 class 'JET2TemplateLoader', which should however come from the folder of
 the generated java files.
 I created a new JET project and copied the model and template files from
 the original JET project into the new JET project, and that this solved
 the problem.
 Could anybody explain why JET behaves this way ?
 
 kind regards,
 Aart
 |  |  |  | 
| 
| Re: Why does JET not re-create files on jet2java [message #63910 is a reply to message #63886] | Wed, 08 July 2009 09:38   |  | 
| Eclipse User  |  |  |  |  | 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.04584 seconds