|
Re: Problem using jet.compile ANT task [message #68262 is a reply to message #68121] |
Tue, 16 January 2007 16:50 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Bob:
The jet.compile task compiles "JET2" templates. Looking at your build
output, I'd guess that you are using what I would call "Classic JET" - the
JET that is included with EMF.
I think the task you want to use is emf.JETEmitter. See:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. emf.doc/references/javadoc/org/eclipse/emf/ant/taskdefs/code gen/JETEmitterTask.html
If you are really using JET2, then you need to add .javajet as an extension
recognized by the compiler on the particular project. See the EMFT JET page
in the project's Properties dialog if that is the case.
FYI, the salient differences between the two are:
Classic JET
* Based on JSP scriptlets <%= ... %> and expressions <% ... %>
* Each template creates a Java class with a single public method:
String generate(Object argument)
* To consume the template, you must write a Java program that instantiates
the generated Java class and calls this method. You must also write any/all
code necessary to so something useful with the resultant string.
* The implementer of the Java program that consumes templates can, through
the use of the JETEmitter class, allow users to provider their own
implementations of some or all of the templates
* The generated Java class has no Eclipse dependencies (unless the contained
scriptlets and expressions create these).
EMFT JET (JET2)
* Based on JSP scriptlets AND JSP Tag library concepts
* JET2 plug-ins are complete 'programs'. There is no need to write Java code
to produce a 'code generation' type program (called a JET Transformation)
that runs a set of templates and creates a bunch of files from the template
output, given an input model.
* Each JET2 template is complied into a Java class, and has a generate
method, but the method signature is different:
generate(JET2Context context, JET2Writer out)
* Typically, JET2 users DO NOT WRITE Java classes the consume these template
classes. Instead, they either invoke the JET Transformation using a the
Eclipse UI, or they use a JET API (JET2Platform.runTransformOnXXX()) to
launch the transformation from their Java code.
* A JET Transformation can override another, selectively replacing
templates. This requires no Java programming, just the creation of another
JET Project.
* The generated Java classes have dependencies on the org.eclipse.jet
plug-in, which in turn has dependencies on Eclipse. JET2 templates and
transformations must run with in the Eclipse environment.
* The next release of JET2 will include backward compatible compilation of
"Classic JET" templates. This will be in the Europa release (June 2007)
"Bob Goodman" <goodmanr@us.ibm.com> wrote in message
news:eogp66$s7e$1@utils.eclipse.org...
> I'm trying to use the jet.compile ANT task, but I'm having problem getting
> the generated code.
>
> The ANT task looks like the following
>
> <jet.compile project="org.eclipse.atf.generator"
> destDir="plugins/org.eclipse.atf.generator/src-generated">
> <srcdir dir="plugins/org.eclipse.atf.generator/templates"/>
> </jet.compile>
>
> I get the following messaging print in the output
>
> postFetch:
> [jet.compile] destdir: plugins/org.eclipse.atf.generator/src-generated
> [jet.compile] Compiling: appWizard.javajet
> [jet.compile] Compiling: builder.javajet
> [jet.compile] Compiling: facetInstallDelegate.javajet
> [jet.compile] Compiling: facetUninstallDelegate.javajet
> [jet.compile] Compiling: nature.javajet
> [jet.compile] Compiling: runtimehandler.javajet
> [jet.compile] Compiling: templateContextType.javajet
>
> Everything seems to run correctly, but I don't get the generated code.
>
> Thanks
> Bob
>
>
>
>
>
|
|
|
|
Re: Problem using jet.compile ANT task [message #601322 is a reply to message #68121] |
Tue, 16 January 2007 16:50 |
Paul Elder Messages: 849 Registered: July 2009 |
Senior Member |
|
|
Bob:
The jet.compile task compiles "JET2" templates. Looking at your build
output, I'd guess that you are using what I would call "Classic JET" - the
JET that is included with EMF.
I think the task you want to use is emf.JETEmitter. See:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. emf.doc/references/javadoc/org/eclipse/emf/ant/taskdefs/code gen/JETEmitterTask.html
If you are really using JET2, then you need to add .javajet as an extension
recognized by the compiler on the particular project. See the EMFT JET page
in the project's Properties dialog if that is the case.
FYI, the salient differences between the two are:
Classic JET
* Based on JSP scriptlets <%= ... %> and expressions <% ... %>
* Each template creates a Java class with a single public method:
String generate(Object argument)
* To consume the template, you must write a Java program that instantiates
the generated Java class and calls this method. You must also write any/all
code necessary to so something useful with the resultant string.
* The implementer of the Java program that consumes templates can, through
the use of the JETEmitter class, allow users to provider their own
implementations of some or all of the templates
* The generated Java class has no Eclipse dependencies (unless the contained
scriptlets and expressions create these).
EMFT JET (JET2)
* Based on JSP scriptlets AND JSP Tag library concepts
* JET2 plug-ins are complete 'programs'. There is no need to write Java code
to produce a 'code generation' type program (called a JET Transformation)
that runs a set of templates and creates a bunch of files from the template
output, given an input model.
* Each JET2 template is complied into a Java class, and has a generate
method, but the method signature is different:
generate(JET2Context context, JET2Writer out)
* Typically, JET2 users DO NOT WRITE Java classes the consume these template
classes. Instead, they either invoke the JET Transformation using a the
Eclipse UI, or they use a JET API (JET2Platform.runTransformOnXXX()) to
launch the transformation from their Java code.
* A JET Transformation can override another, selectively replacing
templates. This requires no Java programming, just the creation of another
JET Project.
* The generated Java classes have dependencies on the org.eclipse.jet
plug-in, which in turn has dependencies on Eclipse. JET2 templates and
transformations must run with in the Eclipse environment.
* The next release of JET2 will include backward compatible compilation of
"Classic JET" templates. This will be in the Europa release (June 2007)
"Bob Goodman" <goodmanr@us.ibm.com> wrote in message
news:eogp66$s7e$1@utils.eclipse.org...
> I'm trying to use the jet.compile ANT task, but I'm having problem getting
> the generated code.
>
> The ANT task looks like the following
>
> <jet.compile project="org.eclipse.atf.generator"
> destDir="plugins/org.eclipse.atf.generator/src-generated">
> <srcdir dir="plugins/org.eclipse.atf.generator/templates"/>
> </jet.compile>
>
> I get the following messaging print in the output
>
> postFetch:
> [jet.compile] destdir: plugins/org.eclipse.atf.generator/src-generated
> [jet.compile] Compiling: appWizard.javajet
> [jet.compile] Compiling: builder.javajet
> [jet.compile] Compiling: facetInstallDelegate.javajet
> [jet.compile] Compiling: facetUninstallDelegate.javajet
> [jet.compile] Compiling: nature.javajet
> [jet.compile] Compiling: runtimehandler.javajet
> [jet.compile] Compiling: templateContextType.javajet
>
> Everything seems to run correctly, but I don't get the generated code.
>
> Thanks
> Bob
>
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.05185 seconds