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 "Platform-releng/Platform Build"

(New page: See Platform-releng/Platform Build for up to date instructions. This page provides instructions for building the Eclipse Platform using preferred technologies identified as part of th...)
 
(migrated to https://github.com/eclipse-platform/eclipse.platform.releng/wiki/Platform-Build)
 
(137 intermediate revisions by 22 users not shown)
Line 1: Line 1:
See [[Platform-releng/Platform Build]] for up to date instructions.
 
  
This page provides instructions for building the Eclipse Platform using preferred technologies identified as part of the [http://wiki.eclipse.org/CBI CBI] initiative.
+
{{warning|Note: Migrated to https://github.com/eclipse-platform/eclipse.platform.releng/wiki/Platform-Build}}
  
At the moment, this build is a prototype based on a temporary fork of the Eclipse platform repositories. We have merged some content upstream, and plan to merge the remaining soon.
+
This page provides instructions for building the Eclipse Platform using preferred technologies identified as part of the [[CBI]] initiative.  
  
== Prerequisites ==
+
== Prerequisites ==
  
=== Free HDD space ===
+
=== Free HDD space ===
~15GB is recommended.
+
  
=== SUN Java 1.6 ===
+
:~25GB is recommended.
* SUN 1.6 JDK needs to be on PATH.
+
* Verify correct version of java is used
+
  
igor@desktop:~$ java -version
+
=== Java 17 JVM ===
java version "1.6.0_29"
+
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
+
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
+
  
 +
*Java 17 JDK needs to be on PATH as the VM that "runs the build".
 +
*Verify correct version of java is used
 +
*Set JAVA_HOME to point to your JDK
 +
*Ensure your java is set to run in Server mode
  
=== Maven 3.0.3 ===
+
* Notes:
* Download from http://maven.apache.org/download.html
+
:* Some of the inner build callouts, like the SWT fragment build, depend on having an Oracle JVM.  
* Unpack to a local folder. On *nix, I usually unpack to /opt and create /opt/maven symlink so I can switch between different versions easily
+
:* It is highly recommended to have all JDKs, from CDC-1.0/Foundation-1.0 to Java 11, in a configured toolchains.xml file.  See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=409790#c32 Bug report] and [http://dev.eclipse.org/mhonarc/lists/cbi-dev/msg01025.html Mailing List]) and see the Section below titled 'Using BREE Libs'.
* Do NOT use maven shipped with your linux distribution.  
+
''Maven as shipped in Fedora 16 is perfectly capable of building the platform with the given instructions. Let's not generalize things and negate others work that easily!!!'' Akurtakov
+
* Verify correct maven version is used
+
  
igor@desktop:~$ mvn -version
+
=== Maven 3.6.3  ===
Apache Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
+
  Maven home: /opt/maven
+
  
=== "natives" p2 repository ===
+
*Download from http://maven.apache.org/download.html or use your Linux distribution provided version (whether it works depends on the distribution).
'''Notice: This step is no longer required in the latest CBI repo as of commit http://git.eclipse.org/c/cbi/platform-aggregator.git/commit/?h=Juno_RC4_R4&id=274922612bcfeeecff9362f50a09966c6538c399'''
+
*make sure '''mvn''' is available in your PATH
  
This is a temporary workaround until we figure out how to build native binaries and bundles that wrap them.
+
=== Git  ===
  
For Eclipse R3
+
==== Linux  ====
  
Download via web browser: [http://eclipse.org/downloads/download.php?file=/cbi/natives-rc4-r3.zip&r=1 natives-rc4-r3.zip]
+
*You can install Git using your distro's package manager.
  
  wget http://eclipse.org/downloads/download.php?file=/cbi/natives-rc4-r3.zip\&r=1
+
==== Mac OSX  ====
  unzip natives-rc4-r3.zip -d /var/tmp/lts
+
  
For Eclipse R4
+
*Download from http://code.google.com/p/git-osx-installer/
 +
*Install using the downloaded DMG file
  
Download via web browser: [http://eclipse.org/downloads/download.php?file=/cbi/natives-rc4-r4.zip&r=1 natives-rc4-r4.zip]
+
==== Windows  ====
  
  wget http://eclipse.org/downloads/download.php?file=/cbi/natives-rc4-r4.zip\&r=1
+
*Download Git for Windows from http://msysgit.github.com/  
  unzip natives-rc4-r4.zip -d /var/tmp/lts
+
*Install using the downloaded exe file
 +
*We recommend using the "Git Bash" application provided by Git for Windows as your commandline shell throughout the build
  
== Build environment setup ==
+
<br> '''Important: Per Bug 376400 we discovered that msysgit has a max character limit somewhere around 256 which causes cloning files with a path longer than that to fail'''
  
=== review maven settings.xml ===
+
See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=376400#c4
To avoid getting hit by {{bug|365727}} and to make sure your local environment configuration does not interfere with LTS build, make sure build user account does not have maven settings.xml
+
  
igor@desktop:~$ ls -l ~/.m2/settings.xml
+
Workaround: Put your repo in the root of a drive and give it a short name. For example: C:\z
ls: cannot access /home/igor/.m2/settings.xml: No such file or directory
+
  
 +
Example:
  
=== give maven JVM more ram ===
+
  cd c:
 +
git clone -b master --recursive \
 +
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git \
 +
z
  
  export MAVEN_OPTS=-Xmx512m
+
'''Note:''' The final "z" parameter at the end of the command is important as tells git to checkout the repository and rename it to "z". This reduces the path length of the repository to be short enough to workaround Bug 376400.
  
== Eclipse 4.x Branch ==
+
== Build environment setup  ==
  
=== cloning platform source tree ===
+
''Note: Unless otherwise stated, these instructions apply to Linux, MacOSX, and Windows platforms''
I setup single platform-aggregator git repository that references all required parts of the platform build is git submodules. The following command clones both the outer repository and all submodules
+
  
Read-Only Access:
+
=== give maven JVM more ram  ===
  
   git clone -b JunoSR1_RC1_R4 --recurse-submodules \
+
   export MAVEN_OPTS=-Xmx2048m
  git://git.eclipse.org/gitroot/cbi/platform-aggregator.git R4_platform-aggregator
+
  
Committer Access:
+
If you are using Windows:  
  
   git clone -b JunoSR1_RC1_R4 --recurse-submodules \
+
   SET MAVEN_OPTS=-Xmx2048m
  ssh://<userid>@git.eclipse.org/gitroot/cbi/platform-aggregator.git R4_platform-aggregator
+
  
To update this clone and all submodules:
+
== Building  ==
  
  cd R4_platform-aggregator 
+
''Note: Unless otherwise stated, these instructions apply to Linux, MacOSX, and Windows platforms''
  git fetch origin
+
  git merge origin/JunoSR1_RC1_R4
+
  git pull --recurse-submodules
+
  git submodule update
+
  
If you want to switch from another branch to this one, replace <tt>git merge origin/JunoSR1_RC1_R4</tt> with:
+
=== cloning platform source tree  ===
  
  git checkout -b JunoSR1_RC1_R4 origin/JunoSR1_RC1_R4
+
Replace ''master'' with the branch you'd like to checkout.
  
=== running the build ===
+
Clone the repository and checkout the branch:
  
==== Easy way ====
+
  git clone -b master --recursive \
 +
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git
  
  ./build.sh build
+
<br> To update this clone and all submodules:
  
==== Hard way ====
+
  cd eclipse.platform.releng.aggregator
 +
git pull --recurse-submodules
 +
git submodule update
  
  mvn -f eclipse-parent/pom.xml \
+
If you want to switch from another branch to this one, replace '''git merge origin/master''' with:
    clean install \
+
    -Dmaven.repo.local=/var/tmp/lts/R4_localrepo
+
  
   mvn -f maven-cbi-plugin/pom.xml \
+
   git checkout -b master origin/master
    clean install \
+
    -Dmaven.repo.local=/var/tmp/lts/R4_localrepo
+
  
  mvn clean install \
+
=== Running the build  ===
    -Dmaven.repo.local=/var/tmp/lts/R4_localrepo -Dmaven.test.skip=true
+
  
With primed local repository, the build takes about 7 minutes on my 4+ years old linux desktop (core 2 duo @2.8GHz, SSD).
+
From the aggregator root, run:
  
Packaged SDK zip files are located in your R4_platform-aggregator directory under
+
  mvn clean verify
  
  eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products
+
:'''NOTE:''' If you build multiple streams on the same system, you'll want to add ''-Dmaven.repo.local=/some/directory/somewhere'' to the end of the 3 mvn commands to avoid collisions (Using a different local repo for each stream). Most casual developers won't be affected.
  
P2 repository
+
::*On Windows use ''-Dmaven.repo.local=C:\path\to\somewhere''
  
  eclipse.platform.releng.tychoeclipsebuilder/sdk/target/repository
+
=== Running the build without tests ===
  
== Eclipse 3.x Branch ==
+
From the aggregator root, run:
  
=== cloning platform source tree ===
+
  mvn clean verify -DskipTests=true
  
Read-Only Access:
+
:'''NOTE''' "-Dmaven.test.skip=true" cannot be used in CBI, see {{bug|456510}}
  
  git clone -b JunoSR1_RC1_R3 --recurse-submodules \
+
=== Build result  ===
  git://git.eclipse.org/gitroot/cbi/platform-aggregator.git R3_platform-aggregator
+
  
Committer Access:
+
Once the build finishes, the following artifacts are created.
  
  git clone -b JunoSR1_RC1_R3 --recurse-submodules \
+
Packaged SDK zip files are located in your '''eclipse.platform.releng.aggregator''' directory under
  ssh://<userid>@git.eclipse.org/gitroot/cbi/platform-aggregator.git R3_platform-aggregator
+
  
To update this clone and all submodules
+
  org.eclipse.releng.tychoeclipsebuilder/sdk/target/products/
  
  cd R3_platform-aggregator
+
P2 repository
  git fetch origin
+
  git merge JunoSR1_RC1_R3 origin/JunoSR1_RC1_R3
+
  git pull --recurse-submodules
+
  git submodule update
+
  
If you want to switch from another branch to this one, replace <tt>git merge origin/JunoSR1_RC1_R3/tt> with:
+
  org.eclipse.repository/target/repository
  
  git checkout -b JunoSR1_RC1_R3 origin/JunoSR1_RC1_R3
+
Source bundles
  
=== running the build ===
+
  org.eclipse.repository/target/repository/plugins
  
==== Easy way ====
+
Packaged JUnit Plugin Tests and Automated Testing Framework
  
   ./build.sh build
+
   org.eclipse.releng.tychoeclipsebuilder/eclipse-junit-tests/target/eclipse-junit-tests-1.0.0-SNAPSHOT-bundle.zip
  
==== Hard way ====
+
=== Cleaning the build repo  ===
  
  mvn -f eclipse-parent/pom.xml \
+
To completely clean a build repo (before a new build or before updating the aggregator and submodules):
    clean install \
+
    -Dmaven.repo.local=/var/tmp/lts/R3_localrepo
+
  
   mvn -f maven-cbi-plugin/pom.xml \
+
   git submodule foreach git clean -f -d
    clean install \
+
git submodule foreach git reset --hard HEAD
    -Dmaven.repo.local=/var/tmp/lts/R3_localrepo
+
git clean -f -d
 +
git reset --hard HEAD
  
  mvn clean install \
+
To get a pristine build repository, after a build, you will have to specify the -x option for git clean.  
    -Dmaven.repo.local=/var/tmp/lts/R3_localrepo -Dmaven.test.skip=true
+
  
 +
  git submodule foreach git clean -f -d -x
 +
git submodule foreach git reset --hard HEAD
 +
git clean -f -d -x
 +
git reset --hard HEAD
  
Packaged SDK zip files are located in your R3_platform-aggregator directory under
+
The reason is that /targets is specified in the .gitignore file, so git ... ignores them. They are included in .gitignore so they are not accidentally committed and don't clutter visual displays of "changes". Normally Maven will clean those up before a build, but in case you want to be positive you do not get an "old" copy, of one of the target artifacts, use -x.
  
  org.eclipse.releng.tychoeclipsebuilder/sdk/target/products/
+
=== Using BREE Libs  ===
  
P2 repository
+
BREE libs can be used to build using the same BREE as what is used on build.eclipse.org. You will first need to download and install the ee.zip attached to Bug 386649 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=386649) and follow the instructions in the description of the bug.
  
  org.eclipse.releng.tychoeclipsebuilder/sdk/target/repository
+
Here's an [[Platform-releng/toolchainsExample|example of toolchains.xml]]. It currently only works with Oracle JREs (see [https://bugs.eclipse.org/bugs/show_bug.cgi?id=389856 bug 389856]). Someone running the platform build would need their own version of toolchains.xml in their build ids home directory's .m2 directory (~/.m2/toolchains.xml) which points to the location on their file system of the tools required (BREE libs and JDKs).
  
Source bundles
+
Once setup you can inform the build to use it by passing '''-Pbree-libs''' on the mvn build command.
  
  org.eclipse.releng.tychoeclipsebuilder/target/repository/plugins
+
=== Signing  ===
  
Packaged JUnit Plugin Tests and Automated Testing Framework
+
Signing is supported when built using build.eclipse.org and is disabled by default.
  
  TMP/eclipse-junit-tests/target/eclipse-junit-tests-1.0.0-SNAPSHOT-bundle.zip
+
*Simply Run the build with '''-Peclipse-sign''' parameter.
  
== running the tests ==
+
=== Building natives  ===
  
Copy the junit tests and the CBI SDK (pick the one for your platform) that was built to a testing directory. Also unzip the junit tests.
+
Optionally, you can pass -Dnative= parameter with one of the following options to compile the natives for the specified native.
 +
<pre>- cocoa.macosx.aarch64
 +
- cocoa.macosx.x86_64
 +
- gtk.linux.aarch64
 +
- gtk.linux.ppc64le
 +
- gtk.linux.x86_64
 +
- win32.win32.x86_64
 +
</pre>
 +
Example:
  
   mkdir -p /var/tmp/lts/R3_platform-tests
+
   mvn clean verify \
  cp eclipse.platform.tychoeclipsebuilder/sdk/target/products/org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz /var/tmp/lts/R3_platform-tests
+
  -DskipTests=true -Dnative=gtk.linux.x86_64
  cp TMP/eclipse-junit-tests/target/eclipse-junit-tests-bundle.zip /var/tmp/lts/R3_platform-tests
+
  cd /var/tmp/lts/R3_platform-tests
+
  unzip eclipse-junit-tests-bundle.zip
+
  
Modify the file equinoxp2tests.properties to point to the CBI built repository.
+
=== Building Selected Projects ===
(This example uses /home/user/R3_platform-aggregator as the CBI platform root)
+
  
  org.eclipse.equinox.p2.tests.current.build.repo=file:/home/user/R3_platform-aggregator/eclipse.platform.repository/target/repository/
+
Instead of a full build, selected projects can be built by going to the desired root directory of the project(s) and specifying the <pre>build-individual-bundles</pre> profile.
  
Note down the org.eclipse.equinox.p2.reconciler.tests.platform.archive.linux-x86_64= file name for your architecture. (In this example linux x86_64)
+
Example:
  
   eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
+
   (from the eclipse.platform.releng.aggregator repository root) \
 +
  cd rt.equinox.framework \
 +
  mvn -Pbuild-individual-bundles clean verify
  
Rename your org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz you copied earlier to match the name you jotted down.
+
This would build all projects under rt.equinox.framework.
  
  mv org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
+
Example:
  
Copy your eclipse-platform to eclipse SDK
+
  (from the eclipse.platform.releng.aggregator repository root) \
 +
  cd rt.equinox.framework/bundles/org.eclipse.osgi \
 +
  mvn -Pbuild-individual-bundles clean verify
  
  cp eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz
+
This would build only the org.eclipse.osgi project.
  
Download a copy of the latest released Eclipse Classic from http://www.eclipse.org/downloads/.
+
== Build output: p2 repo and RCP products ==
  
  http://www.eclipse.org/downloads/
+
Once build is complete, look in the following folders for the usual output artifacts:
 +
* <tt>eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products</tt> for the archives of the Eclipse SDK. (Siblings of <tt>sdk</tt> folder contain other RCP products produced by Platform Build). Those are the packages that are typically published at http://download.eclipse.org/eclipse/downloads/drops4/ .
 +
* <tt>eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/repository</tt> for the typical p2 repository containing installable unit shipped by Platform Build. This is the repository that get typically added to http://download.eclipse.org/eclipse/updates/ .
  
Copy the Eclipse Classic SDK to eclipse-platform
+
== Running the Eclipse platform tests  ==
  
  cp eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz
+
Copy the junit tests and the CBI SDK (pick the one for your platform) that was built to a testing directory. Also unzip the junit tests and enter them.
  
You should now have 4 copies of the platform, 2 from the latest released and 2 from the CBI build.
+
  mkdir -p /var/tmp/lts/R3_platform-tests
 +
cp eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products/org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz /var/tmp/lts/R3_platform-tests
 +
cp eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/target/eclipse-junit-tests-bundle.zip /var/tmp/lts/R3_platform-tests
 +
cd /var/tmp/lts/R3_platform-tests
 +
unzip eclipse-junit-tests-bundle.zip
 +
cd eclipse-testing
  
  eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz
+
Modify the file equinoxp2tests.properties to point to the CBI built repository. (This example uses /home/user/R3_platform-aggregator as the CBI platform root)
  eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz
+
  eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
+
  eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz
+
  
Unzip the CBI platform
+
  org.eclipse.equinox.p2.tests.current.build.repo=file:/home/user/R3_platform-aggregator/eclipse.platform.repository/target/repository/
  
  tar zxvf eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
+
Note down the org.eclipse.equinox.p2.reconciler.tests.platform.archive.linux-x86_64= file name for your architecture. (In this example linux x86_64)
  
Run the tests
+
  eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
  
  ./runtests -os linux -ws gtk -arch x86_64
+
Rename your org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz you copied earlier to match the name you jotted down.
  
== Build Natives ==
+
  mv ../org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
  
Optionally, you can pass -Dnative= parameter with one of the following options to compile the natives for the specified native.
+
Copy your eclipse-platform to eclipse SDK
  
<pre>
+
  cp eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz
- cocoa.macosx.x86
+
- cocoa.macosx.x86_64
+
- gtk.linux.x86
+
- gtk.linux.x86_64
+
- win32.win32.x86
+
- win32.win32.x86_64
+
- win32.wce_ppc.arm
+
</pre>
+
  
Example:
+
Download a copy of the latest released Eclipse Classic (Eclipse IDE for Java Developers) from http://www.eclipse.org/downloads/.
  
   mvn clean install \
+
   http://www.eclipse.org/downloads/
    -Dmaven.repo.local=/var/tmp/lts/R4_localrepo -Dmaven.test.skip=true -Dnative=gtk.linux.x86_64
+
  
== Pack200 & Signing ==
+
Copy the Eclipse Classic SDK to eclipse-platform
  
Pack200 & Signing is supported when built using build.eclipse.org and is disabled by default.
+
  cp eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz
  
* Install eclipse-jarsigner-plugin to local maven repository used by the build (i.e. /var/tmp/lts/R4_localrepo).
+
You should now have 4 copies of the platform, 2 from the latest released and 2 from the CBI build.  
* Run the build with -Peclipse-sign parameter.  
+
  
Eclipse Jarsigner can be downloaded at: http://git.eclipse.org/c/cbi/org.eclipse.cbi.maven.plugins.git/tree/eclipse-jarsigner-plugin
+
  eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz
 +
eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz
 +
eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
 +
eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz
  
== Troubleshooting ==
+
Unzip the CBI platform
  
=== Bug 368089 - Product tar.gz has wrong file permission bits when building on macosx ===
+
  tar zxvf eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz
 +
 
 +
Run the tests
 +
 
 +
  ./runtests -os linux -ws gtk -arch x86_64
  
This issue might occur if your system is not using LANG=en_US.UTF-8 as your system locale. This issue will prevent your from being able to launch Eclipse until proper file permissions are set manually. A workaround is to set the locale before running the build so that the build produces a proper tar.gz.
+
In case you get "testing.properties: No such file or directory", rename or symlink test.properties
  
   export LANG=en_US.UTF-8
+
   ln -s test.properties testing.properties
  
=== Bug 384482 - Apple JVM renamed rt.jar to classes.jar causing CBI Platform build issues ===
+
and re-run the tests.
  
Apple JVM renamed rt.jar to classes.jar causing the CBI Platform build to fail when building on macosx. Running the build a 2nd time after the failure however produces a working build. It isn't ideal to have the user run the build twice though.
+
== Submitting for aggregator builds  ==
  
A workaround for this issue is to create a symbolic link for classes.jar to rt.jar.
+
See [[Platform-releng/Automated Platform Build#Contributing_to_a_build]] for the "how to" using the automatic processing done by the [[Platform-releng/Automated Platform Build]].
  
  cd /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/lib
+
[[Category:Eclipse_Platform_Releng| ]]
  sudo ln -s ../../Classes/classes.jar rt.jar
+

Latest revision as of 06:28, 7 July 2023


This page provides instructions for building the Eclipse Platform using preferred technologies identified as part of the CBI initiative.

Prerequisites

Free HDD space

~25GB is recommended.

Java 17 JVM

  • Java 17 JDK needs to be on PATH as the VM that "runs the build".
  • Verify correct version of java is used
  • Set JAVA_HOME to point to your JDK
  • Ensure your java is set to run in Server mode
  • Notes:
  • Some of the inner build callouts, like the SWT fragment build, depend on having an Oracle JVM.
  • It is highly recommended to have all JDKs, from CDC-1.0/Foundation-1.0 to Java 11, in a configured toolchains.xml file. See Bug report and Mailing List) and see the Section below titled 'Using BREE Libs'.

Maven 3.6.3

  • Download from http://maven.apache.org/download.html or use your Linux distribution provided version (whether it works depends on the distribution).
  • make sure mvn is available in your PATH

Git

Linux

  • You can install Git using your distro's package manager.

Mac OSX

Windows

  • Download Git for Windows from http://msysgit.github.com/
  • Install using the downloaded exe file
  • We recommend using the "Git Bash" application provided by Git for Windows as your commandline shell throughout the build


Important: Per Bug 376400 we discovered that msysgit has a max character limit somewhere around 256 which causes cloning files with a path longer than that to fail

See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=376400#c4

Workaround: Put your repo in the root of a drive and give it a short name. For example: C:\z

Example:

 cd c:
git clone -b master --recursive \
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git \
z

Note: The final "z" parameter at the end of the command is important as tells git to checkout the repository and rename it to "z". This reduces the path length of the repository to be short enough to workaround Bug 376400.

Build environment setup

Note: Unless otherwise stated, these instructions apply to Linux, MacOSX, and Windows platforms

give maven JVM more ram

 export MAVEN_OPTS=-Xmx2048m 

If you are using Windows:

 SET MAVEN_OPTS=-Xmx2048m

Building

Note: Unless otherwise stated, these instructions apply to Linux, MacOSX, and Windows platforms

cloning platform source tree

Replace master with the branch you'd like to checkout.

Clone the repository and checkout the branch:

 git clone -b master --recursive \
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator.git


To update this clone and all submodules:

 cd eclipse.platform.releng.aggregator
git pull --recurse-submodules
git submodule update

If you want to switch from another branch to this one, replace git merge origin/master with:

 git checkout -b master origin/master

Running the build

From the aggregator root, run:

 mvn clean verify
NOTE: If you build multiple streams on the same system, you'll want to add -Dmaven.repo.local=/some/directory/somewhere to the end of the 3 mvn commands to avoid collisions (Using a different local repo for each stream). Most casual developers won't be affected.
  • On Windows use -Dmaven.repo.local=C:\path\to\somewhere

Running the build without tests

From the aggregator root, run:

 mvn clean verify -DskipTests=true
NOTE "-Dmaven.test.skip=true" cannot be used in CBI, see bug 456510

Build result

Once the build finishes, the following artifacts are created.

Packaged SDK zip files are located in your eclipse.platform.releng.aggregator directory under

 org.eclipse.releng.tychoeclipsebuilder/sdk/target/products/

P2 repository

 org.eclipse.repository/target/repository

Source bundles

 org.eclipse.repository/target/repository/plugins

Packaged JUnit Plugin Tests and Automated Testing Framework

 org.eclipse.releng.tychoeclipsebuilder/eclipse-junit-tests/target/eclipse-junit-tests-1.0.0-SNAPSHOT-bundle.zip

Cleaning the build repo

To completely clean a build repo (before a new build or before updating the aggregator and submodules):

 git submodule foreach git clean -f -d
git submodule foreach git reset --hard HEAD
git clean -f -d
git reset --hard HEAD

To get a pristine build repository, after a build, you will have to specify the -x option for git clean.

 git submodule foreach git clean -f -d -x
git submodule foreach git reset --hard HEAD
git clean -f -d -x
git reset --hard HEAD

The reason is that /targets is specified in the .gitignore file, so git ... ignores them. They are included in .gitignore so they are not accidentally committed and don't clutter visual displays of "changes". Normally Maven will clean those up before a build, but in case you want to be positive you do not get an "old" copy, of one of the target artifacts, use -x.

Using BREE Libs

BREE libs can be used to build using the same BREE as what is used on build.eclipse.org. You will first need to download and install the ee.zip attached to Bug 386649 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=386649) and follow the instructions in the description of the bug.

Here's an example of toolchains.xml. It currently only works with Oracle JREs (see bug 389856). Someone running the platform build would need their own version of toolchains.xml in their build ids home directory's .m2 directory (~/.m2/toolchains.xml) which points to the location on their file system of the tools required (BREE libs and JDKs).

Once setup you can inform the build to use it by passing -Pbree-libs on the mvn build command.

Signing

Signing is supported when built using build.eclipse.org and is disabled by default.

  • Simply Run the build with -Peclipse-sign parameter.

Building natives

Optionally, you can pass -Dnative= parameter with one of the following options to compile the natives for the specified native.

- cocoa.macosx.aarch64
- cocoa.macosx.x86_64
- gtk.linux.aarch64
- gtk.linux.ppc64le
- gtk.linux.x86_64
- win32.win32.x86_64

Example:

 mvn clean verify \
 -DskipTests=true -Dnative=gtk.linux.x86_64

Building Selected Projects

Instead of a full build, selected projects can be built by going to the desired root directory of the project(s) and specifying the
build-individual-bundles
profile.

Example:

 (from the eclipse.platform.releng.aggregator repository root) \
 cd rt.equinox.framework \
 mvn -Pbuild-individual-bundles clean verify

This would build all projects under rt.equinox.framework.

Example:

 (from the eclipse.platform.releng.aggregator repository root) \
 cd rt.equinox.framework/bundles/org.eclipse.osgi \
 mvn -Pbuild-individual-bundles clean verify

This would build only the org.eclipse.osgi project.

Build output: p2 repo and RCP products

Once build is complete, look in the following folders for the usual output artifacts:

  • eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products for the archives of the Eclipse SDK. (Siblings of sdk folder contain other RCP products produced by Platform Build). Those are the packages that are typically published at http://download.eclipse.org/eclipse/downloads/drops4/ .
  • eclipse.platform.releng.aggregator/eclipse.platform.releng.tychoeclipsebuilder/eclipse.platform.repository/target/repository for the typical p2 repository containing installable unit shipped by Platform Build. This is the repository that get typically added to http://download.eclipse.org/eclipse/updates/ .

Running the Eclipse platform tests

Copy the junit tests and the CBI SDK (pick the one for your platform) that was built to a testing directory. Also unzip the junit tests and enter them.

 mkdir -p /var/tmp/lts/R3_platform-tests
cp eclipse.platform.releng.tychoeclipsebuilder/sdk/target/products/org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz /var/tmp/lts/R3_platform-tests
cp eclipse.platform.releng.tychoeclipsebuilder/eclipse-junit-tests/target/eclipse-junit-tests-bundle.zip /var/tmp/lts/R3_platform-tests
cd /var/tmp/lts/R3_platform-tests
unzip eclipse-junit-tests-bundle.zip
cd eclipse-testing

Modify the file equinoxp2tests.properties to point to the CBI built repository. (This example uses /home/user/R3_platform-aggregator as the CBI platform root)

 org.eclipse.equinox.p2.tests.current.build.repo=file:/home/user/R3_platform-aggregator/eclipse.platform.repository/target/repository/

Note down the org.eclipse.equinox.p2.reconciler.tests.platform.archive.linux-x86_64= file name for your architecture. (In this example linux x86_64)

 eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz

Rename your org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz you copied earlier to match the name you jotted down.

 mv ../org.eclipse.sdk.ide-linux.gtk.x86_64.tar.gz eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz

Copy your eclipse-platform to eclipse SDK

 cp eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz

Download a copy of the latest released Eclipse Classic (Eclipse IDE for Java Developers) from http://www.eclipse.org/downloads/.

 http://www.eclipse.org/downloads/

Copy the Eclipse Classic SDK to eclipse-platform

 cp eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz

You should now have 4 copies of the platform, 2 from the latest released and 2 from the CBI build.

 eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz 
eclipse-platform-3.7.2-linux-gtk-x86_64.tar.gz
eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz 
eclipse-SDK-201204121421-linux-gtk-x86_64.tar.gz

Unzip the CBI platform

 tar zxvf eclipse-platform-201204121421-linux-gtk-x86_64.tar.gz

Run the tests

 ./runtests -os linux -ws gtk -arch x86_64

In case you get "testing.properties: No such file or directory", rename or symlink test.properties

 ln -s test.properties testing.properties

and re-run the tests.

Submitting for aggregator builds

See Platform-releng/Automated Platform Build#Contributing_to_a_build for the "how to" using the automatic processing done by the Platform-releng/Automated Platform Build.

Back to the top