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"

Line 7: Line 7:
 
== Getting ICE from Git ==
 
== 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]. Using the Eclipse Git tooling makes it exceptionally easy to checkout the projects.
+
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.
 +
 
 +
[[File: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.
 +
 
 +
[[File:ICEGithubLocConfig.png]]
  
 
== Building ICE Binaries using Maven ==
 
== Building ICE Binaries using Maven ==

Revision as of 15:08, 10 November 2014

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. Information on obtaining those dependencies will not be provided here until the IP review is complete.

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 [1]. 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

Building ICE Binaries using Maven

ICE is built using the [Maven build system](http://maven.apache.org/). ICE utilizes the Maven build system for creating 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 or from within Eclipse using the m2e Eclipse plugin. Screenshots for this section are available at the end.

        1. On the Command Line

Once Maven is installed, open a terminal window and change your current directory to the org.eclipse.ice.build/eclipse directory within your ICE Eclipse workspace (the default directory where you told Eclipse to install your files). 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 four minutes.

If you don't want to build ICE from files stored within your Eclipse workspace or if you downloaded the entire trunk directory from the repository, you can still build ICE. There is a second Maven build script located in trunk/src/org.eclipse.ice.build/hudson that is set up to build with the default trunk configuration. You can use the same commands to build with this script, and it should produce the same results. The ICE Dev Team uses both: we build from inside Eclipse while we are developing and before we commit to make sure the tests work, and we use the second script with an automated Hudson build that runs hourly on our development server.

      1. Inside Eclipse

In order to build ICE binaries from Eclipse, you must use the [m2e Eclipse plugin for Maven](http://www.eclipse.org/m2e/). It is recommended that the slf4j optional plugin be installed as well. Once the plugins are installed, open the org.eclipse.ice.build package and go to the eclipse directory. We need to follow the same steps as listed above, but in Eclipse there is no way to just execute a command like mvn -N install.

Since we have to run this command to install our parent build configuration, 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/eclipse directory 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/eclipse 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.

      1. 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_. To execute a resulting binary, unzip the product for your platform and architecture, go into the ICE directory, and run the _ICE_ executable.

Back to the top