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 "ICE Build Instructions"

(Inside Eclipse)
(Inside Eclipse)
Line 46: Line 46:
  
 
To build and test we need to create a custom run configuration. Look for <tt>pom.xml</tt> in the <code>org.eclipse.ice.aggregator/</code> directory.
 
To build and test we need to create a custom run configuration. Look for <tt>pom.xml</tt> in the <code>org.eclipse.ice.aggregator/</code> directory.
 +
 +
[[File:FindingPom.png]]
  
 
Right-click this file, and scroll to 'Run As...' and select 'Run Configurations' at the bottom. In the menu that appears, select the 'Maven Build' option in the left-side menu and click the new button (a small button that looks like a blank piece of paper with a gold plus sign on it) at the top. A new configuration will be created. You need to set the name at the top of the page, choose the <code>org.eclipse.ice.aggregatory/</code> directory by clicking the "Browse Workspace" button and set the goal to <code>clean verify</code> to properly launch the build. Click 'Apply' and then 'Run.'  
 
Right-click this file, and scroll to 'Run As...' and select 'Run Configurations' at the bottom. In the menu that appears, select the 'Maven Build' option in the left-side menu and click the new button (a small button that looks like a blank piece of paper with a gold plus sign on it) at the top. A new configuration will be created. You need to set the name at the top of the page, choose the <code>org.eclipse.ice.aggregatory/</code> directory by clicking the "Browse Workspace" button and set the goal to <code>clean verify</code> to properly launch the build. Click 'Apply' and then 'Run.'  

Revision as of 14:11, 11 February 2016

We now recommend that all ICE developers hack the code from ICE itself. See Getting ICE to download it.

This article assumes that you have already collected the ICE third-party dependencies and have them in your workspace or stored on your system. All third-party dependencies are required to build ICE from source, unlike the binary distribution of ICE. Additional dependencies may be required to use certain features of ICE.

Building ICE from scratch requires access to some test files for its tests to pass. You can either build it without the tests or contact us. Unfortunately we cannot widely distribute these, but if you genuinely need to build ICE from source contact eclipse.ice.project <at> gmail.com for more information.

ICE requires Java 1.8 to build and run.

Getting ICE from Git

The first step will be to check ICE out from the Git repository. If you are building ICE using ICE, check it out from the "Developer->ICE" menu entry. If you are using another version of Eclipse you can do it manually. The Git repository is at http://github.com/eclipse/ice.

Open the Git Repositories view ('Window > Show View > Other > Git > Repositories') and choose to clone a repository. Point the wizard to the ICE Git repository and hit Next. The ICE Git repo needs to be cloned into your workspace so that it can run its build properly. If your workspace is at $HOME/workspace, the repository should be cloned into $HOME/workspace/ice as shown in the second picture.

Be sure to check the box that says "Import all existing projects after clone is finished." This will automatically import all Eclipse ICE projects into your workspace and save you quite a bit of time and prevent you from having to learn how the repository is laid out.

ICEGithubConfig.png ICEGithubLocConfig.png

If you are using a vanilla version of Eclipse for development, all of the projects will show up in your project explorer and most of them will have red error boxes next to them. You will need to load the target platform by opening the org.eclipse.ice.target.mars project, opening the "mars.target" file, and clicking the "Set as target platform" button in the top right of the editor once the platform has resolved. Resolving the platform takes a very long time if you have never done it before, so watch the status bar in the bottom right to monitor its progress.

If you are using ICE to do ICE development, you do not need to resolve the target platform unless you need to make changes to it.

Building ICE Binaries using Maven

ICE is built using the Maven build system and Eclipse Tycho to create binaries for multiple platforms and architectures and to execute the test plugins. The Maven build system can be launched by command line using the mvn command, if it is installed, or from within Eclipse using the m2e Eclipse plugin.

ICE is a big code, so properly building can take some time when you first build it because it needs to download its dependencies. Make sure that you switch to the 'next' branch.

In practice, if you are doing development work and don't need to build the binaries, you can just build the bundles and run the tests. It is good practice to build the binaries and run them at least once a day to make sure your code works in the way the user will experience it.

The ICE Development Team builds ICE from both the command line and Eclipse: we build from inside Eclipse while we are developing and before we commit to make sure the tests work, and we use an automated Hudson build that runs hourly on our development server.

To build ICE on the command line, change into the org.eclipse.ice.aggregator directory and run

mvn clean verify

The binaries will be in ice/org.eclipse.ice.repository/target/products within your ICE working copy.

Inside Eclipse

In order to build ICE binaries from Eclipse, you must use the Eclipse plugin for Maven. Once the plugins are checked out from the repository, make sure you can see packages in the package explorer. If not, you may not have checked the "Import all existing projects after clone is finished" box when cloning ICE. You can import the projects from the Git perspective by right-clicking on the ICE repository and selecting "Import Projects".

Build and Test the ICE Bundles

To build and test we need to create a custom run configuration. Look for pom.xml in the org.eclipse.ice.aggregator/ directory.

File:FindingPom.png

Right-click this file, and scroll to 'Run As...' and select 'Run Configurations' at the bottom. In the menu that appears, select the 'Maven Build' option in the left-side menu and click the new button (a small button that looks like a blank piece of paper with a gold plus sign on it) at the top. A new configuration will be created. You need to set the name at the top of the page, choose the org.eclipse.ice.aggregatory/ directory by clicking the "Browse Workspace" button and set the goal to clean verify to properly launch the build. Click 'Apply' and then 'Run.'

Ice build 20160211.png

If the build system encounters any errors or failed tests, they will be reported in the Eclipse console window, and the build will be terminated early. Alternatively, if the build is successful, a "BUILD SUCCESS" message will be displayed in the console once the build completes, and the ICE binaries will have been created in your Eclipse workspace at org.eclipse.ice.repository/target/products. If you experience any issues with the build send your error logs to ice-dev <at> eclipse.org.

The target/products directory contains a p2 repository; compressed (ZIP) files of ICE for 32- and 64-bit Linux, Mac, and Windows; and unzipped directories with the executables for each platform than can be immediately executed.

A successful build looks like the following:

Ice build console 20160210.png

Back to the top