Skip to main content



      Home
Home » Modeling » EMF » How to generate both RCP and GWT from the same code base?(Write once, deploy both RCP and GWT?)
How to generate both RCP and GWT from the same code base? [message #1062105] Thu, 06 June 2013 00:14 Go to next message
Eclipse UserFriend
I have (had...) a working EMF model, generated to RCP and running fine. Then I decided to generate to GWT and now I can not seem to get back to a working RCP version. (Mac OS X, Indigo). What I did was:

(1) changed by target following the instructions here
http://wiki.eclipse.org/EMF/GWT.

(2) I then changed my .genmodel to generate for GWT. That did not build. (3) I then changed my target back to the default platform, then re-generated for RCP. Now a big mess.Needing to reinstall my IDE.

What did I do wrong? I am guessing that I should not have generated GWT on top of existing project structure for RCP?.

So..., what is the recommended way to write one .ecore and then use two different .genmodels (one for RCP, the other GWT), and be able to use all the custom (@generated NOT) code. Is it ok to use the same workspace for both GWT and RCP generated EMF models?

Thanks
Re: How to generate both RCP and GWT from the same code base? [message #1062117 is a reply to message #1062105] Thu, 06 June 2013 02:04 Go to previous message
Eclipse UserFriend
Edward,

Comments below.

On 06/06/2013 6:14 AM, Edward MacKerrow wrote:
> I have (had...) a working EMF model, generated to RCP and running
> fine. Then I decided to generate to GWT and now I can not seem to get
> back to a working RCP version. (Mac OS X, Indigo). What I did was:
>
> (1) changed by target following the instructions here
> http://wiki.eclipse.org/EMF/GWT.
>
> (2) I then changed my .genmodel to generate for GWT. That did not
> build. (3) I then changed my target back to the default platform,
> then re-generated for RCP. Now a big mess.
The GWT generated code has annotations that need GWT and JMerge doesn't
remove such annotations. Things like the natures and builders added to
the .project would not be removed either.
> Needing to reinstall my IDE.
There should be no general problem with GWT installed in the IDE. I
have installations where both the EMF GWT runtime and the EMF standard
runtime coexist and both compile properly.
>
> What did I do wrong? I am guessing that I should not have generated
> GWT on top of existing project structure for RCP?.
Until EMF 2.9, plugin.xml and MANIFEST.MF did not support merging, so
generating into an existing project wouldn't update some import things,
e.g., the classpath as specified by the MANIFEST.MF.
>
> So..., what is the recommended way to write one .ecore and then use
> two different .genmodels (one for RCP, the other GWT), and be able to
> use all the custom (@generated NOT) code.
They can't really coexist unless you play some games. Stubs for the
GWT annotations would be needed for them to compile against the standard
runtime. I know the Cloudsmith folks have done something like that and
got it working.
> Is it ok to use the same workspace for both GWT and RCP generated EMF
> models?
Yes I've certainly had that working. But, as you can see, the bundles
for the GWT versions and the standard versions are separate, so if you
want a generated model that serves both purposes, that's no completely
trivial...
>
> Thanks
>
Previous Topic:[CDO] NPE from CDOResourceFolder conflict?
Next Topic:How generate XMI, XSD, XML files form an ecore file or an ecorediag file
Goto Forum:
  


Current Time: Fri Jul 18 18:49:02 EDT 2025

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

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

Back to the top