blob: db746699e83c1d51deb53f17793f50a2e5a36b47 [file] [log] [blame]
<?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="&#xD;&#xA;Copyright (c) 2011, 2012 Obeo.&lt;br/>&#xD;&#xA;All rights reserved. This program and the accompanying materials&#xD;&#xA;are made available under the terms of the Eclipse Public License v1.0&#xD;&#xA;which accompanies this distribution, and is available at&#xD;&#xA;http://www.eclipse.org/legal/epl-v10.html&#xD;&#xA;&#xD;&#xA;Contributors:&#xD;&#xA;Obeo - initial API and implementation&#xD;&#xA;@author sbegaudeau&#xD;&#xA;&#xD;&#xA;"/>
</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="/*******************************************************************************&#xA; * Copyright (c) 2011, 2012 Obeo.&#xA; * All rights reserved. This program and the accompanying materials&#xA; * are made available under the terms of the Eclipse Public License v1.0&#xA; * which accompanies this distribution, and is available at&#xA; * http://www.eclipse.org/legal/epl-v10.html&#xA; * &#xA; * Contributors:&#xA; * Obeo - initial API and implementation&#xA; *******************************************************************************/&#xA;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=";&#xA;&#xA;import org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler;&#xA;import org.eclipse.emf.common.util.BasicMonitor;&#xA;import org.eclipse.emf.common.util.Monitor;&#xA;&#xA;/**&#xA; * The Acceleo Stand Alone compiler.&#xA; * &#xA; * @author &lt;a href=&quot;mailto:stephane.begaudeau@obeo.fr&quot;>Stephane Begaudeau&lt;/a>&#xA; * @since 3.1&#xA; */&#xA;public class AcceleoCompiler extends AbstractAcceleoCompiler {&#xA; &#xA; /**&#xA; * The entry point of the compilation.&#xA; * &#xA; * @param args&#xA; * The arguments used in the compilation: the source folder,&#xA; * the output folder, a boolean indicating if we should use binary resource&#xA; * serialization and finally the dependencies of the project.&#xA; */&#xA; 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) {&#xA; if (args.length &lt; 3) {&#xA; throw new IllegalArgumentException(&quot;Missing parameters&quot;); //$NON-NLS-1$&#xA; }&#xA; AcceleoCompiler acceleoCompiler = new AcceleoCompiler();&#xA; 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=");&#xA; 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=");&#xA; 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());&#xA; if (args.length >= 4 &amp;&amp; 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 &amp;&amp; !&quot;&quot;.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$&#xA; 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=");&#xA; }&#xA; acceleoCompiler.doCompile(new BasicMonitor());&#xA; }&#xA; &#xA; /**&#xA; * Launches the compilation of the mtl files in the generator.&#xA; * &#xA; * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#doCompile(org.eclipse.emf.common.util.Monitor)&#xA; */&#xA; @Override&#xA; public void doCompile(Monitor monitor) {&#xA; super.doCompile(monitor);&#xA; }&#xA; &#xA; /**&#xA; * Registers the packages of the metamodels used in the generator.&#xA; * &#xA; * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#registerPackages()&#xA; */&#xA; @Override&#xA; protected void registerPackages() {&#xA; super.registerPackages();&#xA; /*&#xA; * If you want to add the other packages used by your generator, for example UML:&#xA; * org.eclipse.emf.ecore.EPackage.Registry.INSTANCE.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);&#xA; **/&#xA; }&#xA;&#xA; /**&#xA; * Registers the resource factories.&#xA; * &#xA; * @see org.eclipse.acceleo.parser.compiler.AbstractAcceleoCompiler#registerResourceFactories()&#xA; */&#xA; @Override&#xA; protected void registerResourceFactories() {&#xA; super.registerResourceFactories();&#xA; /*&#xA; * If you want to add other resource factories, for example if your metamodel uses a specific serialization and it is not contained in a &quot;.ecore&quot; file:&#xA; * org.eclipse.emf.ecore.resource.Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);&#xA; **/&#xA; }&#xA;}&#xA;&#xA;"/>
<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="&#xD;&#xA;Generates the AcceleoCompiler.java file for stand alone compilation.&#xD;&#xA;@param anAcceleoProject The acceleo project.&#xD;&#xA;&#xD;&#xA;"/>
<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>