Skip to main content

Notice: This Wiki is now read only and edits are no longer 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"

(Building ICE Binaries using Maven)
(Building ICE Binaries using Maven)
Line 39: Line 39:
 
'''Build Binaries'''
 
'''Build Binaries'''
  
Open the org.eclipse.ice.repository project. Right-click on the <tt>pom.xml</tt> file, and select 'Run As > Maven install.' This will build all of ICE's binaries and deposit them in the target/product directory of the project.
+
Open the org.eclipse.ice.repository project. Right-click on the <tt>pom.xml</tt> file, and select 'Run As > Maven install.'
  
 
=== On the Command Line ===
 
=== On the Command Line ===
Line 60: Line 60:
 
mvn install  
 
mvn install  
 
</pre>
 
</pre>
 
The binaries will be located in target/product/ sub directory.
 
  
 
=== Locating the ICE Binaries ===
 
=== Locating the ICE Binaries ===
  
The resulting ICE binaries are written to a subdirectory of the org.eclipse.ice.repository package under target/products. Note that the target directory may not appear in the Eclipse Package Explorer until the org.eclipse.ice.repository package has been refreshed. To refresh this package, right-click on the package and select 'Refresh' or highlight it and click 'F5.' To execute a binary, navigate to <code>org.eclipse.ice.repository/target/products/<os>/<windowing system>/<arch>/ICE</code> and run the ICE executable.
+
The ICE binaries are written to a subdirectory of the org.eclipse.ice.repository package called target/products. Note that the target directory may not appear in the Eclipse Package Explorer until the org.eclipse.ice.repository package has been refreshed. To refresh this package, right-click on the package and select 'Refresh' or highlight it and click 'F5.' To execute a binary, navigate to <code>org.eclipse.ice.repository/target/products/<os>/<windowing system>/<arch>/ICE</code> and run the ICE executable.
 +
 
 +
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.

Revision as of 17:31, 17 January 2015

ICE is relatively easy to build from scratch if you know where to start. This article assumes that you have already collected the ICE third-party dependencies and have them in your workspace or stored on your system. Unlike the binary distribution of ICE, all third-party dependencies are required to build ICE from scratch.

Tooling

Building ICE will work out of the box with Eclipse Luna since it has both the EGit and M2E (Maven) plugins installed by default. You may have to install these plugins manually if you are using an older version of Eclipse.

Getting ICE from Git

The first step is checking ICE out from its Git repository. The preferred way to do this is to use Eclipse and clone the Git repo. 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 repo and hit Next.

ICEGithubConfig.png

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 repo should be stored at $HOME/workspace/ice as shown in the next picture.

ICEGithubLocConfig.png

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 possibly even a designated working set) and save you quite a bit of time and prevent you from having to learn how the repo is laid out.

Building ICE Binaries using Maven

ICE is built using the Maven build system and Eclipse Tycho. ICE uses Maven and Tycho to create binaries for multiple platforms and architectures as well as executing 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 it is a bit of a big job. It is broken into two steps, each roughly ten minutes in length. The first step is to build all of ICE's bundles and run its unit tests. The second test is to package the ICE binaries for distribution. The very first time you build ICE make take much longer than this, depending on the speed of your internet connection, because it needs to download all of its dependencies.

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 Dev 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.

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, open the org.eclipse.ice.build package.

Build and Test the ICE Bundles

Instead, we need to create a custom run configuration. Right-click on the pom.xml file, 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.build/ directory by clicking the "Browse Workspace" button and set the goal to -N install to properly launch the build. Click 'Apply' and then 'Run.'

This downloads and installs any required dependencies, and will probably take a while if this is your first time building ICE binaries. Once all dependencies are downloaded, the last step is to actually build ICE. To do this, right-click on the same pom.xml file in the org.eclipse.ice.build/ directory, and select 'Run As > Maven install.' This will build and test all of ICE's bundles. If this is your first time, this process could take upwards of 10-12 minutes depending on your system. 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.

Build Binaries

Open the org.eclipse.ice.repository project. Right-click on the pom.xml file, and select 'Run As > Maven install.'

On the Command Line

We need to follow the same steps as listed above, but on the command line we must execute commands like mvn -N install.

Build and Test the ICE Bundles

Once Maven is installed, open a terminal window and change your current directory to ice/org.eclipse.ice.build/ within your ICE working copy. Next, execute the following two statements in order:

mvn -N install
mvn install 

The first command downloads and installs the required dependencies, which may take several minutes to complete, and it installs the ICE "parent" build configuration in your local Maven repository. The second command builds the ICE source and test bundles, executes the tests, and creates binaries if the tests pass. This may take a very long time if it is the first time you are building ICE, because Maven will download a lot of other plugins that it needs to build Eclipse RCP applications and to bootstrap itself. However, subsequent builds take about seven to twelve minutes on high-end and low-end systems respectively.

Build Binaries

Change your current directory to ice/repository/org.eclipse.ice.repository/ within your ICE working copy. Next, execute the following command:

mvn install 

Locating the ICE Binaries

The ICE binaries are written to a subdirectory of the org.eclipse.ice.repository package called target/products. Note that the target directory may not appear in the Eclipse Package Explorer until the org.eclipse.ice.repository package has been refreshed. To refresh this package, right-click on the package and select 'Refresh' or highlight it and click 'F5.' To execute a binary, navigate to org.eclipse.ice.repository/target/products/<os>/<windowing system>/<arch>/ICE and run the ICE executable.

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.

Back to the top