Skip to main content

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.

Jump to: navigation, search

Difference between revisions of "OTBuilding"

(Updating to a new Eclipse version)
(Starting a new maintenance branch)
(7 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
This is basically a plain vanilla PDE/Build setup with the following customizations:
 
This is basically a plain vanilla PDE/Build setup with the following customizations:
  
* a top-level [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/build/run.xml?root=TOOLS_OBJECTTEAMS&sortby=file&view=log build.xml] ant file initializes a myriad of properties and then
+
* the releng folder is exported from git, script exportReleng.sh basically does:
 +
: <code>(cd ${OT_GIT} ; git fetch ; git archive origin/master releng ) | tar xv</code>
 +
* a top-level [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/build/run.xml run.xml] ant file initializes a myriad of properties and then
 
*# prepare building:
 
*# prepare building:
 
*#* unzip a drop of the Eclipse SDK
 
*#* unzip a drop of the Eclipse SDK
*#* put <code>org.eclipse.team.svn.pde.build</code> into dropins (''patched version to handle <code>trunk</code> as expected, {{bug|301045}}'')
+
*#* put <code>org.eclipse.egit.fetchfactory</code> into dropins (''version &ge; 0.12.0.201201141247 to include the fix for {{bug|365944}} and more'')
 
*# create the OT/J compiler by 1. invocation of PDE/Build
 
*# create the OT/J compiler by 1. invocation of PDE/Build
 +
*#* action ''after'' this stage
 +
*#** install the <code>org.eclipse.objectteams.otdt.core.patch</code> feature into base
 
*# build the OTDT and tests by 2. invocation of PDE/Build
 
*# build the OTDT and tests by 2. invocation of PDE/Build
 
*#* preparations ''before'' this stage
 
*#* preparations ''before'' this stage
*#** unpack <code>eclipse-test-framework</code> to make it available while compiling tests
+
*#** unpack <code>eclipse-test-framework</code>
 +
*#** install the <code>org.eclipse.test</code> from the previous step into base, to make it available while compiling tests
 
*#** pre-load the output repository location from the previous build including category-less metadata
 
*#** pre-load the output repository location from the previous build including category-less metadata
*#* polish ''after'' this stage
+
*#* polish ''after'' this stage  
 
*#** patch <code>content.xml</code> re version range in feature reference from patch feature (see also below, Publishing step 5)
 
*#** patch <code>content.xml</code> re version range in feature reference from patch feature (see also below, Publishing step 5)
 
*# delegate to the next level for testing
 
*# delegate to the next level for testing
* the main [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/build/build.xml?root=TOOLS_OBJECTTEAMS&sortby=file&view=log build.xml] is a fairly thin layer for steps 2 & 3 above: it handles some properties and then delegates to one of two final PDE/Build stages:
+
* the main [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/build/build.xml build.xml] is a fairly thin layer for steps 2 & 3 above: it handles some properties and then delegates to one of two final PDE/Build stages:
** OT-Compiler: a PDE/Build with a generated <code>build.xml</code> and these customizations:
+
** OT-Compiler: a PDE/Build with a generated <code>build.xml</code> and these parameters from <code>customTargets.xml</code>:
*** fetch [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/map/ot-compiler.map?root=TOOLS_OBJECTTEAMS&sortby=file&view=log ot-compiler.map] from svn
+
*** copy [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/map/otdt.map otdt.map] from the exported releng/maps/
*** install the special <code>Bootstrap_MANIFEST.MF</code> in order to create <code>org.eclipse.jdt.core</code> in the exact same version number as we have it in our base install.
+
*** build feature <code>org.eclipse.objectteams.otdt.core.patch</code>
*** at end of build insert the resulting <code>org.eclipse.jdt.core</code> into the base install (simply replacing the existing plugin jar)
+
*** assemble as a p2 repo at <code>file://${otdtUpdatesDir}</code>
 
** OTDT:  a second PDE/Build with a generated <code>build.xml</code> and these customizations:
 
** OTDT:  a second PDE/Build with a generated <code>build.xml</code> and these customizations:
 
*** at this stage, the jdt.core is our version, so we can actually compiler OT/J code
 
*** at this stage, the jdt.core is our version, so we can actually compiler OT/J code
*** fetch [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/map/otdt.map?root=TOOLS_OBJECTTEAMS&sortby=file&view=log otdt.map] from svn
+
*** copy [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/map/otdt.map otdt.map] from the exported releng/maps/
 
*** by setting <code>p2.gathering=true</code> in build.properties we trigger a p2-based build.
 
*** by setting <code>p2.gathering=true</code> in build.properties we trigger a p2-based build.
* the final [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/build/test.xml?root=TOOLS_OBJECTTEAMS&sortby=file&view=log test.xml] drives setup and execution of tests:
+
* the final [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/build/test.xml test.xml] drives setup and execution of tests:
 
** create the software-under-test:
 
** create the software-under-test:
 
*** unzip the base Eclipse SDK
 
*** unzip the base Eclipse SDK
Line 34: Line 39:
  
 
===Unit test source and statistics===
 
===Unit test source and statistics===
* Source for all unit tests are [http://dev.eclipse.org/viewcvs/viewvc.cgi/trunk/testplugins/?root=TOOLS_OBJECTTEAMS&sortby=file here]
+
* Source for all unit tests are [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/testplugins here]
 
** 2 suites (plug-ins) of jdt tests are maintained with slight modifications
 
** 2 suites (plug-ins) of jdt tests are maintained with slight modifications
 
** 4 more suites of jdt tests are used unmodified
 
** 4 more suites of jdt tests are used unmodified
 
** 6 test suites have been developed specifically for Object Teams.
 
** 6 test suites have been developed specifically for Object Teams.
** A grand total of more than 50000 individual tests are used.
+
** A grand total of more than 54000 individual tests are used.
  
 
== Publishing a p2 Repository ==
 
== Publishing a p2 Repository ==
After building and testing were successful a shell script [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/bin/createRepository.sh?root=TOOLS_OBJECTTEAMS&sortby=file&view=log createRepository.sh] performs these steps:
+
After building and testing were successful a shell script [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/bin/createRepository.sh createRepository.sh] performs these steps:
  
 
# Jar signing  
 
# Jar signing  
Line 56: Line 61:
 
# Patch <code>content.xml</code> as to widen the version range of references to <code>org.eclipse.jdt.core.feature.group</code>:
 
# Patch <code>content.xml</code> as to widen the version range of references to <code>org.eclipse.jdt.core.feature.group</code>:
 
#: ''The patch feature <code>org.eclipse.objectteams.otdt.core.patch</code> must refer to an exact version of the feature which it patches, but even the same jdt bits will create different qualifiers in subsequent builds, so when we build against jdt RC3 it wouldn't be compatible with the final release even if jdt has no changes.'' - see {{bug|304156}}
 
#: ''The patch feature <code>org.eclipse.objectteams.otdt.core.patch</code> must refer to an exact version of the feature which it patches, but even the same jdt bits will create different qualifiers in subsequent builds, so when we build against jdt RC3 it wouldn't be compatible with the final release even if jdt has no changes.'' - see {{bug|304156}}
#: This is done using [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/build/patch-content-xml.xsl?root=TOOLS_OBJECTTEAMS&sortby=file&view=log patch-content-xml.xsl]
+
#: This is done using [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/build/patch-content-xml.xsl patch-content-xml.xsl]
 
# Archive category-less metadata as the basis for future builds
 
# Archive category-less metadata as the basis for future builds
 
#: ''cumulative repositories and categories don't play well together, because a category, once created cannot be augmented'' see {{bug|251888#c11}}
 
#: ''cumulative repositories and categories don't play well together, because a category, once created cannot be augmented'' see {{bug|251888#c11}}
 
# Generate the category
 
# Generate the category
 
# Add download statistics capability
 
# Add download statistics capability
#: ''use XSL transformation [http://dev.eclipse.org/viewcvs/index.cgi/trunk/releng/build-scripts/bin/addDownloadStats.xsl?root=TOOLS_OBJECTTEAMS&sortby=file&view=log addDownloadStats.xsl], which may not be a very safe way of doing this''
+
#: ''use XSL transformation [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/bin/addDownloadStats.xsl addDownloadStats.xsl], which may not be a very safe way of doing this''
 
# Jar-up metadata
 
# Jar-up metadata
 
# Remove symlinks which were needed to resolve dependencies on previous builds
 
# Remove symlinks which were needed to resolve dependencies on previous builds
Line 79: Line 84:
 
* statsVersionId
 
* statsVersionId
 
:: this identifies the version in the downloading statistics, currently <code>2.0.0RC2</code>
 
:: this identifies the version in the downloading statistics, currently <code>2.0.0RC2</code>
 +
 +
==Starting a new maintenance branch==
 +
* Create new branch in GIT under <code>branches/maintenance</code>.
 +
** otdt.map: add <code>,tag=branches/maintenance/MYBRANCH</code> to all plugins (incl. tests) that are not locked to a specific build (tags/builds/..)
 +
** exportReleng.sh: create a copy using the corresponding branch
 +
** test.properties.in: adjust hard-coded major.minor.micro versions of test plug-ins
  
 
==Updating to a new Eclipse version==
 
==Updating to a new Eclipse version==
 
Throughout the build process various version dependencies must be observed, thus moving to a new version of Eclipse to build against involves a number of adjustments:
 
Throughout the build process various version dependencies must be observed, thus moving to a new version of Eclipse to build against involves a number of adjustments:
* First our '''SVN branch/tag''' needs to be selected
+
* See hints on branching above.
** enter this path in <code>run.properties</code> (for bootstrapping our map files via variable <code>mapVersionTag</code>)
+
* The exact '''version of a downloadable SDK''' build must be selected
** if not building from trunk adjust map files, insert the branch using the <code>tag</code>  property ''(this requires a further patched version of org.eclipse.svn.pde.build to avoid qualifier replacement using the branch name).''
+
** this version goes into file <code>otdt_prerequisites.sh</code>, variables <code>EVERSION</code>, <code>SDK_QUALIFIER</code> and possibly <code>DROP</code> (the latter should be derivable from the former).
* Next the exact '''version of a downloadable SDK''' build must be selected
+
* Use script [http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/releng/build-scripts/bin/extractVersions bin/extractVersions] passing the directory that holds the SDK downloads. This creates versioned text snippets for these files:
** this version goes into file <code>otdt_prerequisites.sh</code>, variables <code>EVERSION</code> and <code>DROP</code>
+
** <code>run.properties</code>: versions of
* on <code>build.eclipse.org</code> I have a script <code>bin/extractVersions</code> that '''extracts these numbers from the SDK tar ball''':
+
*** pde.build
** versions of pde.build and equinox.launcher: insert in <code>run.properties</code>
+
*** equinox.launcher
** version of the jdt feature:
+
*** jdt feature (short format, exact and next - to define a minimal matching range)
*** short format into <code>run.properties</code> (incl. <code>.next</code>: incremented by one for version range)
+
** <code>feature.xml</code> of otdt.core.patch
*** long format into <code>feature.xml</code> of otdt.core.patch
+
*** long form of jdt feature version
* update test versions by running <code>processSDKmap.sh</code> on the SDK's map file (<code>directory.txt</code>) and pasting output into:
+
** <code>otdt.map</code>
+
 
** <code>test.properties</code>
 
** <code>test.properties</code>
:''Note, that this script only updates the version qualifiers &mdash; major.minor.micro are currently hard-coded!''
+
*** qualifier changes are automatically updated, ''but major.minor.micro of test dependencies are currently hard-coded!''
 +
* paste, commit and push these changes
 +
* on the server call script <code>bin/exportReleng.sh</code> to bootstrap the build
 +
* finally run the build using <code>build/otdt_runtests.sh</code> or one of the convenience wrappers that select a <code>MAIN_TARGET</code>
  
 
[[Category:Object Teams]][[Category:Object Teams Development]]
 
[[Category:Object Teams]][[Category:Object Teams Development]]

Revision as of 10:54, 21 August 2013

The Object Teams Development Tooling is built in two main stages:

Building and Testing with PDE/Build

This is basically a plain vanilla PDE/Build setup with the following customizations:

  • the releng folder is exported from git, script exportReleng.sh basically does:
(cd ${OT_GIT} ; git fetch ; git archive origin/master releng ) | tar xv
  • a top-level run.xml ant file initializes a myriad of properties and then
    1. prepare building:
      • unzip a drop of the Eclipse SDK
      • put org.eclipse.egit.fetchfactory into dropins (version ≥ 0.12.0.201201141247 to include the fix for bug 365944 and more)
    2. create the OT/J compiler by 1. invocation of PDE/Build
      • action after this stage
        • install the org.eclipse.objectteams.otdt.core.patch feature into base
    3. build the OTDT and tests by 2. invocation of PDE/Build
      • preparations before this stage
        • unpack eclipse-test-framework
        • install the org.eclipse.test from the previous step into base, to make it available while compiling tests
        • pre-load the output repository location from the previous build including category-less metadata
      • polish after this stage
        • patch content.xml re version range in feature reference from patch feature (see also below, Publishing step 5)
    4. delegate to the next level for testing
  • the main build.xml is a fairly thin layer for steps 2 & 3 above: it handles some properties and then delegates to one of two final PDE/Build stages:
    • OT-Compiler: a PDE/Build with a generated build.xml and these parameters from customTargets.xml:
      • copy otdt.map from the exported releng/maps/
      • build feature org.eclipse.objectteams.otdt.core.patch
      • assemble as a p2 repo at file://${otdtUpdatesDir}
    • OTDT: a second PDE/Build with a generated build.xml and these customizations:
      • at this stage, the jdt.core is our version, so we can actually compiler OT/J code
      • copy otdt.map from the exported releng/maps/
      • by setting p2.gathering=true in build.properties we trigger a p2-based build.
  • the final test.xml drives setup and execution of tests:
    • create the software-under-test:
      • unzip the base Eclipse SDK
      • call p2 to install the OTDT from testrun/otdtUpdatesDir
    • call p2 to install the tests from testrun/updateSiteTests/eclipse
    • invoke all tests in sequence, has support for parallization (currently unused)

Unit test source and statistics

  • Source for all unit tests are here
    • 2 suites (plug-ins) of jdt tests are maintained with slight modifications
    • 4 more suites of jdt tests are used unmodified
    • 6 test suites have been developed specifically for Object Teams.
    • A grand total of more than 54000 individual tests are used.

Publishing a p2 Repository

After building and testing were successful a shell script createRepository.sh performs these steps:

  1. Jar signing
    • zip all jars into a big ball - skip symlinks which only point to artifacts from previous build
    • send to the signing daemon, wait for the result to appear
  2. Populate a new repository stagingRepo
    • symlink artifacts from existing update site -- this ensures exact same bits, so unchanged plugins can be re-used during updating
      would we copy these files they were more difficult to distinguish/skip in subsequent phases
    • physically copy bcel jar
      how can we ensure that clients in all update-scenarii will find bcel from original orbit repo?
  3. Pack200 all jar files
    apparently conditioning is already performed by PDE/Build for p2?
  4. Generate p2 metadata
  5. Patch content.xml as to widen the version range of references to org.eclipse.jdt.core.feature.group:
    The patch feature org.eclipse.objectteams.otdt.core.patch must refer to an exact version of the feature which it patches, but even the same jdt bits will create different qualifiers in subsequent builds, so when we build against jdt RC3 it wouldn't be compatible with the final release even if jdt has no changes. - see bug 304156
    This is done using patch-content-xml.xsl
  6. Archive category-less metadata as the basis for future builds
    cumulative repositories and categories don't play well together, because a category, once created cannot be augmented see bug 251888#c11
  7. Generate the category
  8. Add download statistics capability
    use XSL transformation addDownloadStats.xsl, which may not be a very safe way of doing this
  9. Jar-up metadata
  10. Remove symlinks which were needed to resolve dependencies on previous builds

Now the stagingRepo is ready to be copied over the previously published repository.


The script accepts these parameters:

createRepository.sh updateMasterRelativePath [ -nosign ] [ statsRepoId statsVersionId ]
  • updateMasterRelativePath:
relative path under downloads/objectteams/updates pointing to a repository from which to resolve unchanged bundles/features
specify none for an un-parented repository
  • -nosign
skip signing
  • statsRepoId
this identifies the repository in the download statistics, currently either 2.0 or unstable
  • statsVersionId
this identifies the version in the downloading statistics, currently 2.0.0RC2

Starting a new maintenance branch

  • Create new branch in GIT under branches/maintenance.
    • otdt.map: add ,tag=branches/maintenance/MYBRANCH to all plugins (incl. tests) that are not locked to a specific build (tags/builds/..)
    • exportReleng.sh: create a copy using the corresponding branch
    • test.properties.in: adjust hard-coded major.minor.micro versions of test plug-ins

Updating to a new Eclipse version

Throughout the build process various version dependencies must be observed, thus moving to a new version of Eclipse to build against involves a number of adjustments:

  • See hints on branching above.
  • The exact version of a downloadable SDK build must be selected
    • this version goes into file otdt_prerequisites.sh, variables EVERSION, SDK_QUALIFIER and possibly DROP (the latter should be derivable from the former).
  • Use script bin/extractVersions passing the directory that holds the SDK downloads. This creates versioned text snippets for these files:
    • run.properties: versions of
      • pde.build
      • equinox.launcher
      • jdt feature (short format, exact and next - to define a minimal matching range)
    • feature.xml of otdt.core.patch
      • long form of jdt feature version
    • test.properties
      • qualifier changes are automatically updated, but major.minor.micro of test dependencies are currently hard-coded!
  • paste, commit and push these changes
  • on the server call script bin/exportReleng.sh to bootstrap the build
  • finally run the build using build/otdt_runtests.sh or one of the convenience wrappers that select a MAIN_TARGET

Back to the top