Child pages
  • Eclipse development setup for CIShell and Sci2
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 18 Next »

Introduction

This document will walk you through installing Eclipse, installing and configuring necessary plugins, pulling all the necessary source code, and even building both CIShell and Sci2. This process is only necessary if you plan on doing advanced development on the CIShell platform or Sci2 core plugins. If you are developing or modifying a single plugin, refer to this tutorial instead. This tutorial will be presented in steps, and assumes you already have the most recent version of the Java 7 64-bit JDK installed.

Preparing Eclipse

Install and Launch Eclipse

The first thing you'll need to do is acquire Eclipse, if you don't already have it. The Eclipse.org website is the official source for these downloads. In this case, we will be installing the latest version, Eclipse Kepler. It is recommended to download the Eclipse Standard Package. If you have the Java 64-bit JDK, you will want to download the 64-bit version of Eclipse. Extract the contents of the .zip download, which should consist of a folder called eclipse. Place the folder wherever you would like, change the name if you wish, then open up eclipse.exe contained in the folder. Eclipse will ask you to select a workplace, so either accept the default location or select a custom directory. When Eclipse opens for the first time, you should see a welcome screen, which you can close.

Note:

We recommend placing your Eclipse workplace on a Solid State Drive (SSD), if you have one, since it will make the application much faster when performing various tasks.

Install and Configure Eclipse Plugins

EGit

EGit should be included in all Eclipse Standard packages. To double check, you can click on Help->About Eclipse from the Eclipse toolbar. EGit should be one of the plugins listed.

Subclipse

To install Subclipse, you'll want to go to Help->Install New Software... from the Eclipse toolbar.

  1. In the Work with: field, paste the following URL: http://subclipse.tigris.org/update_1.8.x
    1. Note: The newest version of Subclipse, such as 1.10.x, do not currently work with plugins we will install later on
  2. Click on the Add... button to the right of that field

  3. Give a descriptive name to this new repository, such as Subclipse

  4. After fetching data from the repository, two top level results should appear. Check the boxes to the left of Subclipse and SVNKit then click Next

  5. Click Next again, accept the terms of the license agreement, then click Finish

  6. Eclipse will now install Subclipse. It may ask to be restarted - go ahead and agree to that so that the installation can complete 

Maven Integration (m2eclipse)

To install m2eclipse, you'll want to go to Help->Install New Software... from the Eclipse toolbar.

  1. In the Work with: field, paste the following URL: http://download.eclipse.org/technology/m2e/releases
  2. Click on the Add... button to the right of that field
  3. Give a descriptive name to this new repository, such as m2eclipse
  4. After fetching data from the repository, a single top level result should appear. Check the box to the left of Maven Integration for Eclipse, then click Next
  5. Click Next again, accept the terms of the license agreement, then click Finish
  6. Eclipse will now install m2eclipse. It may ask to be restarted - go ahead and agree to that so that the installation can complete 

Add m2eclipse Connectors

The Maven integration software requires two connectors for Git and Subversion before we can start pulling code and importing projects with Maven. We will now install those connectors.

egit Handler

  1. Go to File->Import... from the Eclipse toolbar
  2. Select Maven->Check out Maven Projects from SCM and then click Next
  3. Near the bottom of this window, where it says Find more SCM connectors in the m2e Marketplace, click the blue link
  4. In the window that opens, in the Find: field, type in egit. The first result should be m2e-egit - check the box next to that entry and click Finish
  5. After some processing, another window should pop up. The Maven SCM Handler should be checked, so you can just click Next here
  6. Click Next on the following screen, then accept the license agreement and click Finish
  7. A security warning might pop up, just click OK
  8. A dialog will prompt you to restart Eclipse - click Yes

Subclipse Handler

  1. Go to File->Import... from the Eclipse toolbar
  2. Select Maven->Check out Maven Projects from SCM and then click Next
  3. Near the bottom of this window, where it says Find more SCM connectors in the m2e Marketplace, click the blue link
  4. In the window that opens, in the Find: field, type in subclipse. The first result should be m2e-subclipse - check the box next to that entry and click Finish
  5. After some processing, another window should pop up. The Maven SCM Handler should be checked, so you can just click Next here
  6. Click Next on the following screen, then accept the license agreement and click Finish
  7. A security warning might pop up, just click OK
  8. A dialog will prompt you to restart Eclipse - click Yes
 

Note:

For whatever reason, SVN and the SVN connector will not work until you make this change:

  1. After Eclipse has been restarted, go to Window->Preferences from the toolbar
  2. In the search field in the top left corner, type in SVN, then click on the SVN header
  3. In this options screen, under SVN interface, select SVNKit (Pure Java) for Client
  4. Click OK to exit Preferences and save changes

Ant-Contrib

In order to build programs like CIShell, additional build steps are sometimes required outside of the usual Maven build process. For these tasks, you'll need to use Ant. In this case, you will need to install the Ant-Contrib library to your local version of Ant.

  1. Download and unzip the latest version of Ant-Contrib. Ant-Contrib has not been updated since 2006, so it's a pretty safe bet that this download will be the most recent release: ant-contrib-1.0b3-bin.zip
  2. After unzipping, you'll want to move the jar file (ex: ant-contrib-1.0b3.jar) to your ANT_INSTALLATION/lib/ directory. In my case, this was located at plugins/org.apache.ant_<version>/lib inside of my main Eclipse folder
  3. Next, you need to add the new jar to Ant's classpath. To do this, go to Window->Preferences->Ant->Runtime->Classpath in Eclipse. Select Ant Home Entries, then click Add External JARs. Now navigate to the ant-contrib jar we imported and select it. A warning might pop up, but just click Yes if that happens.
  4. Now click OK to save your preferences, and Ant-Contrib should be ready to go

Pulling Code and Building

Once your Eclipse is fully configured, you can begin the process of pulling source code from the relevant Git and SVN repositories. Keep in mind that this is only necessary if you intend to do advanced development work on the CIShell or Sci2 core, or wish to build the projects in your local Eclipse instance. Additionally, these steps may vary between internal CNS developers and the general public.

CIShell

Pulling from the GitHub Repository

To pull and commit changes to the public GitHub repository, you will need a GitHub account. The specifics of SSH keys and configuring your GitHub are covered here, so we won't spend any time on that. If you want eventually commit changes and have them added to the main CIShell repository, you'll want to fork it and commit your changes there. Then you can submit a pull request to have your changes integrated to the production branch. For this walkthrough, I'll use my personal fork of CIShell, but the steps are generally the same for the main repository found here. Here's how to import the source into Eclipse using Maven:

  1. Go to File->Import... on the Eclipse toolbar
  2. Select Check out Maven Projects from SCM, then click Next
  3. For SCM URL, select git from the drop down menu, then paste your Git URL to the right of that
    1. Note: I used the https URL, instead of the ssh URL in this case, to avoid the hassle of setting up SSH keys. Either way should work
  4. Most developers prefer to append a name to all projects imported from a certain repo. You can do that using the Name template field, as shown. Then click Next
  5. Leave this screen as is and click Finish
  6. A Maven project import screen may now pop up. Just leave everything selected, then under Advanced, you may have to reenter the same Name template you added on that previous step. Then click Next
  7. On this next screen with all the green checkmarks, just click Finish
  8. For whatever reason, Eclipse prompted me to install Tycho Project Configurators next. Just click through the dialogs to install this. You may have to restart Eclipse afterwards
  9. At this point, Eclipse will pull in all the CIShell projects. Each project should now be managed by Maven and in sync with your Git repository, as shown by the symbols on each project
  10. The parent project is the top level CIShell project, which you can later use to build CIShell with

You now have everything you need to work on the CIShell core in your local development environment, or build CIShell completely. If you want to work on Sci2 plugins or other items, continue reading on.

Building with Maven and Ant

  1. Right click the parent CIShell project (named parent-cishell in my example), then click Run As->Maven build...
  2. In the window that pops up, type clean install into the Goals field. This will perform a Maven clean, followed by a Maven install command
  3. Click the Run button. Maven will then go through the CIShell build process, which may take some time
  4. After the Maven tasks have completed (you should see BUILD SUCCESS in the console if this is the case), we need to perform the Ant tasks
    1. In the parent project, go to deployment/org.cishell.reference.releng/postMavenTasks.xml, right click on it, and go to Run As->Ant Build
    2. You will probably see output of the Ant script in the Console, but it should eventually stop with a BUILD SUCCESSFUL message

Locating the Finished Build

  1. In your Eclipse workspace directory, go to locate your parent CIShell directory, which in my case was cishell-parent
  2. Inside of this folder, go to deployment/org.cishell.reference.releng/target/products-final
  3. In this folder, there should be several compressed folders, each for a different system type
    1. Locate the one for your particular system and extract it to a new directory
  4. Go inside of that new directory, right click on the CIShell application (cishell.exe), and create a new shortcut. Right click on the shortcut and go to properties. At the end of the target line, after a space, type "-clean -console". This will aid with adding new plugins and debugging.
  5. Launch the shortcut to run CIShell

Sci2

blah

  • No labels