Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Path in generated EMTL files differ when in debug or deployed
[Acceleo] Path in generated EMTL files differ when in debug or deployed [message #964334] Tue, 30 October 2012 08:45 Go to next message
Ansgar Radermacher is currently offline Ansgar Radermacher
Messages: 15
Registered: March 2011
Junior Member
I use Acceleo (3.3.1) to produce code programmatically. This works fine, unless a referenced script imports other scripts (created in different Acceleo projects). In a debug environment (second Eclipse instance), the generated EMTL files reference dependent files by means of relative paths, e.g. in file1.emtl
<imports href="../../.../myplugin/.../file2.emtl#/0"/>
However, when the plugins containing file1 and file2 are deployed, the reference becomes
<imports href="platform:/plugin/myplugin/@dot/.../file2.emtl#/0"/>

The problem is that file1 needs to be referenced differently to handle both cases: either via a URI of style platform:/plugin/... or an absolute path such as file:/your/machine/....
The relative path for file2.emtl is only resolved, if file1.emtl is referenced via an absolute path (without platform:/plugin). But, we need the platform:/plugin URI style for deployed plugins. Since I prefer not to handle two different cases, I would like to configure Acceleo in a way to produce references *always* via the platform:/plugin style. Is that possible?

Thanks

Ansgar

Re: [Acceleo] Path in generated EMTL files differ when in debug or deployed [message #966174 is a reply to message #964334] Wed, 31 October 2012 16:21 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 4003
Registered: July 2009
Senior Member
Hi

You should find that the relative paths are consistent provided you have
platform: consistently defined. Unfortunately EMF provides the required
registries but no standalone initialisation support. You therefore need
to initialize correctly.

You may find
org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap helpful
for initialization. (See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=360926#c7).

In the past, Acceleo tried to be helpful for simple use cases and this
was unhelpful for more interesting usage. After reviewing my code, it no
longer seems to be necessary to fight Acceleo's helpful behaviour. But
beware of helpful Acceleo URI changes if you have trouble.

Regards

Ed Willink



On 30/10/2012 12:45, Ansgar Radermacher wrote:
> I use Acceleo (3.3.1) to produce code programmatically. This works
> fine, unless a referenced script imports other scripts (created in
> different Acceleo projects). In a debug environment (second Eclipse
> instance), the generated EMTL files reference dependent files by means
> of relative paths, e.g. in file1.emtl
> <imports href="../../.../myplugin/.../file2.emtl#/0"/>
> However, when the plugins containing file1 and file2 are deployed, the
> reference becomes
> <imports href="platform:/plugin/myplugin/@dot/.../file2.emtl#/0"/>
>
> The problem is that file1 needs to be referenced differently to handle
> both cases: either via a URI of style platform:/plugin/... or an
> absolute path such as file:/your/machine/.... The relative path for
> file2.emtl is only resolved, if file1.emtl is referenced via an
> absolute path (without platform:/plugin). But, we need the
> platform:/plugin URI style for deployed plugins. Since I prefer not to
> handle two different cases, I would like to configure Acceleo in a way
> to produce references *always* via the platform:/plugin style. Is that
> possible?
>
> Thanks
>
> Ansgar
>
>
Previous Topic:Generation an XMI file to java file
Next Topic:[Acceleo] Error launching main module as Acceleo Application
Goto Forum:
  


Current Time: Fri Jul 25 09:48:11 EDT 2014

Powered by FUDForum. Page generated in 0.02059 seconds