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.
Kellindil
source share