Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Switching rcp headless build (ant task) to use target platform
Switching rcp headless build (ant task) to use target platform [message #886264] Thu, 14 June 2012 15:19 Go to next message
Alexander Haag is currently offline Alexander Haag
Messages: 114
Registered: July 2009
Senior Member
Hi there,

i've got an existing Product build using some ant build scripts that are called by a jenkins job. Everything worked fine over some years. Now the product is evolving from eclipse 3.2-base to indigo-base. Therefore we decided to define and use a target platform.

One of the build scripts calls a headless product build (see code below).
My goal is to change the headless build to use a target platform (defined by total amount of 4 directories) instead of a single eclipse directory.

Does anybody know how to revise the ant task below to achieve this goal?
I was hoping to find something like an additional parameter to state the .target-file defining the target platform.

My target platform is placed under version control. If there is no other way, i could always copy the four different directories into one directory and work like before, but i don't think it is a very good idea to do this, do you?
Earlier today I checked the buckminster-plugin but did not get to what I want to do.

Thanks for any help or hints,
Greets Alex


<target name="build" description="generate the RCP" depends="copy-projects">
   <java fork="true" jar="${eclipse.dir}/startup.jar">
	<jvmarg line="-Xms512m" />
	<jvmarg line="-Xmx1024m" />
	<arg line="-application org.eclipse.ant.core.antRunner" />
	<arg line="-buildfile ${eclipse.dir}/plugins/org.eclipse.pde.build_3.2.1.r321_v20060823/scripts/productBuild/productBuild.xml" />
	<arg line="-Dbuilder=${build.config.dir}" />
	<arg line="-Dproduct=/VAUDES_Application/vaudes.product" />
	<arg line="-DbuildDirectory=${build.build.dir}" />
	<arg line="-DbaseLocation=${eclipse.dir}" />
   </java>
   <touch file="${build.exe.dir}/Vaudes/odisc.exe" />
   <zip update="true" duplicate="preserve" whenempty="fail" basedir="${build.exe.dir}" destfile="${build.build.dir}/I.Vaudes/Vaudes-win32.win32.x86.zip" />
   <copy file="${build.build.dir}/I.Vaudes/Vaudes-win32.win32.x86.zip" todir="${application.root.dir}/build" />
</target>
Re: Switching rcp headless build (ant task) to use target platform [message #886291 is a reply to message #886264] Thu, 14 June 2012 16:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

One way to do it is similar to the code we have in our customTargets.xml file: http://git.eclipse.org/c/e4/org.eclipse.e4.releng.git/tree/org.eclipse.e4.builder/builder/general/customTargets.xml#n111

First we use p2.mirror ant task to mirror our different target components into their own subdirectories of ${repoBaseLocation}.

The we use the p2.repo2runnable ant task to create a target platform from the different p2 repos.

PW


Re: Switching rcp headless build (ant task) to use target platform [message #886556 is a reply to message #886291] Fri, 15 June 2012 07:07 Go to previous messageGo to next message
Alexander Haag is currently offline Alexander Haag
Messages: 114
Registered: July 2009
Senior Member
Hi Paul,

thanks for the quick answer!
As I understand correctly, the result using the p2.repo2runnable will be a target platform copied in a given destination. This destination will have the content of my 4 source-directories and I will use the startup.jar, productBuild.xml etc. of the target platform for the task mentioned above?

I'll try and see what i can do with it.

Thanks
Alex
Re: Switching rcp headless build (ant task) to use target platform [message #887844 is a reply to message #886264] Sun, 17 June 2012 08:24 Go to previous messageGo to next message
Libor Jelinek is currently offline Libor Jelinek
Messages: 143
Registered: January 2012
Location: Prague, Czech Rep.
Senior Member

I think that PDE headless build doesn't support targets in same sense as
they work in PDE (IDE).

What I do in my continuous build job is to set target folder as headless
script's ${base} property (see online help for exact definition). This
property specifies folder that an application will be compiled against.
In result, it's identical to target platform purpose for not-headless
build from PDE UI.

Either way, you may also follow Paul. He's much more experienced that me
but I think that it's not an answer to what you asked us originally.

Libor


On 06/14/2012 05:19 PM, Alexander Haag wrote:
> Hi there,
>
> i've got an existing Product build using some ant build scripts that are
> called by a jenkins job. Everything worked fine over some years. Now the
> product is evolving from eclipse 3.2-base to indigo-base. Therefore we
> decided to define and use a target platform.
>
> One of the build scripts calls a headless product build (see code
> below). My goal is to change the headless build to use a target platform
> (defined by total amount of 4 directories) instead of a single eclipse
> directory.
>
> Does anybody know how to revise the ant task below to achieve this goal?
> I was hoping to find something like an additional parameter to state the
> .target-file defining the target platform.
>
> My target platform is placed under version control. If there is no other
> way, i could always copy the four different directories into one
> directory and work like before, but i don't think it is a very good idea
> to do this, do you?
> Earlier today I checked the buckminster-plugin but did not get to what I
> want to do.
>
> Thanks for any help or hints,
> Greets Alex
>
>
>
> <target name="build" description="generate the RCP"
> depends="copy-projects">
> <java fork="true" jar="${eclipse.dir}/startup.jar">
> <jvmarg line="-Xms512m" />
> <jvmarg line="-Xmx1024m" />
> <arg line="-application org.eclipse.ant.core.antRunner" />
> <arg line="-buildfile
> ${eclipse.dir}/plugins/org.eclipse.pde.build_3.2.1.r321_v20060823/scripts/productBuild/productBuild.xml"
> />
> <arg line="-Dbuilder=${build.config.dir}" />
> <arg line="-Dproduct=/VAUDES_Application/vaudes.product" />
> <arg line="-DbuildDirectory=${build.build.dir}" />
> <arg line="-DbaseLocation=${eclipse.dir}" />
> </java>
> <touch file="${build.exe.dir}/Vaudes/odisc.exe" />
> <zip update="true" duplicate="preserve" whenempty="fail"
> basedir="${build.exe.dir}"
> destfile="${build.build.dir}/I.Vaudes/Vaudes-win32.win32.x86.zip" />
> <copy file="${build.build.dir}/I.Vaudes/Vaudes-win32.win32.x86.zip"
> todir="${application.root.dir}/build" />
> </target>
>
Re: Switching rcp headless build (ant task) to use target platform [message #888758 is a reply to message #887844] Mon, 18 June 2012 15:34 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Libor is correct. We differentiate the basebuilder (what runs the PDE headless build) from the target platform (in my example, created by repo2runnable). My repo2runnable is not actually runnable Smile but it is resolvable by the OSGi resolver, and can be used as the target platform for a build.

PW


Previous Topic:Help with RCP from existing .jars
Next Topic:[commands] Unwanted deactivations of menus
Goto Forum:
  


Current Time: Mon Sep 22 14:30:37 GMT 2014

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

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