Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Ant tasks
EMF Ant tasks [message #629438] Tue, 28 September 2010 09:50 Go to next message
Hallvard Traetteberg is currently offline Hallvard TraettebergFriend
Messages: 673
Registered: July 2009
Location: Trondheim, Norway
Senior Member
Hi,

I have a question about EMF's Ant tasks. I'm able to generate Java
source code from simple genmodel, using the emf.Ecore2Java task. But I
also need to generate from one referencing another. After looking at the
ModelImporter code, I came up with the following:

<project name="Ecore2Java Generation" default="GenerateScxmlxtJava"
basedir="..">
<property name="workspaces.location" value="/Users/hal/java/workspaces"/>
<property name="scxmlxt.location"
value="${workspaces.location}/wazaabi/no.hal.scxmlxt"/>
<property name="model" value="${scxmlxt.location}/model/scxmlxt.ecore"/>
<property name="genmodel"
value="${scxmlxt.location}/model/scxmlxt.genmodel"/>
<property name="mex.location"
value="${workspaces.location}/wazaabi/no.hal.mex"/>
<target name="GenerateScxmlxtJava">
<echo message="Generate the scxmlxt model and edit Java code from the
ecore model"/>
<emf.Ecore2Java model="${model}" genModel="${genmodel}"
reconcileGenModel="reload"
generateJavaCode="true"
generateModelProject="true"
generateEditProject="false"
generateEditorProject="false"
modelProject="no.hal.scxmlxt"
modelProjectFragmentPath="src"
>
<arg line="-editProject no.hal.scxmlxt.edit src"/>
<arg line="-refGenModel file:${mex.location}/model/mex.genmodel
platform:/plugin/no.hal.mex/model/mex.ecore"/>
</emf.Ecore2Java>
</target>
</project>

However, now I get the following message (in the console):
java.net.UnknownServiceException: protocol doesn't support output

Without more specific info. about the actual URI, I don't where the
problem can be. I've tried setting breakpoints in the code that handles
the refGenModel option, but I'm not sure I can debug Ant scripts that
way (at least the breakpoint isn't triggered).

Hallvard
Re: EMF Ant tasks [message #629634 is a reply to message #629438] Wed, 29 September 2010 03:46 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Hallvard,

Comments below.

Hallvard Trætteberg wrote:
> Hi,
>
> I have a question about EMF's Ant tasks. I'm able to generate Java
> source code from simple genmodel, using the emf.Ecore2Java task. But I
> also need to generate from one referencing another. After looking at
> the ModelImporter code, I came up with the following:
>
> <project name="Ecore2Java Generation" default="GenerateScxmlxtJava"
> basedir="..">
> <property name="workspaces.location"
> value="/Users/hal/java/workspaces"/>
> <property name="scxmlxt.location"
> value="${workspaces.location}/wazaabi/no.hal.scxmlxt"/>
> <property name="model"
> value="${scxmlxt.location}/model/scxmlxt.ecore"/>
> <property name="genmodel"
> value="${scxmlxt.location}/model/scxmlxt.genmodel"/>
> <property name="mex.location"
> value="${workspaces.location}/wazaabi/no.hal.mex"/>
> <target name="GenerateScxmlxtJava">
> <echo message="Generate the scxmlxt model and edit Java code
> from the ecore model"/>
> <emf.Ecore2Java model="${model}" genModel="${genmodel}"
> reconcileGenModel="reload"
> generateJavaCode="true"
> generateModelProject="true"
> generateEditProject="false"
> generateEditorProject="false"
> modelProject="no.hal.scxmlxt"
> modelProjectFragmentPath="src"
> >
> <arg line="-editProject no.hal.scxmlxt.edit src"/>
> <arg line="-refGenModel
> file:${mex.location}/model/mex.genmodel
> platform:/plugin/no.hal.mex/model/mex.ecore"/>
> </emf.Ecore2Java>
> </target>
> </project>
>
> However, now I get the following message (in the console):
> java.net.UnknownServiceException: protocol doesn't support output
I imagine it's needed to write to platform:/plugin, which isn't
allowed. Most URL handlers throw exceptions with more detail...
>
> Without more specific info. about the actual URI, I don't where the
> problem can be. I've tried setting breakpoints in the code that
> handles the refGenModel option, but I'm not sure I can debug Ant
> scripts that way (at least the breakpoint isn't triggered).
I'm not sure how to debug ant scripts either... :-(
>
> Hallvard


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Listening for EObject creation
Next Topic:How to filter out GMF references
Goto Forum:
  


Current Time: Wed Apr 24 18:12:39 GMT 2024

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

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

Back to the top