Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Common Build Infrastructure/Migration to Ant"
(New page: Athena: Migrating from Bash to Ant There are two steps to migration: project configuration and job configuration. In both cases the net effect is simplification and better ease of use. =...) |
(→Project Configuration) |
||
(21 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | + | {{:DocumentationGuidelines/DraftHeader}} | |
− | There are two steps to | + | 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 == | == Project Configuration == | ||
Line 10: | Line 10: | ||
{| border="1" cellpadding="3" cellspacing="1" | {| border="1" cellpadding="3" cellspacing="1" | ||
− | |+ ''' | + | |+ '''Project Configuration''' |
! style="background:#efefef;" | Old Configuration | ! style="background:#efefef;" | Old Configuration | ||
! style="background:#efefef;" | New Configuration | ! style="background:#efefef;" | New Configuration | ||
+ | |- | ||
+ | | style="background:#ffdddd;" rowspan="1" | | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.properties?root=Technology_Project&r1=1.36 build.properties], server version ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.properties?root=Technology_Project&r1=1.36&r2=1.39 diff]) | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.properties.example.winxp?root=Technology_Project&view=markup build.properties], windows version | ||
+ | |||
+ | | style="background:#ddffdd;" rowspan="1" | | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.properties?root=Technology_Project&view=markup build.properties], GEF example ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.properties?root=Technology_Project&r1=1.36&r2=1.39 diff]) | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.properties?root=Technology_Project&view=markup build.properties], template version ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.properties?root=Technology_Project&r1=1.8&r2=1.9 diff]) | ||
+ | |- | ||
+ | | style="background:#ffdddd;" rowspan="1" | | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.xml?revision=1.4&root=Technology_Project&view=markup build.xml], GEF example ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.xml?root=Technology_Project&r1=1.4&r2=1.10 diff]) | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.xml?revision=1.1&root=Technology_Project&view=markup build.xml], template version ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.xml?root=Technology_Project&r1=1.1&r2=1.3 diff]) | ||
+ | | style="background:#ddffdd;" rowspan="1" | | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.xml?revision=1.10&root=Technology_Project&view=markup build.xml], GEF example ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.gef.releng/build.xml?root=Technology_Project&r1=1.4&r2=1.10 diff]) | ||
+ | * Sample [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.xml?revision=1.3&root=Technology_Project&view=markup build.xml], template version ([http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.myproject.releng/build.xml?root=Technology_Project&r1=1.1&r2=1.3 diff]) | ||
|- | |- | ||
| rowspan="1" | | | rowspan="1" | | ||
+ | Before, you needed one configuration file per platform. | ||
JAVA_HOME=/opt/public/common/ibm-java2-ppc-50 | JAVA_HOME=/opt/public/common/ibm-java2-ppc-50 | ||
JAVA14_HOME=/opt/public/common/ibm-java2-ppc-50 | JAVA14_HOME=/opt/public/common/ibm-java2-ppc-50 | ||
Line 20: | Line 36: | ||
JAVA60_HOME=/opt/public/common/ibm-java2-ppc-50 | JAVA60_HOME=/opt/public/common/ibm-java2-ppc-50 | ||
| rowspan="1" | | | rowspan="1" | | ||
+ | Now you can still hardcode values, or use the defaults from Eclipse or Hudson. | ||
JAVA14_HOME=${JAVA_HOME} | JAVA14_HOME=${JAVA_HOME} | ||
JAVA50_HOME=${JAVA_HOME} | JAVA50_HOME=${JAVA_HOME} | ||
Line 25: | Line 42: | ||
|- | |- | ||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | 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 | ||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | Now, depend on an [http://download.eclipse.org/athena/repos/ 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 | ||
|- | |- | ||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | 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 | ||
+ | |||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | 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" /> | ||
|} | |} | ||
Line 42: | Line 83: | ||
! style="background:#efefef;" | New Configuration | ! style="background:#efefef;" | New Configuration | ||
|- | |- | ||
− | | rowspan="1" | | + | | style="background:#ffdddd;" rowspan="1" | |
− | + | * Sample Bash [https://build.eclipse.org/hudson/view/Athena%20CBI/job/cbi-tm-3.2-nightly/ job]: [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng/hudson/config.xml/cbi-tm-3.2-nightly-bash-config.xml?root=Technology_Project&content-type=text%2Fplain&view=co config.xml] | |
− | + | | style="background:#ddffdd;" rowspan="1" | | |
− | + | * Sample Ant [https://build.eclipse.org/hudson/view/Athena%20CBI/job/cbi-tm-3.2-nightly-ant/ job]: [http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.dash/athena/org.eclipse.dash.commonbuilder/org.eclipse.dash.common.releng/hudson/config.xml/cbi-tm-3.2-nightly-ant-config.xml?root=Technology_Project&content-type=text%2Fplain&view=co config.xml] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
|- | |- | ||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | * Under '''Build''' click ''Add build step > Execute shell''. |
+ | * Enter this configuration: | ||
+ | <code>export PROJRELENGROOT='-projRelengRoot :pserver:anonymous@dev.eclipse.org:/cvsroot/dsdp'</code><br/> | ||
+ | <code>export PROJRELENGPATH='-projRelengPath org.eclipse.tm.rse/releng/org.eclipse.tm.releng'</code><br/> | ||
+ | <code>#export SNAPSHOT="true"</code><br/> | ||
+ | <code># run the build</code><br/> | ||
+ | <code>. /opt/public/cbi/build/org.eclipse.dash.common.releng/hudson/run.sh</code> | ||
| rowspan="1" | | | rowspan="1" | | ||
− | ... | + | * Under '''Build''' click ''Add build step > Invoke Ant''. |
+ | * Set '''targets''' = <code>run</code> or leave blank to run default. | ||
+ | * Click Advanced button | ||
+ | * 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>. | ||
+ | * 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" | | ||
− | ... | + | * In your build.properties file, use <code>build.steps=test</code> for Linux, or <code>build.steps=test</code> for Windows/Mac. |
+ | * Curse when tests fail unexpectedly due to X server DISPLAY port collisions (two or more builds using the same DISPLAY). | ||
| rowspan="1" | | | rowspan="1" | | ||
− | .. | + | * Under '''Build Environment''', enable option ''Run Xvnc during build''. |
+ | * Use <code>build.steps=testLocal</code> for all platforms | ||
+ | * Rejoice when tests pass w/o DISPLAY port conflict! | ||
|} | |} | ||
− | + | [[Category:Athena Common Build]] | |
− | + | [[Category:Hudson]] | |
+ | [[Category:Releng]] | ||
+ | [[Category:Draft_Documentation]] |
Revision as of 11:50, 14 May 2010
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
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
Old Configuration | New Configuration |
---|---|
|
|
|
relengBaseBuilderDir=/opt/public/cbi/build/org.eclipse.releng.basebuilder relengCommonBuilderDir=/opt/public/cbi/build/org.eclipse.dash.common.releng #SNAPSHOT="true" |
|
|