Skip to content

Latest commit

 

History

History
129 lines (86 loc) · 6.41 KB

CONTRIBUTING.MD

File metadata and controls

129 lines (86 loc) · 6.41 KB

Setting up the development environment

To have the development environment ready for BaRatinAGE V3, you'll need the following:

  • java JDK (Java Development Kit)
  • Maven
  • the BaRatinAGE source code
  • a compiled version of BaM for you system
  • a compiled version of distribution BMSL cli
  • optionnally: git, to clone the BaRatinAGE repository and get the source code

Getting Java

For your development environment, you'll need a recent enough version of Java Standard Edition. It is recommended to have the most recent Long Term Support (LTS) release. You need at least the Java SE 10 but we recommand you use Java 19.

Also note that you need the JDK (the JRE isn't enough) since some of the necessary tools only come with the JDK. For example, on linux, if you're using OpenJDK, make sure you install the jdk by running this command (adapt to the desired version):

apt install openjdk-19-jdk

... and not apt install openjdk-19-jre

Getting Maven

Note: if you're using Eclipse, you may not need to install Maven since Eclipse comes with its own embedded version of Maven.

Maven can be downloaded from the Maven Official Website. As stated in the Installing Apache Maven page

The installation of Apache Maven is a simple process of extracting the archive and adding the bin directory with the mvn command to the PATH.

Below a detailed approach you can follow on windows is suggested but feel free to install Maven any way you see fit!

  1. downloaded the zip file from https://maven.apache.org/index.html
  2. unzip it in C:\Program Files\Java folder (administrator privilege requrired). Note: any folder would do! I give an example using the Java folder because this makes the most sense to me but feel free to use any directory you like.
  3. update the PATH environment variable by adding the path to the maven bin folder; for example: C:\Program Files\Java\apache-maven-3.8.6\bin. Note: see this www.howtogeek.com article to learn to modify an environment variable on windows
  4. restart the terminal/console. The command mvn -version should return the version of Maven you're working with.

Getting the BaRatinAGE source code source code

To get the source code of BaRatinAGE v3 simply clone the GitHub BaRatinAGE repository. In other words, open a terminal in the directory where BaRatinAGE source code will be downloaded and run the following commands:

git clone https://github.com/BaRatin-tools/BaRatinAGE.git
cd BaRatinAGE

Alternatively, simply download the source code from GitHub as a .zip archive file that you unzip in a directory of your choice.

Getting BaM executable

To get the BaM executable, refere to the instructions in the readme of the GitHub BaM repository. Note: you need a version that doesn't wait for a user input to exit at the end of the execution!

It can be compiled from source as described below.

Prerequisit for compiling BaM on Windows

On windows, you need to install a Fortran compiler (see https://fortran-lang.org/en/compilers/). We recommend GFortran. Binaries for this compiler can be found here.

On windows, you can do the following:

  • install msys: https://www.msys2.org/
  • run msys2 and install the following packages using pacman (pacman -S <package name>):
  • add C:\msys64\usr\bin and C:\msys64\mingw64\bin to you path environment variable (modify the paths according to where you install msys2)

Compiling BaM using the makefile

In a folder, clone the 3 required repositories:

git clone https://github.com/BaM-tools/BaM.git
git clone https://github.com/benRenard/BMSL.git
git clone https://github.com/benRenard/miniDMSL.git

To build, BaM, navigate with the console to BaM/makefile and run: make. This will build the executable file, named BaM (BaM.exe on windows).

BaRatinAGE directory final setup

After getting the BaRatinAGE source code, you need to add a directory named exe at the root of the project where you copy/past the BaM executable.

IDE setup

Use any IDE you like for Java development. Here are the steps for Eclipse and Visual Studio Code.

Eclipse

  1. Click File > Import
  2. Choose Maven > Existing Maven Project
  3. Select the root directory of BaRatinAGE

Done!

Visual Studio Code (VS Code)

Visual Studio Code needs to be setup correctly for Java. To do so, please refere to this Getting Started with Java in VS Code. Basically, you need to install the Extension Pack for Java. The Extension Pack for Java can be found by searching the extensions in the extension panel of VS Code. If you're using VS Codium, you may need to download the vsix file for the Extension Pack for Java (on the right panel, click download) and install it manually.

Packaging BaRatinAGE

Packaging BaRatinAGE refers to both creating the executable jar file and using jpackage to create a standalone, platform specific, executable.

A powershell script build.ps1 should be used. On Linux, you probably need to install powershell to run the script.

The build.ps1 script takes one mandatory arguments, the version number. Optionnaly, you can use it to also create the final archive (*.zip or *.tar.gz file) using the -archive flag. A -quiet flag can also be used to prevent printing too much information to the console.

For example, to build the version v3.0.3, you can run the following in a powershell console:

.\build.ps1 "3.0.3" -archive