Autonomous Acceleo Generator

I need to develop a standalone Acceleo generator, but I don't know how to get started. I made my generator inside my Acceleo project. The Acceleo project contains a generate.mtl file, a Generate.java file, and an Activator.java file.

What should I do?

+6
java acceleo
source share
1 answer

Acceleo was designed with autonomous generation in mind from the start. For this reason, the file Generate.java exists. If you need to run a generation offline, just use its main or instance with two necessary parameters (target folder and input model) and use the doGenerate(...) method:

 URI modelURI = URI.createFileURI("c:\my\model.ecore"); File targetFolder = new File("c:\generate\here"); Generate generator = new Generate(modelURI, targetFolder, Collections.emptyList()); generator.doGenerate(); 

Please note: when you are offline, you need to do a lot of the work that Eclipse usually does for you. First of all, you will need to register the ecore packages of your metamodels. See Example Registering a UML Metamodel .

See also Aciki entries for the Acceleo widget on autonomous generation and compilation.

+3
source share

All Articles