Development

From OpenChrom-Wiki
Jump to: navigation, search

How to participate?

OpenChrom Community Edition is an open source software for chromatography and mass spectrometry. Hence, you're invited to download, edit and extend the platform. The following tutorial gives you a short overview how to setup an appropriate development environment.

Java

OpenChrom is based on Java. Hence, a JDK needs to be installed first.

Windows

Download the current JDK here: http://www.oracle.com/technetwork/java/javase/downloads

Ubuntu

OpenChrom is compiled against JDK8. So OpenJDK8 or Oracle JDK8 are fine. Of course, you can use Oracle JDK8 to run OpenChrom. Here's a description how to install the Oracle JDK8 under Ubuntu.

  • sudo add-apt-repository ppa:webupd8team/java
  • sudo apt-get update
  • sudo apt-get install oracle-java8-installer

Don't forget to install openjfx when using OpenJDK

  • sudo apt-get install openjdk-8-jdk
  • sudo apt-get install openjfx

openSUSE

OpenJFX isn't packaged so it is advised to use the Oracle JDK which includes JavaFX. RPM downloads are available from the Oracle Java Download site. See also the topic installing Java in the openSUSE Support Database for more information.


Eclipse Oomph

OpenChrom is based on Eclipse technology. First of all, please install the appropriate IDE to develop plugins for OpenChrom. Eclipse offers a technology, named Oomph, which makes the setup and installation of IDEs as easy as drinking a beer. Please download and execute the appropriate Oomph version for your plaform:

Basic Environment

Please follow the instructions to install the basic environment.

Execute Eclipe Oomph:

Setup-IDE-1.png

Select the "Advanced Mode...":

Setup-IDE-2.png

Add user products:

Setup-IDE-3.png

Paste the following URL: https://update.openchrom.net/main/downloads/setups/net.openchrom.ide.setup

Setup-IDE-4.png

Select the use product "OpenChrom - IDE". Switch to simple mode:

Setup-IDE-5.png

Select the entry "OpenChrom - IDE":

Setup-IDE-6.png

Install:

Setup-IDE-7.png

Wait while the IDE is installed on your computer:

Setup-IDE-8.png

Accept the certificates:

Setup-IDE-9.png

Launch the IDE:

Setup-IDE-10.png

Have a look at the "Eclipse Updater" messages. Access the dialog via the small icon in the footer toolbar:

Setup-IDE-11.png

Click on finish after all items have been installed:

Setup-IDE-12.png

Download / Install Target Platform

Please set the appropriate target platform. Download the platform bundles here and unpack it into your eclipse installation folder:

eclipse-4.6.x-base.zip

eclipse-4.6.x-e4tools.zip

eclipse-4.6.x-ease.zip

eclipse-4.6.x-efxclipse.zip

eclipse-4.6.x-knime.zip

eclipse-4.6.x-nattable.zip

eclipse-4.6.x-nebula.zip

eclipse-4.6.x-openchrom.zip

eclipse-4.6.x-orbit.zip

eclipse-4.6.x-pydev.zip

Setup-IDE-13.png

Setup-IDE-13-1.png

After the target platform has been unzipped, open the file "develop-4.6.x-local.target" and define this as the current target platform via "Set as Target Platform":

Setup-IDE-14.png


Run OpenChrom from scratch

After installing the basic environment, you'll then have the choice to fetch the complete source code or to run a user specific workspace.

Complete Source Code

Use this option if you'd like to modify the source code of OpenChrom.

Use the menu "Import..."

Setup-Full-4.png

And select the "Team Project Set" item:

Setup-Full-5.png

Paste the following URL: https://update.openchrom.net/main/downloads/setups/OpenChrom.psf:

Setup-Full-6.png

Fetching all sources could take a while:

Setup-Full-7.png

Select the OpenChrom product "openchrom.compilation.community.product" and press the button "Launch an Eclipse application":

Setup-Full-8.png

Now you can run OpenChrom from scratch:

Setup-Full-9.png


User Specific Workspace

Use the user specific workspace option if you only like to develop one or a few plugins for OpenChrom.

Go to the "Git" views list:

Setup-Light-3.png

And select the "Git Repositories" view:

Setup-Light-4.png

Use the "Git Repositories" to clone one or more specific repos you'd like to edit:

Setup-Light-5.png

Paste the appropriate project URL:

Setup-Light-6.png

Checkout the branches:

Setup-Light-7.png

Import the needed branch into your workspace (it's the location where Eclipse Oomph has installed the IDE):

Setup-Light-8.png

Everything is fine after fetching the source code:

Setup-Light-9.png

Create a new run configuration via "Run Configurations...":

Setup-Light-10.png

Add a new "Eclipse Application", name it "OpenChrom 1.2.x (Alder)" and select the product "net.openchrom.rcp.compilation.community.ui.product":

Setup-Light-11.png

Now you can run OpenChrom from scratch:

Setup-Light-12.png


Daily Pull

Open the "Git Repositories" view and "Pull" all repos before you start to work.

Daily-Update-Workspace.png


Contribute

The source code of OpenChrom is hosted at [1]. There are currently several projects hosted at GitHub that belong to OpenChrom. Please create the following accounts if you'd like to participate in the development. If you just want to download the code and run OpenChrom, you can skip this section.

GitHub Account: [2]

Eclipse Account: [3]

Eclipse Contributor Agreement (login and follow the "Sign" link): [4]

Development - best practices

Format the source code on each save action.

EditorFormatSave.png

Please use the scripts under org.eclipse.chemclipse.utils/scripts for your development.

./pull-projects.sh - run this script before you start to work on a feature ./status-projects.sh - run this script before you finish your work (the workspace must be clean before you leave it)

Please develop in short cycles and try to pull/push as often as possible. Finish your work within 1 day. Otherwise, split your work in to smaller pieces.

Package renaming

OpenChrom is under active development. Thus plugin and package names may be refactored from time to time. After getting the latest updates (git pull) a workspace refresh may displays the following message:

Package-Rename-1.png

Accept "Yes" and re-import the plugins/packages in the following way "Git Repositories -> Select Repo -> Import Projects...":

Package-Rename-2.png

Package-Rename-3.png

Package-Rename-4.png

Delete workspace repo

If you'd like to delete a repo completely, do the following steps:

Repo-1.png

Repo-2.png

Import workspace repo

Clone a repo in the following way. Select the "develop" branch and ensure that the code is cloned into the workspace.

Clone-1.png

Clone-2.png

Clone-3.png

Clone-4.png

Clone-5.png