| [comment encoding = UTF-8 /] |
| [** |
| * Copyright (c) 2008, 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 |
| */] |
| [module antRunner('http://www.eclipse.org/acceleo/ui/acceleowizardmodel/3.1')/] |
| |
| |
| [** |
| * Generate the Ant task to launch the generation from Ant. |
| * @param anAcceleoMainClass The Acceleo main class. |
| * @param eclipseHome The relative path of the eclipse installation folder. |
| * @param workspaceHome The relative path of the workspace. |
| */] |
| [template public genAntRunner(anAcceleoMainClass : AcceleoMainClass, eclipseHome : String, workspaceHome : String)] |
| [comment @main /] |
| [file (anAcceleoMainClass.moduleFileShortName + '.xml', false, 'UTF-8')] |
| <?xml version="1.0" encoding="UTF-8"?> |
| <project default="[anAcceleoMainClass.moduleFileShortName/]" name="[anAcceleoMainClass.projectName/]"> |
| <property name="ECLIPSE_HOME" value="[eclipseHome/]"/> |
| <property name="ECLIPSE_WORKSPACE" value="[workspaceHome/]"/> |
| |
| <!-- The classpath with only the dependencies used by the project --> |
| <path id="[anAcceleoMainClass.projectName/].libraryclasspath"> |
| <pathelement location="${ECLIPSE_WORKSPACE}/[anAcceleoMainClass.projectName/]/bin"/> |
| [for (classpathEntry : String | anAcceleoMainClass.resolvedClassPath)] |
| <pathelement location="[classpathEntry/]"/> |
| [/for] |
| </path> |
| |
| <path id="[anAcceleoMainClass.projectName/].classpath"> |
| <path refid="[anAcceleoMainClass.projectName/].libraryclasspath"/> |
| </path> |
| |
| <!-- The classpath with only the jars available in the plugin folder of Eclipse --> |
| <path id="[anAcceleoMainClass.projectName/].libraryclasspath.alljars"> |
| <pathelement location="../[anAcceleoMainClass.projectName/]/bin"/> |
| <fileset dir="${ECLIPSE_HOME}/plugins/" includes="*.jar"/> |
| </path> |
| |
| <path id="[anAcceleoMainClass.projectName/].classpath.alljars"> |
| <path refid="[anAcceleoMainClass.projectName/].libraryclasspath.alljars"/> |
| </path> |
| |
| <!-- The default task with the jars used by this project --> |
| <target name="[anAcceleoMainClass.moduleFileShortName/]"> |
| <java classname="[anAcceleoMainClass.basePackage/].[anAcceleoMainClass.classShortName/]" classpathref="[anAcceleoMainClass.projectName/].classpath"> |
| <arg value="${model}"/> |
| <arg value="${target}"/> |
| </java> |
| </target> |
| |
| <!-- |
| In case of problem you can also try with all the jar available in your Eclipse |
| Keep in mind that having two versions of the same jar can create problems |
| --> |
| <target name="[anAcceleoMainClass.moduleFileShortName/].alljars"> |
| <java classname="[anAcceleoMainClass.basePackage/].[anAcceleoMainClass.classShortName/]" classpathref="[anAcceleoMainClass.projectName/].classpath"> |
| <arg value="${model}"/> |
| <arg value="${target}"/> |
| </java> |
| </target> |
| </project> |
| [/file] |
| [/template] |