Compare commits
2 Commits
master
...
wipGradle9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34d0087cc3 | ||
|
|
4ace0c4512 |
33
README.md
33
README.md
@@ -7,20 +7,13 @@ 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 `TemplateProgram.kt` (Use `gradlew.bat run` under Windows)
|
- `./gradlew run` runs the TemplateProgram (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 (requires Java 17 or newer). 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 (works with Java 14 only). 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
|
||||||
|
|
||||||
@@ -33,10 +26,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<br>
|
Newer versions bring useful features and bug fixes. The most recent versions are
|
||||||

|
<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:
|
||||||
@@ -49,6 +42,18 @@ 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,6 +3,7 @@ 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"
|
||||||
@@ -11,12 +12,11 @@ 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,9 +104,10 @@ 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.runtime)
|
alias(libs.plugins.jpackage)
|
||||||
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)
|
||||||
@@ -140,8 +141,14 @@ dependencies {
|
|||||||
implementation(libs.kotlin.logging)
|
implementation(libs.kotlin.logging)
|
||||||
|
|
||||||
when (applicationLogging) {
|
when (applicationLogging) {
|
||||||
Logging.NONE -> runtimeOnly(libs.slf4j.nop)
|
Logging.NONE -> {
|
||||||
Logging.SIMPLE -> runtimeOnly(libs.slf4j.simple)
|
runtimeOnly(libs.slf4j.nop)
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
@@ -197,12 +204,12 @@ tasks {
|
|||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
named("jpackage") {
|
||||||
doLast {
|
doLast {
|
||||||
val destPath = if (OperatingSystem.current().isMacOsX)
|
val destPath = "build/jpackage/" + if (OperatingSystem.current().isMacOsX)
|
||||||
"build/jpackage/openrndr-application.app/Contents/Resources/data"
|
"openrndr-application.app/Contents/Resources/data"
|
||||||
else
|
else
|
||||||
"build/jpackage/openrndr-application/data"
|
"openrndr-application/data"
|
||||||
|
|
||||||
copy {
|
copy {
|
||||||
from("data") { include("**/*") }
|
from("data") { include("**/*") }
|
||||||
@@ -216,29 +223,52 @@ tasks {
|
|||||||
from("${layout.buildDirectory.get()}/jpackage") {
|
from("${layout.buildDirectory.get()}/jpackage") {
|
||||||
include("**/*")
|
include("**/*")
|
||||||
}
|
}
|
||||||
|
isPreserveFileTimestamps = true
|
||||||
|
isReproducibleFileOrder = true
|
||||||
|
useFileSystemPermissions()
|
||||||
dependsOn("jpackage")
|
dependsOn("jpackage")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
runtime {
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
jpackage {
|
|
||||||
imageName = "openrndr-application"
|
tasks.register("copyDependencies", Copy::class) {
|
||||||
skipInstaller = true
|
from(configurations.runtimeClasspath).into(layout.buildDirectory.dir("jars"))
|
||||||
if (OperatingSystem.current().isMacOsX) {
|
}
|
||||||
jvmArgs.add("-XstartOnFirstThread")
|
|
||||||
jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources")
|
tasks.register("copyJar", Copy::class) {
|
||||||
|
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 {
|
||||||
}
|
}
|
||||||
options = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages")
|
linux {
|
||||||
modules = listOf("jdk.unsupported", "java.management", "java.desktop")
|
type = ImageType.APP_IMAGE
|
||||||
|
}
|
||||||
|
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 {
|
tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
||||||
register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
|
||||||
historySize = 20
|
historySize = 20
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
// ------------------------------------------------------------------------------------------------------------------ //
|
||||||
@@ -249,7 +279,9 @@ tasks {
|
|||||||
|
|
||||||
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
||||||
|
|
||||||
fun isNonStable(version: String) = nonStableKeywords.any {
|
fun isNonStable(
|
||||||
|
version: String
|
||||||
|
) = nonStableKeywords.any {
|
||||||
version.lowercase().contains(it)
|
version.lowercase().contains(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlin = "2.2.10"
|
kotlin = "2.2.0"
|
||||||
openrndr = "0.4.5"
|
openrndr = "0.4.5-alpha9"
|
||||||
orx = "0.4.5"
|
orx = "0.4.5-alpha9"
|
||||||
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.13"
|
kotlinLogging = "7.0.10"
|
||||||
kotlinCsvJvm = "1.9.3"
|
kotlinCsvJvm = "1.9.3"
|
||||||
jsoup = "1.17.1"
|
jsoup = "1.17.1"
|
||||||
shadow = "9.1.0"
|
shadow = "8.3.8"
|
||||||
runtime = "1.13.1"
|
jpackage = "1.7.3"
|
||||||
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" }
|
||||||
runtime = { id = "org.beryx.runtime", version.ref = "runtime" }
|
jpackage = { id = "org.panteleyev.jpackageplugin", version.ref = "jpackage"}
|
||||||
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-8.14.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-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