This is a tutorial on setting up IntelliJ in such a way that it treats OPENRNDR, ORX and your template based work as a single inter-dependent project. This is useful in cases in which you want to make changes to OPENRND and ORX and be able to see their effect in your work immediately. Here immediately means without having to go through the process of running gradle publishToMavenLocal -Prelease.version=0.4.0-SNAPSHOT
. Composite projects are also convenient when you work with the debugger and want to set breakpoints inside OPENRNDR or ORX.
Step 1: clone repositories
mkdir composite
cd composite
git clone https://github.com/openrndr/openrndr
git clone https://github.com/openrndr/orx
git clone https://github.com/openrndr/openrndr-template
Note here that I make folder called composite
here, this will function as the top-level project in IntelliJ IDEA. You can pick whatever name you like for it.
Step 2: start IntelliJ IDEA
From terminal (but possible in other ways too), start IntelliJ. IntelliJ will treat our compsite
folder as a project. You probably need to install IntelliJ command-line tools for this work.
idea
Step 3: Import gradle projects
For each of the modules openrndr
, openrndr-template
, and orx
locate the build.gradle or build.gradle.kts files and use “Import Gradle Project” on them.
Step 4: Configure composite builds
- Open the Gradle view on the right.
- Right click on
openrndr-template
and open “Composite Build Configuration”. Check bothopenrndr
andorx
. - Right click on
orx
and open “Composite Build Configuration”, check onlyopenrndr
Step 5: Fix openrndr-template
I suspect this is an IntelliJ bug. In build.gradle.kts we have to change the line
runtimeOnly(openrndr("gl3"))
to implementation(openrndr("gl3"))
otherwise the GL3 back-end cannot be resolved (for reasons unclear to me)
Step 6: Fix run configuration
When IntelliJ launches programs it will set the CWD to composite, so you will have to change the working directory to composite/openrndr-template
That’s it. You should be able to run the template program while linking against the OPENRNDR and ORX versions in your composite project.