Jump to: navigation, search

Difference between revisions of "Common Build Infrastructure/Migration to Ant"

(Project Configuration)
(Hudson Job Configuration)
Line 76: Line 76:
 
! style="background:#efefef;" | New Configuration
 
! style="background:#efefef;" | New Configuration
 
|-
 
|-
| rowspan="1" |  
+
| style="background:#ffdddd;" rowspan="1" |  
JAVA_HOME=/opt/public/common/ibm-java2-ppc-50
+
BEFORE EXAMPLE
JAVA14_HOME=/opt/public/common/ibm-java2-ppc-50
+
* link to archived config.xml file for bash
JAVA50_HOME=/opt/public/common/ibm-java2-ppc-50
+
| style="background:#ddffdd;" rowspan="1" |  
JAVA60_HOME=/opt/public/common/ibm-java2-ppc-50
+
AFTER EXAMPLE
| rowspan="1" |  
+
* link to archived config.xml file for ant
JAVA14_HOME=${JAVA_HOME}
+
JAVA50_HOME=${JAVA_HOME}
+
JAVA60_HOME=${JAVA_HOME}
+
 
|-
 
|-
 
| rowspan="1" |  
 
| rowspan="1" |  
...
+
0. Under '''Build''' click ''Add build step > Execute shell''.
 +
1. Enter this configuration:
 +
export PROJRELENGROOT='-projRelengRoot :pserver:anonymous@dev.eclipse.org:/cvsroot/dsdp'
 +
export PROJRELENGPATH='-projRelengPath org.eclipse.tm.rse/releng/org.eclipse.tm.releng'
 +
#export SNAPSHOT="true"
 +
# run the build
 +
. /opt/public/cbi/build/org.eclipse.dash.common.releng/hudson/run.sh
 +
 
 
| rowspan="1" |  
 
| rowspan="1" |  
...
+
0. Under '''Build''' click ''Add build step > Invoke Ant''.
 +
1. Set '''targets''' = <code>run</code> or leave blank to run default.
 +
2. Click Advanced button
 +
3. Define path to your build.xml script relative to job's workspace, eg. <code>org.eclipse.tm.rse/releng/org.eclipse.tm.releng/build.xml</code>.
 +
4. Define these properties:
 +
relengBaseBuilderDir=/opt/public/cbi/build/org.eclipse.releng.basebuilder
 +
relengCommonBuilderDir=/opt/public/cbi/build/org.eclipse.dash.common.releng
 +
#SNAPSHOT="true"
 
|-
 
|-
 
| rowspan="1" |  
 
| rowspan="1" |  
Line 96: Line 107:
 
...
 
...
 
|}
 
|}
 
* link to archived config.xml file for bash
 
* link to archived config.xml file for ant
 
  
 
[[Category:Athena Common Build]]
 
[[Category:Athena Common Build]]

Revision as of 09:01, 28 March 2010

Warning2.png
Draft Content
This page is currently under construction. Community members are encouraged to maintain the page, and make sure the information is accurate.


There are two steps to migrate from bash to ant: project configuration and job configuration. In both cases the net effect is simplification and better ease of use.

Project Configuration

1. Update your build.xml to the latest template version

2. Replace custom values in build.properties with generic ones which will work in both Eclipse or in Hudson

Project Configuration
Old Configuration New Configuration

Before, you needed one configuration file per platform.

JAVA_HOME=/opt/public/common/ibm-java2-ppc-50
JAVA14_HOME=/opt/public/common/ibm-java2-ppc-50
JAVA50_HOME=/opt/public/common/ibm-java2-ppc-50
JAVA60_HOME=/opt/public/common/ibm-java2-ppc-50

Now you can still hardcode values, or use the defaults from Eclipse or Hudson.

JAVA14_HOME=${JAVA_HOME}
JAVA50_HOME=${JAVA_HOME}
JAVA60_HOME=${JAVA_HOME}

Before, you needed one configuration file per platform because you depend on a given Eclipse SDK.

dependencyURLs=http://.../eclipse-SDK-3.5.1-linux-gtk-ppc.tar.gz

or

dependencyURLs=http://.../eclipse-SDK-3.5.1-win32.zip

Now, depend on an update site and properties will work on all supported platforms.

repositoryURLs=http://.../eclipse-Update-3.5.2-201002111343.zip
IUsToInstall=org.eclipse.sdk.feature.group

or

repositoryURLs=http://download.eclipse.org/releases/helios/
IUsToInstall=org.eclipse.sdk.feature.group

Before, because you needed have one properties file per platform, you could set these in build.properties:

localSourceCheckoutDir=C:/workspace/org.eclipse.gef.tree
localSourceCheckoutDirExcludes=**/archive/**
# For windows, must be explicit about paths using correct 
# slashes (/); dirs with spaces should be avoided
relengBuilderDir=C:/workspace/org.eclipse.gef.releng
relengBaseBuilderDir=C:/workspace/org.eclipse.releng.basebuilder
relengCommonBuilderDir=C:/workspace/org.eclipse.dash.common.releng
writableBuildRoot=C:/tmp/build

Remove the values set in build.properties, as they are now computed and should not be needed.

Now, set this in an optional build.local.xml file so it won't conflict with the server's "build from maps" version. This additional step is only needed if building from local sources; otherwise build.xml will work without modification on local or in Hudson!

<property name="localSourceCheckoutDir" value="${basedir}/.." />
<property name="relengBuilderDir" value="${basedir}" />

or

<property name="localSourceCheckoutDir" value="/path/to/dir/A />
<property name="relengBuilderDir" value="/path/to/dir/B" />

Hudson Job Configuration

Migration To Ant Job
Old Configuration New Configuration

BEFORE EXAMPLE

  • link to archived config.xml file for bash

AFTER EXAMPLE

  • link to archived config.xml file for ant

0. Under Build click Add build step > Execute shell. 1. Enter this configuration:

export PROJRELENGROOT='-projRelengRoot :pserver:anonymous@dev.eclipse.org:/cvsroot/dsdp'
export PROJRELENGPATH='-projRelengPath org.eclipse.tm.rse/releng/org.eclipse.tm.releng'
#export SNAPSHOT="true"
# run the build
. /opt/public/cbi/build/org.eclipse.dash.common.releng/hudson/run.sh

0. Under Build click Add build step > Invoke Ant. 1. Set targets = run or leave blank to run default. 2. Click Advanced button 3. Define path to your build.xml script relative to job's workspace, eg. org.eclipse.tm.rse/releng/org.eclipse.tm.releng/build.xml. 4. Define these properties:

relengBaseBuilderDir=/opt/public/cbi/build/org.eclipse.releng.basebuilder
relengCommonBuilderDir=/opt/public/cbi/build/org.eclipse.dash.common.releng
#SNAPSHOT="true"

...

...