====== Setup GroIMP with Git and Eclipse ======
In this tutorial we will cover how to:
* Use Git to download GroIMP source code
* Use Maven to compile the code
* Set up Eclipse as IDE
You can find more in depth info on :
* [[:dev-guide:getting-started|Download the source code]]
* [[:dev-guide:developer-guide|Set up Eclipse]]
* [[:dev-guide:setup-maven-token|Set up a Maven token]]
* [[:dev-guide:maven-commands|Additional commands with maven]]
===== Installation of required tools =====
In this tutorial we will use the following software (make sure they are installed on your computer):
* **Git**: On Linux system this is usually installed by default. On windows or MAC you can follow the tutorial from [[https://github.com/git-guides/install-git|Github]].
* **Maven**: On Debian system you can get Maven with ''sudo apt install maven -y''. On Windows, you can download the archive [[https://maven.apache.org/download.cgi|on the official website]], unzip the file, and add it to the PATH variable.
* **Eclipse**: For Debian systems you can follow the tutorial on the [[https://wiki.debian.org/Eclipse|debian website]]: On Windows, you can download the installer from the [[https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2024-09/R/eclipse-inst-jre-win64.exe|eclipse website]].
===== Download GroIMP source code =====
GroIMP source code is hosted on [[https://gitlab.com/grogra/|gitlab]]. It is split between the [[https://gitlab.com/grogra/groimp|core]] - which includes the core plugin to start GroIMP (but not RGG modeling); and the [[https://gitlab.com/grogra/groimp-plugins|additional plugins]].
It is possible to download each gitlab repositories without creating accounts from the web page:
{{:tutorials:gitlab_dl.png?200|}}
In order to properly push back modifications, it is recommended to get the sources using git. In order to do so, you need to have a GitLab account (which you can create [[https://gitlab.com/users/sign_up|here]]).
Once you are registered, you can fork the project: (see the two following images)
* Go to the git repository page in your internet browser.
* Click on the //Fork// button of the repository. (img 1)
* Select your own gitlab namespace and optionally an other project name (not recommended). (img 2.1)
* Only get the main branch (it is smaller) (img 2.2)
* Click on //Fork project//.
//Image 1// {{:tutorials:fork.png?400| Ímage 1}}
//Image 2// {{:tutorials:fork2.png?400|Image 2}}
The fork is optional in order to download the code, but it is recommended if you plan on pushing modification back to the main repository (it keeps the modifications management clean).
==== Add an ssh key to Gitlab ====
To skip the authentication for every git command to your gitlab repository, one way is to add an ssh key from your computer to your gitlab account.
First create an ssh key if you don't already have one, by running the ''ssh-keygen'' command. This should create two files in your /home/.ssh/ folder: id_rsa and id_rsa.pub.
In GitLab go in your profile, then in ssh keys.
{{:tutorials:sshkey1.png?200|}}
* Click on ''Add key''
* In the new panel, paste the content of your public key in the corresponding area. The public key is the id_rsa**.pub**. You should NEVER share the other one ( the private key). On windows to open the file you can right click on it, open with, text editor.
{{:tutorials:sshkey2.png?300|}}
* Once it is done you can click on ''Add key''
Open a terminal (git bash on windows) and go to your working directory (Where GroIMP is going to be downloaded).
You can now clone the git repository on your computer with the simple git command:
git clone git@gitlab.com:YOURUSERNAME/groimp.git
Where YOURUSERNAME is your GitLab user name (e.g. git@gitlab.com:gaetan.heidsieck/groimp.git is a valid repo).
If you didn't set up your ssh key you can use:
git clone https://gitlab.com/YOURUSERNAME/groimp.git
If you didn't fork you can clone from the main repo:
git clone git@gitlab.com:grogra/groimp.git
You should have a directory called groimp with all the content of the core repository.
- On gitlab:
- Create a Gitlab account
- Fork the core repository
- create a access token for maven
- On your device
- install git
- install maven (https://phoenixnap.com/kb/install-maven-windows)
- create a ssh key (https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/GitHub-SSH-Windows-Example)
- clone core
- add maven key to m2 folder
- Build
- Eclipse
- install eclipse
- create new workspace
- import maven projects
- configure build
- add GPUFlux