tutorials:setup-groimp-dev-environment
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tutorials:setup-groimp-dev-environment [2024/12/04 19:28] – [Download GroIMP source code] gaetan | tutorials:setup-groimp-dev-environment [2024/12/18 10:55] (current) – [Installation of required tools] gaetan | ||
---|---|---|---|
Line 9: | Line 9: | ||
* [[: | * [[: | ||
* [[: | * [[: | ||
- | * [[:dev-guide: | + | * [[https:// |
* [[: | * [[: | ||
Line 18: | Line 18: | ||
* **Maven**: On Debian system you can get Maven with '' | * **Maven**: On Debian system you can get Maven with '' | ||
* **Eclipse**: | * **Eclipse**: | ||
+ | * [[https:// | ||
===== Download GroIMP source code ===== | ===== Download GroIMP source code ===== | ||
Line 35: | Line 36: | ||
* Click on //Fork project//. | * Click on //Fork project//. | ||
- | {{: | + | //Image 1// {{: |
- | {{: | ||
+ | //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 ==== | ==== 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 | + | 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 '' | ||
+ | |||
+ | In GitLab go in your profile, then in ssh keys. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | * Click on '' | ||
+ | * 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. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | * Once it is done you can click on '' | ||
+ | |||
+ | Open a terminal (git bash/or power shell 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: | ||
+ | </ | ||
+ | |||
+ | Where YOURUSERNAME is your GitLab user name (e.g. git@gitlab.com: | ||
+ | |||
+ | If you didn't set up your ssh key you can use: | ||
+ | < | ||
+ | git clone https:// | ||
+ | </ | ||
+ | |||
+ | If you didn't fork you can clone from the main repo: | ||
+ | < | ||
+ | git clone git@gitlab.com: | ||
+ | </ | ||
+ | |||
+ | You should have a directory called groimp with all the content of the core repository. | ||
+ | |||
+ | ===== Use Maven to compile ===== | ||
+ | |||
+ | Now that we have the source code in a local directory, we can compile (or even package) it. To do so, move the terminal (git bash/or power shell on windows) to the groimp directory (with '' | ||
+ | Then, use the maven command: '' | ||
+ | This should create a folder called **app** in the current directory. This app folder is where compiled GroIMP plugins goes in the format ready to be shared. In it there is a platform-core....jar file. You can start groimp by starting this jar. (either double click on Windows, or from the terminal '' | ||
+ | |||
+ | You will notice however that, with only the core, GroIMP lack most of its features. Even some of the most used like RGG. You could download them using the [[: | ||
+ | |||
+ | ==== Add other plugins to the command ==== | ||
+ | |||
+ | set your terminal in the main groimp directory (the one you used mvn package in) and download the two plugins [[https:// | ||
+ | |||
+ | < | ||
+ | git clone git@gitlab.com: | ||
+ | git clone git@gitlab.com: | ||
+ | </ | ||
+ | |||
+ | You now have two new directory: GPUFlux and RGG in your groimp directory. They are not yet included in the maven commands though. | ||
+ | To include them in the build from the groimp directory (the parent pom), you need to modify that pom.xml file. | ||
+ | on the bottom of the file in the < | ||
+ | |||
+ | Now the command '' | ||
+ | |||
+ | ==== Compile individual plugins ==== | ||
+ | |||
+ | If you do not want to download the source of the whole GroIMP core and some additional plugins, you can compile plugins alone. The core, and other plugin dependencies can be retrieved by Maven. | ||
+ | For Maven to be able to download package from the GroIMP git repository, it requires to be set up. | ||
+ | |||
+ | First, create a file called '' | ||
+ | |||
+ | <code xml> | ||
+ | < | ||
+ | xsi: | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Then, get your private token. In gitlab under profile> | ||
+ | |||
+ | You can now go in the directory of any GroIMP plugin (go in the RGG directory for instance) and compile it (With '' | ||
+ | |||
+ | ===== Set up Eclipse ===== | ||
+ | |||
+ | ==== Import the repository in Eclipse ==== | ||
+ | |||
+ | Now that we have the source code of the plugin(s) we want to modify, we can import it in Eclipse. | ||
+ | |||
+ | Open Eclipse | ||
+ | |||
+ | In Eclipse, click on //File > Import...// | ||
+ | |||
+ | Open the category `Maven`. | ||
+ | |||
+ | Select `Existing Maven Projects`. | ||
+ | |||
+ | Set the Root Directory as either a specific plugin directory, or as the groimp repository you downloaded. | ||
+ | |||
+ | All GroIMP plugins in that directory 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 // | ||
+ | |||
+ | ==== 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 resources 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. | ||
+ | |||
+ | Go to //Run > Run Configurations...// | ||
+ | |||
+ | In the menu on the left side in the following window, select `Java Application` and click the most left button in the symbol menu above to create a new java application starter. | ||
+ | |||
+ | Give the starter a good name, for example `GroIMP`. | ||
+ | |||
+ | Select the project `Platform-Core` if it is not selected automatically. | ||
+ | |||
+ | Select the main class `de.grogra.pf.boot.Main` if it is not selected automatically. Make sure to select it from the // | ||
+ | |||
+ | Then, click on //Apply// and go to the tab `x() = Arguments`. | ||
+ | |||
+ | For the program arguments, a very special parameter `--project-tree` is required. This parameter is important because the directory structure differs between the development version in Eclipse and the ready-to-use installed version. GroIMP needs this parameter to search in differing directories for plugins and configuration files. If this parameter is missing in the Eclipse development version, GroIMP will show an error window with the text "No application found" | ||
+ | For the JVM arguments, add `-Xmx3000m`. If required, more or less memory can be specified here instead of 3000 MB. | ||
- | | + | Check [[:User-Guide:Advanced-GroIMP-arguments | GroIMP additional arguments]] for more information on the most common arguments you can change when running GroIMP. |
- | | + | |
- | | + | |
- | - create a access token for maven | + | |
- | - On your device | + | |
- | - install git | + | |
- | - install maven (https:// | + | |
- | - create a ssh key (https:// | + | |
- | - clone core | + | |
- | - add maven key to m2 folder | + | |
- | - Build | + | |
- | - Eclipse | + | |
- | - install eclipse | + | |
- | - create new workspace | + | |
- | - import maven projects | + | |
- | - configure build | + | |
- | - add GPUFlux | + |
tutorials/setup-groimp-dev-environment.1733336885.txt.gz · Last modified: 2024/12/04 19:28 by gaetan