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 11:58 Go to next message
Axel Guckelsberger is currently offline Axel Guckelsberger
Messages: 224
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 12:04]

Report message to a moderator

Re: Trigger Xtend 2 builder in a headless CI job using ant / classpath problem [message #1067641 is a reply to message #992344] Tue, 09 July 2013 18:45 Go to previous messageGo to next message
Michael Eckes is currently offline Michael Eckes
Messages: 8
Registered: July 2013
Junior Member
So we want to use this Solution: http s://plus.google .com/109977816718694007083/posts/5qPnSXUFRF8


I added launch --stderr --stdout -l "org.zikula.modulestudio.generator.build/XtendCompiler.launch"
to the buckminster commands.

But our Problem is: How do you get the class on the Classpath? Add an plugin dependence? Add the jar manual via buckminster command?

[Updated on: Fri, 12 July 2013 12:58]

Report message to a moderator

Re: Trigger Xtend 2 builder in a headless CI job using ant / classpath problem [message #1117518 is a reply to message #1067641] Thu, 26 September 2013 14:28 Go to previous message
Lorenzo Bettini is currently offline Lorenzo Bettini
Messages: 1368
Registered: July 2009
Senior Member
On 10/07/2013 00:58, Michael Eckes wrote:
> So we wan't to use this Solution: http s://plus.google
> .com/109977816718694007083/posts/5qPnSXUFRF8
>
>
> I added launch --stderr --stdout -l
> "org.zikula.modulestudio.generator.build/XtendCompiler.launch"
> to the buckminster commands.
>
> But our Problem is: How do you get the class on the Classpath? Add an
> plugin dependence? Add the jar manual via buckminster command?

I've just published a blog post with the steps to trigger Xtend compiler
with Buckminster

http://www.lorenzobettini.it/2013/09/using-the-xtend-compiler-in-buckminster-builds/

hope this helps :)

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it
Xtext Book:
http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book
Previous Topic:build command that proceeds on error
Next Topic:Dependency version problem in equinox launchers
Goto Forum:
  


Current Time: Thu Oct 23 14:36:53 GMT 2014

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

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