Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » Trigger Xtend 2 builder in a headless CI job using ant / classpath problem
Trigger Xtend 2 builder in a headless CI job using ant / classpath problem [message #992344] Fri, 21 December 2012 06:58
Axel Guckelsberger is currently offline Axel Guckelsberger
Messages: 183
Registered: July 2009
Senior Member
Hi all,

I have a job in Jenkins which builds a repository for a certain feature bundle. The primary plugin contains many Xtend 2 classes. As I did not commit the generated Java files into the Git repository I am trying to start the Xtend 2 build during this job. This should work by calling a certain class with the <java> ant command, like shown in this forum thread: http://www.eclipse.org/forums/index.php/m/792243/ (which seems to refer to https://bugs.eclipse.org/bugs/show_bug.cgi?id=342759).

To make the class org.eclipse.xtext.xtend2.compiler.batch.Main available there is a plugin named org.eclipse.xtext.xtend2.standalone. But unfortunately there exists no feature for it, therefore I installed the Xtend sdk instead (which includes the class, too):

./buckminster install http://download.eclipse.org/releases/juno/ org.eclipse.xtend.sdk


Which seemed to work fine so far.


Here is what I have currently configured for the build job:

buckminster.cspex:

<?xml version="1.0" encoding="UTF-8"?>
<cspecExtension
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:bc="http://www.eclipse.org/buckminster/Common-1.0"
    xmlns="http://www.eclipse.org/buckminster/CSpec-1.0" componentType="eclipse.feature" version="1.0.0">
    <dependencies>
        <dependency name="org.eclipse.rcp" componentType="eclipse.feature"/>
        <dependency name="org.eclipse.xtext.xtend2.standalone" componentType="osgi.bundle"/>
        <dependency name="org.eclipse.xtext.xtend2.lib" componentType="osgi.bundle"/>
        <dependency name="org.aopalliance" componentType="osgi.bundle"/>
    </dependencies>
    <actions>
        <!-- trigger Xtend2 builder -->
        <public name="compile.xtend.classes" actor="ant">
            <actorProperties>
                <property key="buildFile" value="build.xml" />
                <property key="targets" value="compile.xtend.classes" />
            </actorProperties>
            <properties>
            </properties>
            <products alias="destination">
                <path path="dummy_output/" />
            </products>
        </public>
    </actions>
</cspecExtension>


build.xml:

<project name="project" basedir=".">
    <target name="compile.xtend.classes" description="Compile Xtend 2 classes to Java classes">
        <echo>Compiling Xtend 2 classes to Java classes</echo>

        <java classname="org.eclipse.xtext.xtend2.compiler.batch.Main">
            <arg value="-d"/>
            <arg value="xtend-bin"/>
            <arg value="src"/>
        </java>
    </target>
</project>



The job execution results in the following error:

[ant] Compiling Xtend 2 classes to Java classes
[ant] Could not find org.eclipse.xtext.xtend2.compiler.batch.Main. Make sure you have it in your classpath


So I guess that I have to reference the classpath somehow:

        <java classpathref="mycp" classname="org.eclipse.xtext.xtend2.compiler.batch.Main">


But how can I find out the correct class path? How to specify the headless Buckminster environment or the target platform for that?

Or is my approach already wrong and I must use some jar files to make the Xtend class known?

This whole problem expresses that I obviously never did really understand yet how custom ant task are configured properly within Buckminster.

Thanks for any help.

Merry Christmas to all of you!

Axel

[Updated on: Fri, 21 December 2012 07:04]

Report message to a moderator

Previous Topic:Buckminster and Emma No Coverage
Next Topic:creating an action which depends on other components' actions
Goto Forum:
  


Current Time: Tue May 21 14:56:00 EDT 2013

Powered by FUDForum. Page generated in 0.01506 seconds