a template for openrndr project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Abe Pazos 0ff4e26091 build.gradle.kts: add openrndr("dialogs") dependency 2 years ago
.github/workflows Update used third-party github actions 2 years ago
data Add cheeta image for easy guide example usage 4 years ago
gradle Upgrade to Kotlin 1.8.20, slf4j 2.0.7, kotlin-logging 3.0.5, kotlin-csv 1.9.0 2 years ago
src/main Upgrade to Kotlin 1.6.0, Gradle 7.3 3 years ago
.gitattributes Update gradle to 6.8 (#15) 4 years ago
.gitignore Update .gitignore 3 years ago
README.md README.md: fix openrndr badge version number 2 years ago
build.gradle.kts build.gradle.kts: add openrndr("dialogs") dependency 2 years ago
gradle.properties Gradle cache has issues, disable it 2 years ago
gradlew Upgrade to Gradle 8.0.2 2 years ago
gradlew.bat Upgrade to Gradle 8.0.2 2 years ago
settings.gradle.kts Prefer mavenCentral before mavenLocal 2 years ago

README.md

OPENRNDR template project

A feature rich template for creating OPENRNDR programs based on Gradle/Kts.

The template consists of a configuration for Gradle and two example OPENRNDR programs. The Gradle configuration should serve as the go-to starting point for writing OPENRNDR-based software.

If you are looking at this from IntelliJ IDEA you can start by expanding the project tab on the left. You will find a template program in src/main/kotlin/TemplateProgram.kt and a live-coding example in src/main/kotlin/TemplateLiveProgram.kt.

You will find some basic instructions in the OPENRNDR guide

Gradle tasks

  • run runs the TemplateProgram
  • jar creates an executable platform specific jar file with all dependencies
  • jpackageZip creates a zip with a stand-alone executable for the current platform (works with Java 14 only)

Cross builds

To create a runnable jar for a platform different from your current platform, use ./gradlew jar -PtargetPlatform=<platform>, where <platform> is either windows, macos, linux-x64, or linux-arm64.

Updating OPENRNDR, ORX and other dependencies

The openrndr-template depends on various packages including the core openrndr and the orx extensions. The version numbers of these dependencies are specified in your libs.versions.toml file. If you want to learn about file format visit the Gradle documentation website.

Newer versions of OPENRNDR and ORX bring useful features and bug fixes. The most recent versions are
openrndr version for OPENRNDR.
orx version for ORX.

You can use those version numbers in your toml file. They can look like "0.4.3" or "0.4.3-alpha4". Use the complete string, as in:

openrndr = "0.4.3-alpha4"
orx = "0.4.3-alpha4"

You can add other dependencies needed by your project to your build.gradle.kts file, inside the dependencies { } block.

Remember to reload the Gradle configuration after changing any dependencies.

Run other Kotlin programs from the command line

By default ./gradlew run runs a program called TemplateProgram.kt but a different one can be provided as an argument:

To run src/main/kotlin/myProgram.kt

./gradlew -Popenrndr.application=MyProgramKt

To run src/main/kotlin/foo/bar/myProgram.kt (assuming package foo.bar in myProgram.kt)

./gradlew -Popenrndr.application=foo.bar.MyProgramKt

Github Actions

This repository contains a number of Github Actions under ./github/workflows.

build-on-commit.yaml runs a basic build on every commit, which can help detect issues in the source code.

publish-binaries.yaml publishes binaries for Linux, Mac and Windows any time a commit is tagged with a version number like v1.*.

For example, we can create and push a tag with these git commands:

git tag -a v1.0.0 -m "v1.0.0"
git push origin v1.0.0

The progress of the running actions can be followed under the Actions tab in GitHub. Once complete, the executables will be found under the Releases section.