<?xml version="1.0" encoding="UTF-8"?> | |
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:mtl="http://www.eclipse.org/acceleo/mtl/3.0" xmlns:ocl.ecore="http://www.eclipse.org/ocl/1.1.0/Ecore"> | |
<mtl:Module name="acceleoCompiler" nsURI="org::eclipse::acceleo::module::sample::test::main::acceleoCompiler" startHeaderPosition="411" endHeaderPosition="624"> | |
<documentation xsi:type="mtl:ModuleDocumentation" author="sbegaudeau"> | |
<body startPosition="32" endPosition="408" value="
Copyright (c) 2011, 2012 Obeo.<br/>
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

Contributors:
Obeo - initial API and implementation
@author sbegaudeau

"/> | |
</documentation> | |
<input> | |
<takesTypesFrom href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#/"/> | |
</input> | |
<ownedModuleElement xsi:type="mtl:Template" name="generateElement" visibility="Public" main="true"> | |
<body xsi:type="mtl:FileBlock" openMode="OverWrite"> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="/*******************************************************************************
 * Copyright (c) 2011, 2012 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 * Obeo - initial API and implementation
 *******************************************************************************/
package "/> | |
<body xsi:type="ocl.ecore:PropertyCallExp"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
<source xsi:type="ocl.ecore:VariableExp" name="anAcceleoProject" referredVariable="/0/generateElement/anAcceleoProject"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</source> | |
<referredProperty xsi:type="ecore:EAttribute" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject/name"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=";

import org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler;
import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.common.util.Monitor;

/**
 * The Acceleo Stand Alone compiler.
 * 
 * @author <a href="mailto:stephane.begaudeau@obeo.fr">Stephane Begaudeau</a>
 * @since 3.1
 */
public class AcceleoCompiler extends AbstractAcceleoCompiler {
 
 /**
 * The entry point of the compilation.
 * 
 * @param args
 * The arguments used in the compilation: the source folder,
 * the output folder, a boolean indicating if we should use binary resource
 * serialization and finally the dependencies of the project.
 */
 public static void main(String"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=" args) {
 if (args.length < 3) {
 throw new IllegalArgumentException("Missing parameters"); //$NON-NLS-1$
 }
 AcceleoCompiler acceleoCompiler = new AcceleoCompiler();
 acceleoCompiler.setSourceFolder(args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[0]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=");
 acceleoCompiler.setOutputFolder(args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[1]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=");
 acceleoCompiler.setBinaryResource(Boolean.valueOf(args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[2]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=").booleanValue());
 if (args.length >= 4 && args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[3]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=" != null && !"".equals(args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[3]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=")) { //$NON-NLS-1$
 acceleoCompiler.setDependencies(args"/> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="[3]"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</body> | |
<body xsi:type="ocl.ecore:StringLiteralExp" stringSymbol=");
 }
 acceleoCompiler.doCompile(new BasicMonitor());
 }
 
 /**
 * Launches the compilation of the mtl files in the generator.
 * 
 * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#doCompile(org.eclipse.emf.common.util.Monitor)
 */
 @Override
 public void doCompile(Monitor monitor) {
 super.doCompile(monitor);
 }
 
 /**
 * Registers the packages of the metamodels used in the generator.
 * 
 * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#registerPackages()
 */
 @Override
 protected void registerPackages() {
 super.registerPackages();
 /*
 * If you want to add the other packages used by your generator, for example UML:
 * org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
 **/
 }

 /**
 * Registers the resource factories.
 * 
 * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#registerResourceFactories()
 */
 @Override
 protected void registerResourceFactories() {
 super.registerResourceFactories();
 /*
 * If you want to add other resource factories, for example if your metamodel uses a specific serialization and it is not contained in a ".ecore" file:
 * org.eclipse.emf.ecore.resource.Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
 **/
 }
}

"/> | |
<fileUrl xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="AcceleoCompiler.java"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</fileUrl> | |
<charset xsi:type="ocl.ecore:StringLiteralExp" stringSymbol="UTF-8"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</charset> | |
</body> | |
<documentation xsi:type="mtl:ModuleElementDocumentation"> | |
<body startPosition="501" endPosition="624" value="
Generates the AcceleoCompiler.java file for stand alone compilation.
@param anAcceleoProject The acceleo project.

"/> | |
<parametersDocumentation name="anAcceleoProject"> | |
<body value=" The acceleo project."/> | |
</parametersDocumentation> | |
</documentation> | |
<parameter name="anAcceleoProject"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</parameter> | |
</ownedModuleElement> | |
</mtl:Module> | |
<ecore:EPackage name="additions"> | |
<eClassifiers xsi:type="ecore:EClass" name="String_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="Integer_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Integer"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="Real_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Real"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="EObject_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | |
</eAnnotations> | |
<eOperations name="generateElement"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<contents xsi:type="ocl.ecore:Constraint"/> | |
</eAnnotations> | |
<eAnnotations source="MTL" references="/0/generateElement"/> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
<eParameters name="anAcceleoProject"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</eParameters> | |
</eOperations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="OclAny_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/OclAny"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="Collection(T)_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Collection(T)"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="Sequence(T)_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/Sequence(T)"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="OrderedSet(T)_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/OrderedSet(T)"/> | |
</eAnnotations> | |
</eClassifiers> | |
<eClassifiers xsi:type="ecore:EClass" name="AcceleoProject_Class"> | |
<eAnnotations source="http://www.eclipse.org/ocl/1.1.0/OCL"> | |
<references href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</eAnnotations> | |
</eClassifiers> | |
</ecore:EPackage> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ocl.ecore:PrimitiveType" href="http://www.eclipse.org/ocl/1.1.0/oclstdlib.ecore#/0/String"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1#//AcceleoProject"/> | |
</ocl.ecore:Variable> | |
<ocl.ecore:Variable name="self"> | |
<eType xsi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/> | |
</ocl.ecore:Variable> | |
<ecore:EAnnotation source="positions"> | |
<eAnnotations source="positions.0" references="/0/@documentation"> | |
<details key="start" value="29"/> | |
<details key="end" value="410"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.1" references="/0/generateElement"> | |
<details key="start" value="627"/> | |
<details key="end" value="4141"/> | |
<details key="line" value="20"/> | |
</eAnnotations> | |
<eAnnotations source="positions.2" references="/0/generateElement/@body.0"> | |
<details key="start" value="713"/> | |
<details key="end" value="4129"/> | |
<details key="line" value="22"/> | |
</eAnnotations> | |
<eAnnotations source="positions.3" references="/0/generateElement/@body.0/@body.0"> | |
<details key="start" value="761"/> | |
<details key="end" value="1272"/> | |
<details key="line" value="23"/> | |
</eAnnotations> | |
<eAnnotations source="positions.4" references="/0/generateElement/@body.0/@body.1"> | |
<details key="start" value="1273"/> | |
<details key="end" value="1294"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.5" references="/0/generateElement/@body.0/@body.1/anAcceleoProject"> | |
<details key="start" value="1273"/> | |
<details key="end" value="1289"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.6" references="/0/generateElement/@body.0/@body.2"> | |
<details key="start" value="1296"/> | |
<details key="end" value="2037"/> | |
<details key="line" value="33"/> | |
</eAnnotations> | |
<eAnnotations source="positions.7" references="/0/generateElement/@body.0/@body.3"> | |
<details key="start" value="2038"/> | |
<details key="end" value="2042"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.8" references="/0/generateElement/@body.0/@body.4"> | |
<details key="start" value="2044"/> | |
<details key="end" value="2287"/> | |
<details key="line" value="55"/> | |
</eAnnotations> | |
<eAnnotations source="positions.9" references="/0/generateElement/@body.0/@body.5"> | |
<details key="start" value="2288"/> | |
<details key="end" value="2293"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.10" references="/0/generateElement/@body.0/@body.6"> | |
<details key="start" value="2295"/> | |
<details key="end" value="2342"/> | |
<details key="line" value="60"/> | |
</eAnnotations> | |
<eAnnotations source="positions.11" references="/0/generateElement/@body.0/@body.7"> | |
<details key="start" value="2343"/> | |
<details key="end" value="2348"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.12" references="/0/generateElement/@body.0/@body.8"> | |
<details key="start" value="2350"/> | |
<details key="end" value="2415"/> | |
<details key="line" value="61"/> | |
</eAnnotations> | |
<eAnnotations source="positions.13" references="/0/generateElement/@body.0/@body.9"> | |
<details key="start" value="2416"/> | |
<details key="end" value="2421"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.14" references="/0/generateElement/@body.0/@body.10"> | |
<details key="start" value="2423"/> | |
<details key="end" value="2478"/> | |
<details key="line" value="62"/> | |
</eAnnotations> | |
<eAnnotations source="positions.15" references="/0/generateElement/@body.0/@body.11"> | |
<details key="start" value="2479"/> | |
<details key="end" value="2484"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.16" references="/0/generateElement/@body.0/@body.12"> | |
<details key="start" value="2486"/> | |
<details key="end" value="2513"/> | |
<details key="line" value="63"/> | |
</eAnnotations> | |
<eAnnotations source="positions.17" references="/0/generateElement/@body.0/@body.13"> | |
<details key="start" value="2514"/> | |
<details key="end" value="2519"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.18" references="/0/generateElement/@body.0/@body.14"> | |
<details key="start" value="2521"/> | |
<details key="end" value="2588"/> | |
<details key="line" value="63"/> | |
</eAnnotations> | |
<eAnnotations source="positions.19" references="/0/generateElement/@body.0/@body.15"> | |
<details key="start" value="2589"/> | |
<details key="end" value="2594"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.20" references="/0/generateElement/@body.0/@body.16"> | |
<details key="start" value="2596"/> | |
<details key="end" value="4122"/> | |
<details key="line" value="64"/> | |
</eAnnotations> | |
<eAnnotations source="positions.21" references="/0/generateElement/@body.0/@fileUrl"> | |
<details key="start" value="720"/> | |
<details key="end" value="742"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.22" references="/0/generateElement/@body.0/@charset"> | |
<details key="start" value="751"/> | |
<details key="end" value="758"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.23" references="/0/generateElement/@documentation"> | |
<details key="start" value="498"/> | |
<details key="end" value="626"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.24" references="/0/generateElement/@documentation/anAcceleoProject"> | |
<details key="start" value="-1"/> | |
<details key="end" value="-1"/> | |
<details key="line" value="0"/> | |
</eAnnotations> | |
<eAnnotations source="positions.25" references="/0/generateElement/anAcceleoProject"> | |
<details key="start" value="660"/> | |
<details key="end" value="693"/> | |
<details key="line" value="20"/> | |
</eAnnotations> | |
</ecore:EAnnotation> | |
</xmi:XMI> |