Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Project jar dependencies in standalone compilation
[Acceleo] Project jar dependencies in standalone compilation [message #704102] Thu, 28 July 2011 09:25 Go to next message
Sebastien Roy is currently offline Sebastien RoyFriend
Messages: 51
Registered: November 2009
Member
Hello,

Some time ago I've written a set of acceleo (3.0.0) projects, which compilation and generation are triggered by maven mechanisms.

I am currently considering the migration of my work to the last version of Acceleo (3.1.0).
Reading the documentation, tutorials, etc, of version 3.1.0, I can see that the maven and standalone compilation support have been considerably improved since 3.0.0.

I have however the following question :

Is there a way to compile an acceleo project that has an (e)mtl dependency contained in a jar file ?

In the AcceleoCompiler.java, created through the Configure/Create pom.xml menu, the 4th argument deals with the project dependencies. However, I'm not sure that giving the path of a jar file will be enough...

Is there a way to also take contents of jar files into account for the dependencies ?

Regards,

Sebastien
Re: [Acceleo] Project jar dependencies in standalone compilation [message #707276 is a reply to message #704102] Mon, 01 August 2011 12:22 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Sébastien,

Handling this kind of use cases was the goal of the "maven" developments on Acceleo. However, I must admit that I myself hasn't tested it yet, and that the person in charge of this integration is currently in holidays. We are currently in the process of integrating this with the EEF team, but that too is on hold for a while and will start again at the end of August.

This is unfortunately all I can answer for now : "yes, it should work" but "no, I can't give you directions as to what to put as the dependencies". Stéphane had explained a little more about this feature on his blog.

Laurent Goubet
Obeo
Re: [Acceleo] Project jar dependencies in standalone compilation [message #713215 is a reply to message #707276] Mon, 08 August 2011 08:28 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien RoyFriend
Messages: 51
Registered: November 2009
Member
Thank you Laurent for your answer.
I'm happy that this use case has been taken into consideration.
I have some internal change requests to apply to the work I delivered last year, and the migration to 3.1 version of Accelo will be made at the same time. Hovever, I have no planning defined for this work at this time. Furthermore, I'm not sure if the work will be made by myself or by another team.
Could I ask you to notify me on the test results ? If Accelo/EMF can now handle jar dependencies I can remove the workaround I've put into my build procedure...

Regards

Sebastien
Re: [Acceleo] Project jar dependencies in standalone compilation [message #722279 is a reply to message #704102] Mon, 05 September 2011 08:35 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 38
Registered: March 2011
Member
Hi!

I'm currently having more or less the same problems. I'm not using maven, but a custom Ant task that is working great as long as I don't have template deps outside my project.

I would be very interested by a workaround, if the fix for this is not coming very soon Smile
Re: [Acceleo] Project jar dependencies in standalone compilation [message #722953 is a reply to message #722279] Wed, 07 September 2011 09:51 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien RoyFriend
Messages: 51
Registered: November 2009
Member
Hello Marc,
My workaround is currently very simple but not perfect :
In my build sequence, i copy the dependencies source files into my target library sources.

The problem are :
- I have to maintain a source directory of the dependencies.
- There is no version management
- The source path must be adapted from one team member to another
- ...

Re: [Acceleo] Project jar dependencies in standalone compilation [message #725275 is a reply to message #722953] Wed, 14 September 2011 12:11 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 38
Registered: March 2011
Member
Ok, thanks for the hint. I think I'll do something similar until this is fixed in acceleo... But it's not very convenient Sad
Re: [Acceleo] Project jar dependencies in standalone compilation [message #728580 is a reply to message #725275] Fri, 23 September 2011 13:55 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

A fix has been contributed in the latest nightly build, available here: https://hudson.eclipse.org/hudson/job/m2t-acceleo-master/52/
It should work if you write the absolute path of your jars in your dependency, like this: C:\....\lib\myAcceleoGenerator.jar
You can see if it works by looking in the compiled "emtl" files to see if the references have been translated to "platform:/plugin" ones.
You can also easily overwrite the API to change how jars and other dependencies may be discovered. Of course since it's a nightly build, be careful with it.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo] Project jar dependencies in standalone compilation [message #730933 is a reply to message #728580] Thu, 29 September 2011 14:58 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 38
Registered: March 2011
Member
Stephane Begaudeau wrote on Fri, 23 September 2011 09:55
Hi,
Of course since it's a nightly build, be careful with it.


So, I tried this nightly. And now, I get a load of error in the console when generating code Smile. I have not even tried to use the standalone compiler yet...

Maybe I should have been more careful, maybe I have no luck... I will try to post a message when I understand more precisely what is happening Sad
Re: [Acceleo] Project jar dependencies in standalone compilation [message #731815 is a reply to message #730933] Mon, 03 October 2011 08:02 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Quote:
So, I tried this nightly. And now, I get a load of error in the console when generating code


If you have an idea on the source of the problem, feel free to report it. Your feedback could be very valuable.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: [Acceleo] Project jar dependencies in standalone compilation [message #734347 is a reply to message #728580] Fri, 07 October 2011 14:05 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 38
Registered: March 2011
Member
Stephane Begaudeau wrote on Fri, 23 September 2011 09:55
Hi,

A fix has been contributed in the latest nightly build, available here: https://hudson.eclipse.org/hudson/job/m2t-acceleo-master/52/
It should work if you write the absolute path of your jars in your dependency, like this: C:\....\lib\myAcceleoGenerator.jar
You can see if it works by looking in the compiled "emtl" files to see if the references have been translated to "platform:/plugin" ones.
You can also easily overwrite the API to change how jars and other dependencies may be discovered. Of course since it's a nightly build, be careful with it.


Could you give a bit more details ? I've updated my acceleo to latest nightly (3.2.0.v20111007-0105) and I've still problems using a standalone compiler when module dependencies are inside jars. I'm using 'ivy' to handle dependencies and all my jars are in the classpath when calling the standalone acceleo ant task:
<target name="compile-acceleo" depends="resolve">
  <taskdef name="acceleo" 
   classname="acceleo.standalone.compiler.AcceleoStandaloneCompiler"
   classpathref="lib.path.id"/>
   <acceleo sourceFolder="${src.dir}"
     outputFolder="${classes.dir}"
     binaryResource="false"
     dependencies=""
     packagesToRegister="" />
</target>


I guess there is something to do with this "dependencies" but I'm not sure. Am I supposed to use something like:

...
   dependencies="/abs/path/to/dep1.jar"
...

?
Because it is not working :

[acceleo] 3:Module a::b::c::backend::acceleo::templates::expressions not found


Even if the jar 'dep1.jar' has the 'a/b/c/backend/acceleo/templates/expressions.emtl' file inside.
Re: [Acceleo] Project jar dependencies in standalone compilation [message #734402 is a reply to message #734347] Fri, 07 October 2011 16:13 Go to previous messageGo to next message
Marc Missing name is currently offline Marc Missing nameFriend
Messages: 38
Registered: March 2011
Member
[looks like I can get it to work, but I'm still having issues with modules that extends a module located in an other jar]

EDIT: 5min later I find a fix Smile If my module A extends module B, and C uses A, I need to import B in C. Not sure this is the expected thing to do ? Importing B in A does not help...

[Updated on: Fri, 07 October 2011 16:16]

Report message to a moderator

Re: [Acceleo] Project jar dependencies in standalone compilation [message #735203 is a reply to message #734402] Tue, 11 October 2011 08:29 Go to previous message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 458
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

It is not expected and it was coming from a bug that should be fixed for Acceleo 3.2.0 RC2. The problem could also have appeared in a regular build of an Acceleo generator (in the workspace). ".emtl" files used to be bloated with unused content so now we are removing useless information, we did not take into account overridden templates to determine if a given template signature should be removed.

Thanks for reporting this problem, a fix has been contributed on HEAD and it will be available in the next nightly build so you'll be able to see if that fixes your problem. (It did on my examples but just to be sure). The build system is currently under maintenance so it may take few hours to have a nightly build. I'll contribute new unit tests for this issue in the meantime.


Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo

[Updated on: Tue, 11 October 2011 08:29]

Report message to a moderator

Previous Topic:XPandfacade and Check
Next Topic:[Acceleo] Annotations of templates
Goto Forum:
  


Current Time: Thu Mar 28 18:59:01 GMT 2024

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

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

Back to the top