dev-guide:getting-started
                Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| dev-guide:getting-started [2024/06/25 10:17] – created gaetan | dev-guide:getting-started [2024/12/18 10:54] (current) – [Developer Guide] gaetan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== Developer Guide ===== | + | ====== Developer Guide ====== | 
| - | Welcome to this developer guide! | + | Welcome to this developer guide! | 
| - | + | ||
| - | This guide starts with the installation of Eclipse and ends with a merge request for the own code changes. | + | |
| - | + | ||
| - | The plan is to do following steps: | + | |
| - | + | ||
| - | - Installing **Eclipse**. This can be skipped if it is already installed. | + | |
| - | - (Optional) **Forking** the official repository to an own one. This is done to be able to commit and push changes. | + | |
| - | - (Optional) **Mirroring** the fork repository to the official one. This merges updates of the official repository to the fork repository automatically. | + | |
| - | - **Cloning** the fork repository to the local computer (in Eclipse) | + | |
| - | - Adjusting the **compiler** and **Java version** | + | |
| - | - Setting up a **start** configuration | + | |
| - | - **Pushing** code to the own remote repository (fork of official repository) | + | |
| - | - Creating a **merge request** for the own code changes | + | |
| - | + | ||
| - | ==== General information ==== | + | |
| - | + | ||
| - | * This guide is based on the usage of Linux. Except the installation of Eclipse, all steps should also be reproducable on Windows or other systems. | + | |
| - | * GroIMP is best compatible with Java 11 for both compilation and execution. It is possible to run GroIMP in newer version of Java, but for Java version 17+, the OpenGL view is not supported. | + | |
| + | Developing on the GroIMP source code only require a java compiler. Additionally GroIMP support two development setup: Maven and Eclipse. | ||
| ==== Requirements ==== | ==== Requirements ==== | ||
| - | * Experience with Java and Git | + | To compile GroIMP you will need the following additional tools: | 
| - | * A gitlab account on [[ https://gitlab.com | Gitlab]] for cloning in Eclipse (**optional** if the cloning is done without Eclipse). | + | * [[https://maven.apache.org/ | 
| - | * Java >= 17 | + |  | 
| + | * [[https:// | ||
| + | ===== Get the source code ===== | ||
| + | The first step to start developing on the code is to get it. The code is entirely open source and available on [[https:// | ||
| - | ==== Installing Eclipse ==== | + | The source code is split between | 
| - | + | ||
| - | === Windows === | + | |
| - | + | ||
| - | On Windows, an Eclipse installer can be downloaded from the [[ https://www.eclipse.org/downloads/packages/ | + | |
| - | + | ||
| - | === Linux === | + | |
| - | + | ||
| - | If an older Eclipse | + | |
| - | + | ||
| - | If it was installed with `apt`: | + | |
| - | + | ||
| - | < | + | |
| - | sudo apt-get autoremove --purge eclipse | + | |
| - | </ | + | |
| - | + | ||
| - | If it was installed with `snap`: | + | |
| - | + | ||
| - | < | + | |
| - | sudo snap remove eclipse | + | |
| - | </ | + | |
| - | + | ||
| - | Now, update the system | + | |
| - | < | + | |
| - | sudo apt-get update | + | |
| - | sudo apt-get install default-jre | + | |
| - | </ | + | |
| - | + | ||
| - | Then, install Eclipse. This is the way with `apt`: | + | |
| - | < | + | |
| - | sudo apt-get install eclipse | + | |
| - | </ | + | |
| - | + | ||
| - | Otherwise, it can be installed with `snap`. This is also the right way if the used Linux is an older one (for example Ubuntu 18.04). The current version of Eclipse is not compatible with older Linux distributions: | + | |
| - | + | ||
| - | < | + | |
| - | sudo snap install --classic eclipse | + | |
| - | </ | + | |
| ==== (Optional) Forking the repository ==== | ==== (Optional) Forking the repository ==== | ||
| - | Go to [[https:// | + | * Go to the git repository page in your internet browser. | 
| - | + |  | |
| - | Click on the //Fork// button of the repository. | + |  | 
| - | + |  | |
| - | Select your own gitlab namespace and optionally an other project name (not recommended). | + |  | 
| - | + | ||
| - | Change or reuse the project slug and description. | + | |
| - | + | ||
| - | Click on //Fork project//. | + | |
| ==== (Optional) Mirroring the repository ==== | ==== (Optional) Mirroring the repository ==== | ||
| - | In an internet browser, go to your own repository that forks the official one. | + | * In an internet browser, go to your own repository that forks the official one. | 
| - | + |  | |
| - | On the side bar, click on // | + |  | 
| - | + |  | |
| - | Expand the category `Mirroring repositories`. | + |  | 
| - | + | **Note: the two previous steps are optional | |
| - | Insert the URL of the official repository: [[https:// | + | |
| - | + | ||
| - | Click on //Mirror repository// | + | |
| - | + | ||
| - | **Note: the two previous steps are optionals | + | |
| ==== Cloning the repository ==== | ==== Cloning the repository ==== | ||
| - | |||
| - | === In Eclipse === | ||
| - | |||
| - | Click on //File// > // | ||
| - | |||
| - | Open the category `Git` | ||
| - | |||
| - | Select //Projects from Git// | ||
| - | |||
| - | Click on //Next > // | ||
| - | |||
| - | Select `Clone URI` | ||
| - | |||
| - | Click //Next > // | ||
| - | |||
| - | Insert `git@gitlab.com: | ||
| - | forked repository | ||
| - | |||
| - | The other fields are automatically set. | ||
| - | |||
| - | Click on //Next > // | ||
| - | |||
| - | The key information is shown now. | ||
| - | |||
| - | Select the checkbox `Accept and store this key, and continue connecting? | ||
| - | |||
| - | Click on //OK<// | ||
| - | |||
| - | Now, the branch selection window appears. | ||
| - | |||
| - | All branches should be selected. | ||
| - | |||
| - | Click on //Next > // | ||
| - | |||
| - | Set the local path to the repository. It should be in your user directory in the subdirectory `/ | ||
| - | |||
| - | Click on //Next > // | ||
| - | |||
| - | This may take much time since the repository is very large (800 MB). | ||
| - | |||
| - | In the resulting window, click //Next > // | ||
| - | |||
| - | In the next window, all subprojects must be selected. | ||
| - | |||
| - | Click on //Finish// | ||
| - | |||
| - | Wait until it has been built. | ||
| - | |||
| - | The repository is imported as a long list of projects. | ||
| - | |||
| - | The repository is imported in Ecplise and you can go to setting Eclipse up. | ||
| === From GitLab === | === From GitLab === | ||
| Line 153: | Line 42: | ||
| It is possible to simply download the directory of source code from GitLab on the main page [[https:// | It is possible to simply download the directory of source code from GitLab on the main page [[https:// | ||
| - | |||
| You can then download the whole repository as any archive format you like. | You can then download the whole repository as any archive format you like. | ||
| - | + | Once it is downloaded, extract the archive to the directory | |
| - | Once it is downloaded, extract the archive to the directory | + | |
| - | + | ||
| - | You still need to import the repository in Eclipse. See two section bellow. | + | |
| === From a bash command === | === From a bash command === | ||
| You can clone a repository from GitLab with the command line: | You can clone a repository from GitLab with the command line: | ||
| - | |||
| < | < | ||
| git clone  https:// | git clone  https:// | ||
| Line 170: | Line 54: | ||
| This will create a directory named groimp and download all the remote content in it. | This will create a directory named groimp and download all the remote content in it. | ||
| - | You still need to import the repository in Eclipse. See the section bellow. | ||
| - | |||
| - | === Import the repository in Eclipse === | ||
| - | |||
| - | You have the repository with GroIMP source code on your local device. | ||
| - | |||
| - | In Eclipse, click on //File > Import...// | ||
| - | |||
| - | Open the category `Maven`. | ||
| - | |||
| - | Select `Existing Maven Projects`. | ||
| - | |||
| - | Set the Root Directory as the groimp repository you downloaded. | ||
| - | |||
| - | All GroIMP plugins should appear in the projects list. | ||
| - | |||
| - | Click on `Finish`. | ||
| - | |||
| - | |||
| - | ==== Setting up Java Runtime Environment ==== | ||
| - | |||
| - | To setup the JRE, go to //Java > Installed JREs//. | ||
| - | |||
| - | In Eclipse, the default JRE used can be an embedded JRE from Eclipse, which will not work with GroIMP. | ||
| - | If it is the case, add a new JRE by clicking on `Add...`, `Standard VM`, then, point at the root of a JDK on your computer (e.g. / | ||
| - | |||
| - | Make sure that this version is selected. | ||
| - | |||
| - | Notice that a newer version of Java can work but might not be compatible with the OpenGL 3D view. | ||
| - | |||
| - | In case of changes, click //Apply//. | ||
| - | |||
| - | ==== Setting up the compiler ==== | ||
| - | |||
| - | The next step is to set the compliance level. Therefore, go to //Java > Compiler//. | ||
| - | |||
| - | Set the `Compiler compliance level` to `17`. The warning on the bottom can be ignored. | ||
| - | |||
| - | Then click on //Apply and Close//. | ||
| - | |||
| - | Eclipse will ask whether all projects should be rebuilt now, click on //Yes//. | ||
| - | |||
| - | Depending on your computer, the build process may take some minutes. | ||
| - | |||
| - | ==== Setting up Start configuration ==== | ||
| - | |||
| - | === Maven resouces copy === | ||
| - | |||
| - | GroIMP uses some third party library, which are not automatically downloaded with the source code. To run GroIMP in Eclipse you need to force their download into your local repository. | ||
| - | |||
| - | This operation is only required every time you clean the project with Maven. Eclipse will not delete the libraries. | ||
| - | |||
| - | Either use `mvn generate-resources` in a terminal at the root of the project, or in Eclipse | ||
| - | go to //Run > Run Configurations...// | ||
| - | |||
| - | In the menu on the left, select `Maven Build`. In the menu on the right select the root directory as `Base directory`, either by clicking `Workspace...`> | ||
| - | |||
| - | Then, set the `Goals` as `generate-resources`. | ||
| - | |||
| - | Click on `Apply`, then `Run`. | ||
| - | |||
| - | This should copy all third parties libraries defined in the poms files of your projects to their target/lib repository, making it visible to GroIMP. | ||
| - | |||
| - | === Start the platfrom === | ||
| - | Now you need to set up the main GroIMP class to be run. | + | ===== Compile with Maven ===== | 
| - | Go to //Run > Run Configurations...//. | + | Now that you have the source code on your local device, you can compile it with Maven. Maven require '' | 
| + | GroIMP core have both a parent pom.xml and a pom.xml for each plugins. Additional plugins only have their pom.xml. | ||
| + | Maven commands are executed from a terminal (bash, Powershell, ...). | ||
| + | Maven commands can be executed either at the project level (on the parent '' | ||
| - | In the menu on the left side in the following window, select `Java Application` and click the most left button | + | The plugins are added with the < | 
| - | Give the starter a good name, for example `GroIMP`. | + | The most useful maven commands are: | 
| - | Select | + | * '' | 
| + | * '' | ||
| + | * '' | ||
| - | Select | + | If you package | 
| + | '' | ||
| - | Then, click on //Apply// and go to the tab `x() = Arguments`. | + | ==== Common errors ==== | 
| - | For the program arguments, a very special parameter `--project-tree` | + | The maven commands can fail, here are some common errors: | 
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| - | For the JVM arguments, add `-Xmx3000m`. If required, more or less memory can be specified here instead of 3000 MB. | + | ===== Eclipse ===== | 
| - | Check [[:User-Guide:Advanced-GroIMP-arguments | + | See the guide on how to setup your Eclipse environment | 
dev-guide/getting-started.1719303437.txt.gz · Last modified: 2024/06/25 10:17 by gaetan
                
                