Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo standalone]
[Acceleo standalone] [message #1755450] Fri, 03 March 2017 12:47 Go to next message
Julien Pourille is currently offline Julien PourilleFriend
Messages: 8
Registered: February 2017
Junior Member
Hi,

I have created an acceleo project and when i launch the generation, all works fine.

Now we would like to launch acceleo generation automatically with Jenkins job.
The jenkins jobs would call an ant file which would compile acceleo project first and then launch the generation.

But I have some problems to do this.

1. When i include my metamodel project (and not the jar), the compiler doesn't find my metamodel Package class defined in acceleoCompiler task

2. I have some error of compilation that i don't have in eclipse environment. One of my module import an other module. But I have the compilation error :

Module com::tus::help::generator::services::services not found

3. If I succeed in compiling my acceleo project, how i can launch generation of files whith ant task? I tried with java ant task but it didn't find my main class.

Here is my ant file :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- WARNING: Eclipse auto-generated file.
              Any modifications will be overwritten.
              To include a user specific buildfile here, simply create one in the same
              directory with the processing instruction <?eclipse.ant.import?>
              as the first entry and export the buildfile again. --><project basedir="." default="build" name="com.tus.help.generator">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="../../../../../../../../home/eclipsebuilder-4.4.1-64b/eclipse"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.8"/>
    <property name="source" value="1.8"/>
    <path id="Plug-in Dependencies.libraryclasspath">
        <pathelement location="../../../../../../../../home/eclipse-4.4.1b-64b/eclipse/plugins/org.eclipse.fx.ide.css.jfx8_1.1.0.201411050807.jar"/>
        <pathelement location="../../../../../../../../home/jdk1.8.040-x64/jre/lib/jfxswt.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.apache.xml.resolver_1.2.0.v201005080400.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.apache.xerces_2.9.0.v201101211617.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/javax.xml_1.3.4.v201005080400.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.core.jobs_3.6.0.v20140424-0053.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.core.runtime.compatibility.registry_3.5.300.v20140128-0851/runtime_registry_compatibility.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.equinox.registry_3.5.400.v20140428-1507.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.equinox.preferences_3.5.200.v20140224-1527.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.equinox.app_1.3.200.v20130910-1609.jar"/>
	   	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.codegen.ecore_2.10.100.TUS201504031717.jar"/>
	   	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.emf.codegen_2.10.0.v20140901-1055.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.acceleo.common_3.5.1.201409021433.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.acceleo.model_3.5.1.201409021433.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.acceleo.profiler_3.5.1.201409021433.jar"/>
        <pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.acceleo.engine_3.5.1.201409021433.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.acceleo.parser_3.5.1.201409021433.jar"/>
        <pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar"/>
        <pathelement location="../../../../../../third_parties/tp/cdoserver/4.3.1/plugins/org.eclipse.emf.common_2.10.1.v20140901-1043.jar"/>
    	<pathelement location="../../../../../../third_parties/tp/cdoserver/4.3.1/plugins/org.eclipse.emf.ecore_2.10.1.v20140901-1043.jar"/>
    	<pathelement location="../../../../../../third_parties/tp/cdoserver/4.3.1/plugins/org.eclipse.emf.ecore.xmi_2.10.1.v20140901-1043.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ocl.ecore_3.3.100.v20140610-0641.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ocl.common_1.2.0.v20140610-0641.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/org.eclipse.ocl_3.4.2.v20140725-2242.jar"/>
    	<pathelement location="../../../../../../third_parties/tp/guava/15.0.0/plugins/com.google.guava_15.0.0.v201403281430.jar"/>
    	<pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.core.runtime_3.10.0.v20140318-2214.jar"/>
    	<pathelement location="../../../../../../third_parties/tp/equinox/4.4.1/plugins/org.eclipse.core.contenttype_3.4.200.v20140207-1251.jar"/>
    	<pathelement location="${ECLIPSE_HOME}/plugins/lpg.runtime.java_2.0.17.v201004271640.jar"/>
    	<pathelement location="lib/com.tus.help.model_1.0.0.201703031151.jar"/>
    </path>
              	
    <path id="com.tus.help.generator.classpath">
        <path refid="Plug-in Dependencies.libraryclasspath"/>
        <pathelement location="bin"/>
    </path>
              	
    <taskdef id="acceleoCompiler" name="acceleoCompiler" classname="org.eclipse.acceleo.parser.compiler.AcceleoCompiler" classpathref="com.tus.help.generator.classpath"/>
    	
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/.copyarea.db"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="resources">
                <exclude name="**/.copyarea.db"/>
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
            <src path="src"/>
            <src path="resources"/>
            <classpath refid="com.tus.help.generator.classpath"/>
        </javac>
    	<acceleoCompiler sourcefolder="src" outputfolder="bin" dependencies="" binaryresource="true" packagestoregister="stanHelp.StanHelpPackage"/>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
    <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler">
        <copy todir="${ant.library.dir}">
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </copy>
        <unzip dest="${ant.library.dir}">
            <patternset includes="jdtCompilerAdapter.jar"/>
            <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/>
        </unzip>
    </target>
    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
        <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
        <antcall target="build"/>
    </target>
    <target name="Services">
        <java classname="com.tus.help.generator.services.Services" failonerror="true" fork="yes">
            <classpath refid="com.tus.help.generator.classpath"/>
        </java>
    </target>
</project>


Thank you for your help
Re: [Acceleo standalone] [message #1755452 is a reply to message #1755450] Fri, 03 March 2017 12:59 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

A few years ago, I tried to get Acceleo to contribute to a Hudson build. I had a variety of problems that I didn't understand and which were very difficult to debug on such an opaque target. I gave up and decided to ensure that the Acceleo aspects of my overall build were a manual contribution; similar to running EMF's GenModel or an Xtext generation. Your use of Ant ensures that you have three nightmares to debug concurrently; Ant task paths, Acceleo URI resolution, remote build invisibility. I suggest a rethink.

Regards

Ed Willink
Previous Topic:[acceleo] mtl and emtl, what is the difference?
Next Topic:Xpand2 IncrementalGenerationFacade deprecated
Goto Forum:
  


Current Time: Fri Apr 26 17:53:40 GMT 2024

Powered by FUDForum. Page generated in 0.03181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top