This document is in the process of being deprecated. Updated documentation on the same topic may be found here: Eclipse development setup for CIShell and Sci2

To be added

  • Setup GitHub account
  • Get permission for CIShell repository Admin
  • Install Eclipse plugin
  • Setup SSH on Eclipse and Git
  • Clone a fresh local CIShell repository and check out into Eclipse
  • Set parent folder as Git framework - This will allow Eclipse to treat the parent folder as a collaboration team project and all the team functionality will be available for parent folder and it's sub-folder
  • Build CIShell
  • Create a new Hello World plugin
  • Pull - commit your changes for review and be added into master

How to update fork repository master branch to the main CIShell repository master branch

  • Use this guide if your local repository is a fork repository.
  • In Eclipse, goto Git repository perspective view
  • Right click at Remotes and select 'Create Remote'. Assign a name (let say MainCIShell) to the remote, choose fetch and click next. Change the uri to 'git@github.com:CIShell/CIShell.git' and select Ok. Select Add and type in master and click save. A new remote for the master branch is created.
  • Under Branches > Local, right click on the branch you want to update (I select master branch) and select Merge... Select Remote Tracking>MainCIShell/master as reference to merge and press Merge. This will update your local master as main CIShell master.
  • Now you can push the changes from local repository to the remote fork repository. 

Import Sci2 source

  • Install m2e subclipse plugin for SVN support. Right-click
  • Install SVNKit Client.
  • Add nwb SVN repository. 
  • Right click at trunk and select Checkout as Maven project from SCM. Check if you are using correct SVN repository when you check out Sci2 project to make parent-Sci2 project which can be viewed in JavaEE explorer.
    In SVN Repositories Perspective, you should be able to see the folder 'https://in.cns.iu.edu/svn/nwb& when you expand it, you should see 3 more folders 'branches', 'tags' & 'trunk'. 
    If you don't see these folders, then you have probably imported 'https://in.cns.iu.edu/svn/nwb' link instead of 'https://in.cns.iu.edu/svn/nwb/trunk' which might give you some errors later on.
    • If you get the error 'GC overhead limit exceeded eclipse' while doing 'Right click at trunk and select Checkout as Maven project from SCM ' , refer to: http://docs.oseems.com/general/application/eclipse/fix-gc-overhead-limit-exceeded
    • If you get the following error, make sure your SVN client is set to SVNKit (Pure Java). To do so, go to Window > Preferences > Team > SVN.

      The system cannot find the file specified.  
      svn: Unable to connect to a repository at URL 'svn+ssh://.../svn/nwb'
      svn: Can't create tunnel: The system cannot find the file specified.  
  • Use the following options
    • URL:svn [insert your SVN trunk URL] (For public anonymous checkout use https://in.cns.iu.edu/svn/nwb/trunk)
    • Click Advance and set Name template: [artifactId]-Sci2 to avoid conflict with CIShell projects
  • Set your SVN to ignore the auto generated files. This will prevent you to check in the unrelated source into repository. To do this, go to Window > Preferences > Team > Ignored Resources and click on Add Pattern... Add the following items:
    • target
    • *.prefs

Build

  • Go to parent-Sci2 directory, right click and choose Run As > Maven Clean to clean the previous build
  • Go to parent-Sci2 directory, right click and choose Run As > Maven Install to build and install Sci2. A target directory will be created in the /parent-Sci2/sci2/deployment/edu.iu.sci2.releng package.
    • While doing maven install for parent-Sci2 (Right clicking on parent-Sci2 > Run As > Maven Install ) , if you get any error like this -

      [ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:0.14.1:compile (default-compile) on project edu.iu.sci2.visualization.bipartitenet: Compilation failure: Compilation failure:
      [ERROR] C:\Users\username\workspace\parent-Sci2\sci2\plugins\normal_plugins\edu.iu.sci2.visualization.bipartitenet\src\edu\iu\sci2\visualization\bipartitenet\model\Node.java:[30,0]
      [ERROR] static final Function<String,Double> EXTRACT_DOUBLE_VALUE = new Function<String,Double>() {
      [ERROR] ^^^^^^^^^^^^^^^^^^^^^^^^^
      [ERROR] The blank final field FLOATING_POINT_NUMBER may not have been initialized
      [ERROR] 1 problem (1 error)

      Go to the path mentioned in the error, in this case it would be 'C:\Users\username\workspace\parent-Sci2\sci2\plugins\normal_plugins\edu.iu.sci2.visualization.bipartitenet\src\edu\iu\sci2\visualization\bipartitenet\model\Node.java'
      Here, the problem was initializing final variable, which was solved by removing 'final' keyword of that variable as it wasn't making big difference.
      You can debug the code in similar way if you come across such problem.

  • Following are the steps for ANT build:     (Read /parent-Sci2/sci2/deployment/edu.iu.sci2.releng/README about ANT build. Execute the ANT to create the final products. The final products will be available in /parent-Sci2/sci2/deployment/edu.iu.sci2.releng/target/products-final/ directory)
    • Steps to install ANT: (Reference: http://techgurulive.com/2009/05/05/how-to-install-ant-and-how-to-run-a-simple-ant-script/)
      • Download ANT from ant.apache.org, unzip it to a directory
        If you don't already have Apache Ant installed in your computer then go to http://ant.apache.org/bindownload.cgi and download the current release of ANT. (Here we have used Apache Ant 1.8.4)
        Unzip this file to some folder. ( Note: We will refer the path to this folder as 'your_path_to_ANT' in the following directions. )

      • Make sure JAVA_HOME is set on your windows PC c:\>echo %JAVA_HOME%
        You can check this by going to command prompt (Windows + R , Type cmd)

        Use command   ' echo %JAVA_HOME% '  to see if JAVA_HOME is set or not.
        C:\Users\username>echo %JAVA_HOME%

        If it is set, it will give you the path to JDK as shown below:
        C:\Users\username>echo %JAVA_HOME%
        C:\Program Files\Java\jdk1.6.0_32
        Make sure that JAVA_HOME points to JDK.

        If it is not set then echo command will return you the same thing as shown below:
        C:\Users\username>echo %JAVA_HOME%
        %JAVA_HOME%

        So if the JAVA_HOME is not set (or path is not pointing to JDK) then use '  set JAVA_HOME=your_path_to_JDK   ' to set the JAVA_HOME variable.
        C:\Users\username>set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_32

        Now check if JAVA_HOME is correctly set by using  ' echo %JAVA_HOME% '  command.

      • Set ANT_HOME in windows environment variables
        You can set ANT_HOME by going to command prompt (Windows + R , Type cmd)

        Use   ' set ANT_HOME=your_path_to_ANT '   to set the ANT_HOME variable.
        C:\Users\username>set ANT_HOME=C:\Users\username\apache-ant-1.8.4

        Now check if ANT_HOME is correctly set by using  ' echo %ANT_HOME% '  command. You should see the path you set when you use this command.
        C:\Users\username>echo %ANT_HOME%C:\Users\username\apache-ant-1.8.4

      • Set PATH for ANT, C:\ant.1.8.4\bin
        Again add path to ANT's bin folder to PATH variable by using command  ' set PATH=your_path_to_ANT\bin;%PATH% '
        (Note: It is very important to insert ';' & %PATH% at the end, otherwise it will overwrite existing PATH variable. We just need to append bin folder's path to PATH variable.)

      • Go to command prompt test your ant installation by typing c:\> ant
        Now if you will use ' ant ' command then it will give you:
        Buildfile: build.xml does not exist!
        Build failedThis error is generated because, by default ant try to find a build.xml file in current working dir.

        If you get following error,
        C:\Users\username>ant
        Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
        Buildfile: build.xml does not exist!
        Build failed

        then check if your JAVA_HOME is pointing to JDK directory & not JRE.
        (Reference: http://stackoverflow.com/questions/5730815/unable-to-locate-tools-jar)

    • After completing above steps of ANT installation,


      • Download ant-contrib-0.6-bin.zip from http://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-0.6/

      • When you will unzip this file, you'll get ant-contrib-0.6.jar file in lib folder.

      • Copy this jar file to Apache Ant folder's lib folder.

      • Now in Eclipse, go to  Window > Preferences > Ant > Runtime > Classpath , click on 'Ant Home...' option from the options on right side. Select Apache Ant folder, than Click OK, Click Apply & OK in Preferences.

        Note:
        While adding jar file in Window -> Preferences -> Ant -> Runtime -> Classpath , if you get a pop-up saying 'The specified Ant runtime classpath does not include a tools.jar library', you can do following things:
        The warning means your Java Setting under Window > Preferences > Java > Installed JREs points to JRE instead of JDK.
        All your ant stuff will work fine with the exception of the javac task which needs the tool.jar
        Either use :
        Window > Preferences > Ant > Runtime > Classpath and add the tools.jar from your JDK installation
        or
        change the settings under Window > Preferences > Java > Installed JREs from JRE to JDK
        to bring the tool.jar into the game.
        (Reference: http://stackoverflow.com/questions/8259518/eclipse-changing-runtime-ant-home-results-in-error-popup-regarding-missing-tool)

    • Now in Eclipse, go to parent-Sci2 folder > ant-parent > build.xml. In build.xml file, in the line <taskdef resource="net/sf/antcontrib/antcontrib.properties" />, replace 'antcontrib.properties' by 'antlib.xml' so the line will be <taskdef resource="net/sf/antcontrib/antlib.xml" />

    • Running Ant:
      • There are two ant build files you need to run. The first one is located in ant-parent/, and its task is to build and collect all the ant-built plugins in the source tree (with a few exceptions, see the file itself for more). To do this step, run

            ant -f ant-parent/build.xml

            Or in eclipse, just right click on build.xml > Run As > Ant Build.

        Now all the plugins should be present in the ant-parent/plugins directory.

      • The second script processes the Maven-built, runnable versions of Sci2, which lack these plugins. This ant script, sci2/deployment/edu.iu.sci2.releng/postMavenTasks.xml, consults a file (sci2-nonpde-plugins.txt in that same directory) and adds all the plugins named there into the zip files produced by the Maven build. The resulting complete runnable tools are then placed in sci2/deployment/edu.iu.sci2.releng/target/products-final/. The script also makes a change to the configuration/config.ini file in each product, so that the tools will notice the newly-added plug-ins. To run the step, run

            ant -f sci2/deployment/edu.iu.sci2.releng/postMavenTasks.xml

            Or in eclipse, just right click on postMavenTasks.xml > Run As > Ant Build.

        So now you should have a complete build of Sci2!  Yay!