Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Modules recompilation(How to recompile acceleo modules outside Eclipse)
| |
Re: [Acceleo] Modules recompilation [message #541923 is a reply to message #541741] |
Wed, 23 June 2010 07:42 |
|
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 #542198 is a reply to message #542176] |
Thu, 24 June 2010 08:37 |
|
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 08:50 |
|
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 #543722 is a reply to message #543716] |
Wed, 30 June 2010 12:00 |
|
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 #544175 is a reply to message #543974] |
Thu, 01 July 2010 22:02 |
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:
- retrieive the paths of all compiled project dependencies and stock them,
- stock the plugin dependencies path also ,
- 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 22:03] Report message to a moderator
|
|
| | | | | |
Goto Forum:
Current Time: Sat Dec 21 15:13:11 GMT 2024
Powered by FUDForum. Page generated in 0.04004 seconds
|