Compare commits
22 Commits
wipGradle9
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
326474823c | ||
|
|
3d6774275a | ||
|
|
d38df2eed7 | ||
|
|
622bfc5077 | ||
|
|
c2756d2b9d | ||
|
|
3ed7c18932 | ||
|
|
86c36a0f35 | ||
|
|
e6a9e319d9 | ||
|
|
a385ebb216 | ||
|
|
e1d44de9a1 | ||
|
|
8191515779 | ||
|
|
7597ac35e2 | ||
|
|
69f698df1f | ||
|
|
f93a523115 | ||
|
|
aa3e5e15ac | ||
|
|
ef7cee01c7 | ||
|
|
de35f064d8 | ||
|
|
524635e1ad | ||
|
|
db5ea1cdd2 | ||
|
|
3ef46bcc4e | ||
|
|
1384143d6f | ||
|
|
10ccb692c7 |
33
README.md
33
README.md
@@ -7,13 +7,20 @@ 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`.
|
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](https://guide.openrndr.org/setUpYourFirstProgram.html) in the [OPENRNDR guide](https://guide.openrndr.org)
|
You will find some [basic instructions](https://guide.openrndr.org/setUpYourFirstProgram.html) in the [OPENRNDR guide](https://guide.openrndr.org).
|
||||||
|
|
||||||
## Gradle tasks
|
## Gradle tasks
|
||||||
|
|
||||||
- `./gradlew run` runs the TemplateProgram (Use `gradlew.bat run` under Windows)
|
- `./gradlew run` runs `TemplateProgram.kt` (Use `gradlew.bat run` under Windows)
|
||||||
|
- `./gradlew run -Popenrndr.application=MyProgramKt` runs `src/main/kotlin/myProgram.kt`
|
||||||
|
- `./gradlew run -Popenrndr.application=foo.bar.MyProgramKt` runs `src/main/kotlin/foo/bar/myProgram.kt` (assuming `package foo.bar` is used in myProgram.kt)
|
||||||
- `./gradlew shadowJar` creates an executable platform specific jar file with all dependencies. Run the resulting program by typing `java -jar build/libs/openrndr-template-1.0.0-all.jar` in a terminal from the project root. If your project contains multiple `main` methods, specify which one to run with `java -cp build/libs/openrndr-template-1.0.0-all.jar MyProgramKt`, where `MyProgramKt` can also be `foo.bar.MyProgramKt` if it's in the package `foo.bar`.
|
- `./gradlew shadowJar` creates an executable platform specific jar file with all dependencies. Run the resulting program by typing `java -jar build/libs/openrndr-template-1.0.0-all.jar` in a terminal from the project root. If your project contains multiple `main` methods, specify which one to run with `java -cp build/libs/openrndr-template-1.0.0-all.jar MyProgramKt`, where `MyProgramKt` can also be `foo.bar.MyProgramKt` if it's in the package `foo.bar`.
|
||||||
- `./gradlew jpackageZip` creates a zip with a stand-alone executable for the current platform (works with Java 14 only). Run it like this: `cd build/jpackage/openrndr-application/ && bin/openrndr-application`.
|
- `./gradlew jpackageZip` creates a zip with a stand-alone executable for the current platform (requires Java 17 or newer). Run it like this: `cd build/jpackage/openrndr-application/ && bin/openrndr-application`.
|
||||||
|
- `./gradlew dependencyUpydates` checks whether any dependencies have newer versions.
|
||||||
|
|
||||||
|
## Tips and issues
|
||||||
|
|
||||||
|
See the [wiki](https://github.com/openrndr/openrndr-template/wiki)
|
||||||
|
|
||||||
## Cross builds
|
## Cross builds
|
||||||
|
|
||||||
@@ -26,10 +33,10 @@ provides the optional [orsl](https://github.com/openrndr/orsl/) shader helper mo
|
|||||||
The version numbers of these dependencies are specified in your [libs.versions.toml](gradle/libs.versions.toml) file.
|
The version numbers of these dependencies are specified in your [libs.versions.toml](gradle/libs.versions.toml) file.
|
||||||
Learn more about this file in the [Gradle documentation](https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml) website.
|
Learn more about this file in the [Gradle documentation](https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml) website.
|
||||||
|
|
||||||
Newer versions bring useful features and bug fixes. The most recent versions are
|
Newer versions bring useful features and bug fixes. The most recent versions are<br>
|
||||||
<br> for OPENRNDR.
|

|
||||||
<br> for ORX.
|

|
||||||
<br> for ORSL.
|
.
|
||||||
|
|
||||||
Switch to the [next-version branch](https://github.com/openrndr/openrndr-template/tree/next-version) or enter these versions manually in your toml file.
|
Switch to the [next-version branch](https://github.com/openrndr/openrndr-template/tree/next-version) or enter these versions manually in your toml file.
|
||||||
They can look like "0.4.3" or "0.4.3-alpha4". Use the complete string, as in:
|
They can look like "0.4.3" or "0.4.3-alpha4". Use the complete string, as in:
|
||||||
@@ -42,18 +49,6 @@ You can add other dependencies needed by your project to your [build.gradle.kts]
|
|||||||
|
|
||||||
⚠️ Remember to reload the Gradle configuration after changing any dependencies.
|
⚠️ 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 run -Popenrndr.application=MyProgramKt
|
|
||||||
|
|
||||||
To run `src/main/kotlin/foo/bar/myProgram.kt` (assuming `package foo.bar` in myProgram.kt)
|
|
||||||
|
|
||||||
./gradlew run -Popenrndr.application=foo.bar.MyProgramKt
|
|
||||||
|
|
||||||
## Github Actions
|
## Github Actions
|
||||||
|
|
||||||
This repository contains various Github Actions under `./github/workflows`:
|
This repository contains various Github Actions under `./github/workflows`:
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ import org.gradle.internal.os.OperatingSystem
|
|||||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||||
import org.panteleyev.jpackage.ImageType
|
|
||||||
|
|
||||||
group = "org.openrndr.template"
|
group = "org.openrndr.template"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
@@ -12,11 +11,12 @@ val applicationMainClass = "TemplateProgramKt"
|
|||||||
|
|
||||||
/** ## additional ORX features to be added to this project */
|
/** ## additional ORX features to be added to this project */
|
||||||
val orxFeatures = setOf<String>(
|
val orxFeatures = setOf<String>(
|
||||||
|
// "orx-axidraw",
|
||||||
// "orx-boofcv",
|
// "orx-boofcv",
|
||||||
"orx-camera",
|
"orx-camera",
|
||||||
// "orx-chataigne",
|
// "orx-chataigne",
|
||||||
"orx-color",
|
"orx-color",
|
||||||
// "orx-composition",
|
"orx-composition",
|
||||||
"orx-compositor",
|
"orx-compositor",
|
||||||
// "orx-compute-graph",
|
// "orx-compute-graph",
|
||||||
// "orx-compute-graph-nodes",
|
// "orx-compute-graph-nodes",
|
||||||
@@ -63,11 +63,11 @@ val orxFeatures = setOf<String>(
|
|||||||
"orx-shade-styles",
|
"orx-shade-styles",
|
||||||
// "orx-shader-phrases",
|
// "orx-shader-phrases",
|
||||||
"orx-shapes",
|
"orx-shapes",
|
||||||
// "orx-svg",
|
"orx-svg",
|
||||||
// "orx-syphon",
|
// "orx-syphon",
|
||||||
// "orx-temporal-blur",
|
// "orx-temporal-blur",
|
||||||
// "orx-tensorflow",
|
// "orx-tensorflow",
|
||||||
// "orx-text-writer",
|
"orx-text-writer",
|
||||||
// "orx-time-operators",
|
// "orx-time-operators",
|
||||||
// "orx-timer",
|
// "orx-timer",
|
||||||
// "orx-triangulation",
|
// "orx-triangulation",
|
||||||
@@ -104,10 +104,9 @@ val applicationLogging = Logging.FULL
|
|||||||
@Suppress("DSL_SCOPE_VIOLATION")
|
@Suppress("DSL_SCOPE_VIOLATION")
|
||||||
plugins {
|
plugins {
|
||||||
java
|
java
|
||||||
application
|
|
||||||
alias(libs.plugins.kotlin.jvm)
|
alias(libs.plugins.kotlin.jvm)
|
||||||
alias(libs.plugins.shadow)
|
alias(libs.plugins.shadow)
|
||||||
alias(libs.plugins.jpackage)
|
alias(libs.plugins.runtime)
|
||||||
alias(libs.plugins.gitarchive.tomarkdown).apply(false)
|
alias(libs.plugins.gitarchive.tomarkdown).apply(false)
|
||||||
alias(libs.plugins.versions)
|
alias(libs.plugins.versions)
|
||||||
alias(libs.plugins.kotlin.serialization)
|
alias(libs.plugins.kotlin.serialization)
|
||||||
@@ -141,14 +140,8 @@ dependencies {
|
|||||||
implementation(libs.kotlin.logging)
|
implementation(libs.kotlin.logging)
|
||||||
|
|
||||||
when (applicationLogging) {
|
when (applicationLogging) {
|
||||||
Logging.NONE -> {
|
Logging.NONE -> runtimeOnly(libs.slf4j.nop)
|
||||||
runtimeOnly(libs.slf4j.nop)
|
Logging.SIMPLE -> runtimeOnly(libs.slf4j.simple)
|
||||||
}
|
|
||||||
|
|
||||||
Logging.SIMPLE -> {
|
|
||||||
runtimeOnly(libs.slf4j.simple)
|
|
||||||
}
|
|
||||||
|
|
||||||
Logging.FULL -> {
|
Logging.FULL -> {
|
||||||
runtimeOnly(libs.log4j.slf4j2)
|
runtimeOnly(libs.log4j.slf4j2)
|
||||||
runtimeOnly(libs.log4j.core)
|
runtimeOnly(libs.log4j.core)
|
||||||
@@ -204,12 +197,12 @@ tasks {
|
|||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named("jpackage") {
|
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
||||||
doLast {
|
doLast {
|
||||||
val destPath = "build/jpackage/" + if (OperatingSystem.current().isMacOsX)
|
val destPath = if (OperatingSystem.current().isMacOsX)
|
||||||
"openrndr-application.app/Contents/Resources/data"
|
"build/jpackage/openrndr-application.app/Contents/Resources/data"
|
||||||
else
|
else
|
||||||
"openrndr-application/data"
|
"build/jpackage/openrndr-application/data"
|
||||||
|
|
||||||
copy {
|
copy {
|
||||||
from("data") { include("**/*") }
|
from("data") { include("**/*") }
|
||||||
@@ -223,52 +216,29 @@ tasks {
|
|||||||
from("${layout.buildDirectory.get()}/jpackage") {
|
from("${layout.buildDirectory.get()}/jpackage") {
|
||||||
include("**/*")
|
include("**/*")
|
||||||
}
|
}
|
||||||
isPreserveFileTimestamps = true
|
|
||||||
isReproducibleFileOrder = true
|
|
||||||
useFileSystemPermissions()
|
|
||||||
dependsOn("jpackage")
|
dependsOn("jpackage")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
runtime {
|
||||||
|
jpackage {
|
||||||
tasks.register("copyDependencies", Copy::class) {
|
imageName = "openrndr-application"
|
||||||
from(configurations.runtimeClasspath).into(layout.buildDirectory.dir("jars"))
|
skipInstaller = true
|
||||||
}
|
if (OperatingSystem.current().isMacOsX) {
|
||||||
|
jvmArgs.add("-XstartOnFirstThread")
|
||||||
tasks.register("copyJar", Copy::class) {
|
jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources")
|
||||||
from(tasks.jar).into(layout.buildDirectory.dir("jars"))
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.jpackage {
|
|
||||||
dependsOn("build", "copyDependencies", "copyJar")
|
|
||||||
|
|
||||||
appName = "openrndr-application"
|
|
||||||
mac {
|
|
||||||
javaOptions = listOf(
|
|
||||||
"-XstartOnFirstThread",
|
|
||||||
$$"-Duser.dir=$APPDIR/../Resources"
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
windows {
|
|
||||||
}
|
}
|
||||||
linux {
|
options = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages")
|
||||||
type = ImageType.APP_IMAGE
|
modules = listOf("jdk.unsupported", "java.management", "java.desktop")
|
||||||
}
|
|
||||||
input = layout.buildDirectory.dir("jars")
|
|
||||||
destination = layout.buildDirectory.dir("jpackage")
|
|
||||||
|
|
||||||
mainJar = tasks.jar.get().archiveFileName.get()
|
|
||||||
mainClass = applicationMainClass
|
|
||||||
|
|
||||||
addModules = listOf("jdk.unsupported", "java.management", "java.desktop")
|
|
||||||
jLinkOptions = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
||||||
tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
tasks {
|
||||||
|
register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
||||||
historySize = 20
|
historySize = 20
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
@@ -279,9 +249,7 @@ tasks {
|
|||||||
|
|
||||||
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
||||||
|
|
||||||
fun isNonStable(
|
fun isNonStable(version: String) = nonStableKeywords.any {
|
||||||
version: String
|
|
||||||
) = nonStableKeywords.any {
|
|
||||||
version.lowercase().contains(it)
|
version.lowercase().contains(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlin = "2.2.0"
|
kotlin = "2.2.10"
|
||||||
openrndr = "0.4.5-alpha9"
|
openrndr = "0.4.5"
|
||||||
orx = "0.4.5-alpha9"
|
orx = "0.4.5"
|
||||||
orsl = "0.4.5-alpha5"
|
orsl = "0.4.5-alpha5"
|
||||||
orml = "0.4.1"
|
orml = "0.4.1"
|
||||||
slf4j = "2.0.17"
|
slf4j = "2.0.17"
|
||||||
@@ -10,11 +10,11 @@ jackson = "2.17.2"
|
|||||||
junit = "4.13.2"
|
junit = "4.13.2"
|
||||||
kotlinxCoroutines = "1.10.2"
|
kotlinxCoroutines = "1.10.2"
|
||||||
kotlinxSerialization = "1.9.0"
|
kotlinxSerialization = "1.9.0"
|
||||||
kotlinLogging = "7.0.10"
|
kotlinLogging = "7.0.13"
|
||||||
kotlinCsvJvm = "1.9.3"
|
kotlinCsvJvm = "1.9.3"
|
||||||
jsoup = "1.17.1"
|
jsoup = "1.17.1"
|
||||||
shadow = "8.3.8"
|
shadow = "9.1.0"
|
||||||
jpackage = "1.7.3"
|
runtime = "1.13.1"
|
||||||
versions = "0.52.0"
|
versions = "0.52.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
@@ -49,6 +49,6 @@ csv = { group = "com.github.doyaaaaaken", name = "kotlin-csv-jvm", version.ref =
|
|||||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||||
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
|
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
|
||||||
jpackage = { id = "org.panteleyev.jpackageplugin", version.ref = "jpackage"}
|
runtime = { id = "org.beryx.runtime", version.ref = "runtime" }
|
||||||
gitarchive-tomarkdown = { id = "org.openrndr.extra.gitarchiver.tomarkdown", version.ref = "orx" }
|
gitarchive-tomarkdown = { id = "org.openrndr.extra.gitarchiver.tomarkdown", version.ref = "orx" }
|
||||||
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
versions = { id = "com.github.ben-manes.versions", version.ref = "versions" }
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
Reference in New Issue
Block a user