Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Modules recompilation(How to recompile acceleo modules outside Eclipse)
[Acceleo] Modules recompilation [message #541738] Tue, 22 June 2010 08:02 Go to next message
koita Aboubakar is currently offline koita Aboubakar
Messages: 11
Registered: April 2010
Junior Member

Hi,

I would know if it there is a mean for recompile acceleo modules (*.mtl) outside Eclipse.

Thanks,

Aboubakar
Re: [Acceleo] Modules recompilation [message #541741 is a reply to message #541738] Tue, 22 June 2010 08:07 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello,
compilation outside Eclipse is possible.
However, it is not documented and not trivial.
I think you should ask for help to Obeo
Re: [Acceleo] Modules recompilation [message #541923 is a reply to message #541741] Wed, 23 June 2010 03:42 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070903000702050700060606
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

As Sebastien mentioned, standalone compilation is possible ... but
you'll have to get your hands dirty.

In short, we defined an ANT task in the plugin
'org.eclipse.acceleo.parser' that you can use for standalone
compilation. This task is located in the "acceleoCompiler" jar file that
you can retrieved here :
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2t/org .eclipse.acceleo/plugins/org.eclipse.acceleo.parser/lib/acce leoCompiler.jar?revision=1.6&root=Modeling_Project
..

You can use this ANT task with the following : <acceleoCompiler
sourceFolders="path1;path2;path3....."/>

For example, here is how we use it in the Eclipse builds :
<target name="post.gather.bin.parts">
<acceleoCompiler sourceFolders="${target.folder}"/>
</target>

You'll need to have the proper classpath defined to use this; at the
very least
org.eclipse.acceleo.common
org.eclipse.acceleo.model
org.eclipse.acceleo.parser
org.eclipse.core.runtime
org.eclipse.emf.ecore
org.eclipse.emf.ecore.xmi
org.eclipse.ocl
org.eclipse.ocl.ecore

If you wish to recompile mtl files through pure java instead of using
ANT, you'll have to take a look at the AcceleoCompiler task source code
:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2t/org .eclipse.acceleo/plugins/org.eclipse.acceleo.parser/src-ant/ org/eclipse/acceleo/parser/compiler/AcceleoCompiler.java?rev ision=1.13&root=Modeling_Project&view=markup

And reproduce something similar.

Laurent Goubet
Obeo

Sebastien Roy wrote:
> Hello,
> compilation outside Eclipse is possible.
> However, it is not documented and not trivial.
> I think you should ask for help to Obeo


--------------070903000702050700060606
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070903000702050700060606--
Re: [Acceleo] Modules recompilation [message #542176 is a reply to message #541923] Thu, 24 June 2010 03:27 Go to previous messageGo to next message
koita Aboubakar is currently offline koita Aboubakar
Messages: 11
Registered: April 2010
Junior Member
Hi,

Thank you for your answers.

Laurent, I get dirty hands, for sure Smile, but my goal is to make the whole process of generation outside Eclipse.

On this point precisely, I have a problem compiling modules. I get the following error by launching AcceleoCompiler (with ant and standalone execution):

org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.net.UnknownHostException: www.eclipse.org
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:346)
	at org.eclipse.acceleo.common.utils.AcceleoStandardLibrary.<init>(AcceleoStandardLibrary.java:194)
	at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoEnvironment.getAcceleoStandardLibrary(AcceleoEnvironment.java:252)
	at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoEnvironment.addAdditionalOperations(AcceleoEnvironment.java:386)
	at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoEnvironment.<init>(AcceleoEnvironment.java:101)
	at org.eclipse.acceleo.internal.compatibility.parser.ast.ocl.environment.AcceleoEnvironmentGalileo.<init>(AcceleoEnvironmentGalileo.java:85)
	at org.eclipse.acceleo.internal.parser.ast.ocl.environment.AcceleoEnvironmentFactory.loadEnvironment(AcceleoEnvironmentFactory.java:61)
	at org.eclipse.ocl.OCL.<init>(OCL.java:127)
	at org.eclipse.ocl.ecore.OCL.<init>(OCL.java:90)
	at org.eclipse.ocl.ecore.OCL.newInstance(OCL.java:151)
	at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.init(OCLParser.java:132)
	at org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.<init>(OCLParser.java:122)
	at org.eclipse.acceleo.internal.parser.ast.ASTFactory.initOCL(ASTFactory.java:133)
	at org.eclipse.acceleo.internal.parser.ast.CST2ASTConverter.createAST(CST2ASTConverter.java:127)
	at org.eclipse.acceleo.parser.AcceleoSourceBuffer.createAST(AcceleoSourceBuffer.java:298)
	at org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser.java:159)
	at north.eqdml.dependencies.AcceleoCompiler.execute(AcceleoCompiler.java:191)
	at north.eqdml.AcceleoCompilerTest.executeTest(AcceleoCompilerTest.java:22)
.
.
.


Have you any ideas for solve this error ?

Thanks,

Aboubakar
Re: [Acceleo] Modules recompilation [message #542198 is a reply to message #542176] Thu, 24 June 2010 04:37 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000101040409050406080701
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Hi,

This error is due to missing URI mappings and package registrations (all
of these are normally taken care of by Eclipse, yet you are in standalone).

Namely, you need to add the URI mappings for our libraries (this is the
source of the exception you copy/pasted here) :
URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore",
" platform:/plugin/org.eclipse.acceleo.model/model/mtlstdlib.e core ");
URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore",
" platform:/plugin/org.eclipse.acceleo.model/model/mtlnonstdli b.ecore ");

and afterwards, you'll most likely have exceptions of type "package with
URI '*' not found. Take a look at
http://eclipsemde.blogspot.com/2010/06/package-with-uri-not- found.html
for explanations on the source and solution of these if you encounter them.

Laurent Goubet
Obeo

koïta Aboubakar wrote:
> Hi,
>
> Thank you for your answers.
>
> Laurent, I get dirty hands, for sure :), but my goal is to make the
> whole process of generation outside Eclipse.
>
> On this point precisely, I have a problem compiling modules. I get the
> following error by launching AcceleoCompiler (with ant and standalone
> execution):
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
> java.net.UnknownHostException: www.eclipse.org
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>
> at
> org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils. java:346)
> at
> org.eclipse.acceleo.common.utils.AcceleoStandardLibrary.<init >(AcceleoStandardLibrary.java:194)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.getAcceleoStandardLibrary(AcceleoEnvironment. java:252)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.addAdditionalOperations(AcceleoEnvironment.ja va:386)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment. <init>(AcceleoEnvironment.java:101)
>
> at
> org.eclipse.acceleo.internal.compatibility.parser.ast.ocl.en vironment.AcceleoEnvironmentGalileo. <init>(AcceleoEnvironmentGalileo.java:85)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironmentFactory.loadEnvironment(AcceleoEnvironmentFact ory.java:61)
>
> at org.eclipse.ocl.OCL.<init>(OCL.java:127)
> at org.eclipse.ocl.ecore.OCL.<init>(OCL.java:90)
> at org.eclipse.ocl.ecore.OCL.newInstance(OCL.java:151)
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.init(O CLParser.java:132)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.<init >(OCLParser.java:122)
>
> at
> org.eclipse.acceleo.internal.parser.ast.ASTFactory.initOCL(A STFactory.java:133)
>
> at
> org.eclipse.acceleo.internal.parser.ast.CST2ASTConverter.cre ateAST(CST2ASTConverter.java:127)
>
> at
> org.eclipse.acceleo.parser.AcceleoSourceBuffer.createAST(Acc eleoSourceBuffer.java:298)
>
> at
> org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser .java:159)
> at
> north.eqdml.dependencies.AcceleoCompiler.execute(AcceleoComp iler.java:191)
> at
> north.eqdml.AcceleoCompilerTest.executeTest(AcceleoCompilerT est.java:22)


--------------000101040409050406080701
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------000101040409050406080701--
Re: [Acceleo] Modules recompilation [message #542201 is a reply to message #542198] Thu, 24 June 2010 04:50 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070304020004080203090204
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Sorry, my bad. The URI Mappings to register of course aren't
"platform:/plugin" as those URIs are eclipse specific and absolutely not
standalone.

Sebastien Roy faced the same problems as you, and managed to single out
the URI mappings and diverse registrations to the following few (Java
code) :

-----8<-----

Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "ecore",
new EcoreResourceFactoryImpl());
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "emtl",
new EMtlResourceFactoryImpl());
// Uncomment if you need to use UML
//
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put( "uml",
UMLResource.Factory.INSTANCE);

// Uncomment if you need to use UML
// EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
// Uncomment if you need to use an UML model created with an old version
of MDT/UML
//
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/uml2/2.1.0/UML",
UMLPackage.eINSTANCE);

CodeSource acceleoModel =
MtlPackage.class.getProtectionDomain().getCodeSource();
if (acceleoModel != null) {
String libraryLocation = acceleoModel.getLocation().toString();
if (libraryLocation.endsWith(".jar")) {
libraryLocation = "jar:" + libraryLocation + '!';
}
URIConverter.URI_MAP.put(URI.createURI("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore"),
URI.createURI(libraryLocation + "/model/mtlstdlib.ecore"));
URIConverter.URI_MAP.put(URI.createURI("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore"),
URI.createURI(libraryLocation + "/model/mtlnonstdlib.ecore"));
} else {
System.err.println("Coudln't retrieve location of plugin
'org.eclipse.acceleo.model'.");
}

----->8-----

Thanks to Sebastien Roy for sharing his solution :).

Laurent Goubet
Obeo

Laurent Goubet wrote:
> Hi,
>
> This error is due to missing URI mappings and package registrations (all
> of these are normally taken care of by Eclipse, yet you are in standalone).
>
> Namely, you need to add the URI mappings for our libraries (this is the
> source of the exception you copy/pasted here) :
> URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlstdlib.ecore",
> " platform:/plugin/org.eclipse.acceleo.model/model/mtlstdlib.e core ");
> URIConverter.URI_MAP.put("http://www.eclipse.org/acceleo/mtl/3.0/mtlnonstdlib.ecore",
> " platform:/plugin/org.eclipse.acceleo.model/model/mtlnonstdli b.ecore ");
>
> and afterwards, you'll most likely have exceptions of type "package with
> URI '*' not found. Take a look at
> http://eclipsemde.blogspot.com/2010/06/package-with-uri-not- found.html
> for explanations on the source and solution of these if you encounter them.
>
> Laurent Goubet
> Obeo
>
> koïta Aboubakar wrote:
>> Hi,
>>
>> Thank you for your answers.
>>
>> Laurent, I get dirty hands, for sure :), but my goal is to make the
>> whole process of generation outside Eclipse.
>>
>> On this point precisely, I have a problem compiling modules. I get the
>> following error by launching AcceleoCompiler (with ant and standalone
>> execution):
>>
>>
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1Diagnos ticWrappedException:
>> java.net.UnknownHostException: www.eclipse.org
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDe mandLoadException(ResourceSetImpl.java:315)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:274)
>>
>> at
>> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
>>
>> at
>> org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils. java:346)
>> at
>> org.eclipse.acceleo.common.utils.AcceleoStandardLibrary.<init >(AcceleoStandardLibrary.java:194)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.getAcceleoStandardLibrary(AcceleoEnvironment. java:252)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment.addAdditionalOperations(AcceleoEnvironment.ja va:386)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironment. <init>(AcceleoEnvironment.java:101)
>>
>> at
>> org.eclipse.acceleo.internal.compatibility.parser.ast.ocl.en vironment.AcceleoEnvironmentGalileo. <init>(AcceleoEnvironmentGalileo.java:85)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.environment.Acce leoEnvironmentFactory.loadEnvironment(AcceleoEnvironmentFact ory.java:61)
>>
>> at org.eclipse.ocl.OCL.<init>(OCL.java:127)
>> at org.eclipse.ocl.ecore.OCL.<init>(OCL.java:90)
>> at org.eclipse.ocl.ecore.OCL.newInstance(OCL.java:151)
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.init(O CLParser.java:132)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ocl.OCLParser.<init >(OCLParser.java:122)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.ASTFactory.initOCL(A STFactory.java:133)
>>
>> at
>> org.eclipse.acceleo.internal.parser.ast.CST2ASTConverter.cre ateAST(CST2ASTConverter.java:127)
>>
>> at
>> org.eclipse.acceleo.parser.AcceleoSourceBuffer.createAST(Acc eleoSourceBuffer.java:298)
>>
>> at
>> org.eclipse.acceleo.parser.AcceleoParser.parse(AcceleoParser .java:159)
>> at
>> north.eqdml.dependencies.AcceleoCompiler.execute(AcceleoComp iler.java:191)
>>
>> at
>> north.eqdml.AcceleoCompilerTest.executeTest(AcceleoCompilerT est.java:22)
>


--------------070304020004080203090204
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070304020004080203090204--
Re: [Acceleo] Modules recompilation [message #542210 is a reply to message #541738] Thu, 24 June 2010 05:12 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello,

Even if the compilation works fine with the code above, I currently have a problem with Maven and the AcceloCompiler classpath :


  • I created a project containing a class that inherits from acceleo compiler and that performs all needed registrations before execution.
  • I put all accelo, emf, uml, ... dependencies in the dependencies of the project.
  • In all my acceleo projects, I created a antrun-plugin section that define a taskdef using my compiler class

My problem is that the classpath given to my compiler class contains only de compiler dependencies, not the compiled project dependencies.

Does someone know how to add the project dependencies to the compiler classpath ?

Regards

Sebastien
Re: [Acceleo] Modules recompilation [message #542874 is a reply to message #542210] Sat, 26 June 2010 18:45 Go to previous messageGo to next message
Koïta Aboubakar is currently offline Koïta Aboubakar
Messages: 3
Registered: June 2010
Junior Member
Hello ,

Thanks to Laurent ans Sebastien, I solved the problem by following your indication.


To Sebastien. I use maven for whole generation process, and this work fine.
I do not see why you want add the dependences of your to those of the compiler, but I can alway show you how I proceded :

  1. I packaged the Acceleo compiler in maven plugin
  2. Then I included the Acceleo compiler plugin in my Acceleo project builded with Maven.

As you can see, with this choice, the Acceleo compiler don't need Acceleo projects dependencies.

Aboubakar


Re: [Acceleo] Modules recompilation [message #543009 is a reply to message #542874] Mon, 28 June 2010 04:15 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello,

Thank your for your advice. I will try creating a maven plugin instead of the ant task.
Actually, the compiler must be aware of the acceleo dependencies only when there are mtl imports from outside the currently compiled project. If all the imported mtl modules are defined inside the project, there will not be any problem, in any case.

I will keep you informed.

Sebastien
Re: [Acceleo] Modules recompilation [message #543033 is a reply to message #543009] Mon, 28 June 2010 05:09 Go to previous messageGo to next message
koita Aboubakar is currently offline koita Aboubakar
Messages: 11
Registered: April 2010
Junior Member
Hello,

When you said "dependencies", I didn't thought to mtl depencies, because all templates I import actually are internal to my project.

Else, for mtl external dependencies resolution, you know probably, you should rather examine the compiler "computeDependencies" method.

Think you for keep me informed.

Aboubakar
Re: [Acceleo] Modules recompilation [message #543716 is a reply to message #543033] Wed, 30 June 2010 07:45 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello Aboubakar,
I've just created a maven plugin for Accelo Compiler.

I have the same problems than with the ant task : the maven doesn't add the compiled project dependencies to the class path. The class path only contains the copiler dependencies.

Do you know how to add these dependencies to the classpath ?

Sebastien

Re: [Acceleo] Modules recompilation [message #543722 is a reply to message #543716] Wed, 30 June 2010 08:00 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent Goubet
Messages: 1625
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------070405070209060705020905
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Sebastien, aboubakar,

I don't think maven experts will read this thread, you might be able to
get some help on this on the tycho newsgroup (maven integration with OSGi)?

I don't know if you'll get an answer as this is maven specific and not
tycho related but I know for sure that I cannot answer :p.

Laurent Goubet
Obeo

Sebastien Roy wrote:
> Hello Aboubakar,
> I've just created a maven plugin for Accelo Compiler.
>
> I have the same problems than with the ant task : the maven doesn't add
> the compiled project dependencies to the class path. The class path only
> contains the copiler dependencies.
>
> Do you know how to add these dependencies to the classpath ?
>
> Sebastien
>
>


--------------070405070209060705020905
Content-Type: text/x-vcard; charset=utf-8;
name="laurent_goubet.vcf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="laurent_goubet.vcf"

YmVnaW46dmNhcmQNCmZuOkxhdXJlbnQgR291YmV0DQpuOkdvdWJldDtMYXVy ZW50DQpvcmc6
PGEgaHJlZj0iaHR0cDovL3d3dy5vYmVvLmZyIj5PYmVvPC9hPg0KZW1haWw7 aW50ZXJuZXQ6
bGF1cmVudC5nb3ViZXRAb2Jlby5mcg0KdXJsOmh0dHA6Ly93d3cub2Jlby5m cg0KdmVyc2lv
bjoyLjENCmVuZDp2Y2FyZA0KDQo=
--------------070405070209060705020905--
Re: [Acceleo] Modules recompilation [message #543878 is a reply to message #543716] Wed, 30 June 2010 18:24 Go to previous messageGo to next message
Koïta Aboubakar is currently offline Koïta Aboubakar
Messages: 3
Registered: June 2010
Junior Member
Hello Sebastien,

As I said , I don't understand why the compiler must have the compiled project dependencies. The compiler need only the root directorys containing mtl files, alright ? And if your mtl modules have eventual dependencies to emtls , we must also give to compiler directorys containing these emtls.

For example, in my maven generation project pom, I use the Acceleo compiler packaged in maven plugin like this ( my templates are in /src/main/java folder ) :

			<plugin>
				<groupId>north.org.eclipse.acceleo</groupId>
				<artifactId>acceleo-compiler</artifactId>
				<version>1.0.0-SNAPSHOT</version>
				<configuration>
					<sourceFolders>
						<param>${basedir}/src/main/java</param>
					</sourceFolders>
				</configuration>
				<executions>
					<execution>
						<goals>
							<goal>acceleocompile</goal>
						</goals>
					</execution>
				</executions>
			</plugin>


But maybe I still do not understand your problem ?


Sebastien Roy wrote on Wed, 30 June 2010 07:45
Hello Aboubakar,
I've just created a maven plugin for Accelo Compiler.

I have the same problems than with the ant task : the maven doesn't add the compiled project dependencies to the class path. The class path only contains the copiler dependencies.

Do you know how to add these dependencies to the classpath ?

Sebastien





Aboubakar
Re: [Acceleo] Modules recompilation [message #543974 is a reply to message #543878] Thu, 01 July 2010 04:55 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello Aboubakar,

My problem is that I want to make and use a library of mtl modules. I wrote a set of generic queries, generic transformations that I want to use in several target projects. So all the imported mtl modules are not defined in the currently compiled project. Some are defined in external libraries

Into Eclipse environment it's easy, just export the common package of the library and import them in the target project. Osgi mechanisms are very powerfull.

In standalone compilation, the first step would be to put in the classpath of the compiler the jar file of my external mtl library. That is my current problem

Sebastien
Re: [Acceleo] Modules recompilation [message #544175 is a reply to message #543974] Thu, 01 July 2010 18:02 Go to previous messageGo to next message
Koïta Aboubakar is currently offline Koïta Aboubakar
Messages: 3
Registered: June 2010
Junior Member
Hello Sebastien,

Your problem is now clear to me. If your goal is to put the compiled project dependencies into the Acceleo compiler plugin's classpath, I suggest you to follow these steps at Acceleo compiler launching:


  1. retrieive the paths of all compiled project dependencies and stock them,
  2. stock the plugin dependencies path also ,
  3. Launch a external JVM process to run Acceleo Compiler process. For this JVM classpath, you will give all you want, in all case the compiled project and the compiled dependencies.


( Remarks that the Maven Compiler Plugin should certainly perform a similar process for compile our projects ).

I dont guaranted you that my suggestion will work, but I can assure you that a I done a elementary manipluation of POM of the compiled project in my plugin with succes.


Aboubakar

[Updated on: Thu, 01 July 2010 18:03]

Report message to a moderator

Re: [Acceleo] Modules recompilation [message #546129 is a reply to message #541738] Sun, 11 July 2010 09:41 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie Mordant
Messages: 81
Registered: July 2010
Member

Hi,

I successed compiling templates and generating java sources out of the box (ant task and maven), are you interessed by the sources for community sharing?

Charlie

[Updated on: Mon, 12 July 2010 07:34]

Report message to a moderator

Re: [Acceleo] Modules recompilation [message #548493 is a reply to message #541738] Thu, 22 July 2010 03:40 Go to previous messageGo to next message
koita Aboubakar is currently offline koita Aboubakar
Messages: 11
Registered: April 2010
Junior Member
Hello Sebastien,

If your problem is not solved yet, this might interest you : http:// mojo.codehaus.org/exec-maven-plugin/java-mojo.html#includePr ojectDependencies
Re: [Acceleo] Modules recompilation [message #548501 is a reply to message #548493] Thu, 22 July 2010 04:06 Go to previous messageGo to next message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello Aboubakar,
The exec-maven-plugin looks great. Thank you very much for your feed back.
How did you implement it ? You created a class with a main() method in charge of calling the acceleo compiler ?

As my problem is not solved yet (I still copy my dependencies in each project that need them), I really appreciate your help.
I'm going to try this solution soon.

@Charlie : I'm also interested in your sources. I think it would be helpfull for all the community.
Re: [Acceleo] Modules recompilation [message #548537 is a reply to message #548501] Thu, 22 July 2010 05:51 Go to previous messageGo to next message
koita Aboubakar is currently offline koita Aboubakar
Messages: 11
Registered: April 2010
Junior Member
It's nothing : ) ,
I just use the plugin for the moment to start a Java main class.

Here is a sample usage ( the 2nd sample ) : http://mojo.codehaus.org/exec-maven-plugin/usage.html

I hope it will work.
Re: [Acceleo] Modules recompilation [message #548558 is a reply to message #548537] Thu, 22 July 2010 06:57 Go to previous message
Sebastien Roy is currently offline Sebastien Roy
Messages: 51
Registered: November 2009
Member
Hello Aboubakar,

The exec-maven-plugin works perfectly : I can use it to launch the MtlCompiler with all project dependencies present in the classpath.

However, when I remove the copy of my dependencies, the AcceleoCompiler is not able to find them into the classpath.

I am very disapointed !!!

Now the answer to the problem has to be brought by Acceleo team...
Previous Topic:[Acceleo 3] Intersection on 2 list return string, and not the objects [Solved]
Next Topic:[Acceleo 3] Out of memory
Goto Forum:
  


Current Time: Sat Aug 23 13:23:49 EDT 2014

Powered by FUDForum. Page generated in 0.03849 seconds