Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » JET <ws:project...> effect
JET <ws:project...> effect [message #47328] Thu, 26 June 2008 12:45 Go to next message
Eugen Paraschiv is currently offline Eugen Paraschiv
Messages: 3
Registered: July 2009
Junior Member
I've been using JET for a short time and until now I had no need for
complex workspace navigation. Now I'm trying to get my bearings with this
functionality and I encountered a small problem. It may be solved already
in a different post (I admit I did not read all of the posts here,
although I plan to); the problems is that when the JET engine processes
the <ws:project...> tag, and a new project is created into the Eclipse
workbench, that project is a general and not a Java project; This is a
problem for the following execution, and my model processing results in an
error; The only workaround I found for this is to add the java nature by
hand in the XML configuration of the project. Is there any other way to do
this?
Re: JET <ws:project...> effect [message #47374 is a reply to message #47328] Fri, 27 June 2008 18:10 Go to previous message
Paul Elder is currently offline Paul Elder
Messages: 849
Registered: July 2009
Senior Member
Eugen:

While JET has no tags to create a complete Java project, all is not lost.

All the project meta-data is stored within files in the workspace. The best
way to find out what the files are is to create a Java project using the
wizards, and then take a look at in the package explorer with the ".*
resources" filter off.

From experience, you need at least:

..project - an XML document that contains the project name, and the
builders and natures for a Java project. Typically, you only need to change
the project name.
..classpath - an XML document that defines the classpath. Typically, you
don't need to change this at all.
src - the Java source folder - the Java builders complain
bitterly if they cannot find this directory.

So, something like the following should work:

====== main.jet ============

<c:setVariable var="java.project" select=" 'my.test.jp' "/>
<ws:project name="{$java.project">
<ws:file path=".project" template="templates/java.project/project.jet"/>
<ws:file path=".classpath"
template="templates/java.project/classpath.jet"/>
<ws:folder path="src"/>
</ws:project>

==== project.jet ====
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name><c:get select="$java.project" /></name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

======= classpath.jet ===========
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>


Paul
Previous Topic:How to Profile a JET transform?
Next Topic:Generating OCL from Model
Goto Forum:
  


Current Time: Thu Sep 18 19:53:35 GMT 2014

Powered by FUDForum. Page generated in 0.01550 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software