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`.
|
||||
|
||||
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
|
||||
|
||||
- `./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 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
|
||||
|
||||
@@ -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.
|
||||
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> for OPENRNDR.
|
||||
<br> for ORX.
|
||||
<br> for ORSL.
|
||||
Newer versions bring useful features and bug fixes. The most recent versions are<br>
|
||||

|
||||

|
||||
.
|
||||
|
||||
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:
|
||||
@@ -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.
|
||||
|
||||
## 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
|
||||
|
||||
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.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
import org.panteleyev.jpackage.ImageType
|
||||
|
||||
group = "org.openrndr.template"
|
||||
version = "1.0.0"
|
||||
@@ -12,11 +11,12 @@ val applicationMainClass = "TemplateProgramKt"
|
||||
|
||||
/** ## additional ORX features to be added to this project */
|
||||
val orxFeatures = setOf<String>(
|
||||
// "orx-axidraw",
|
||||
// "orx-boofcv",
|
||||
"orx-camera",
|
||||
// "orx-chataigne",
|
||||
"orx-color",
|
||||
// "orx-composition",
|
||||
"orx-composition",
|
||||
"orx-compositor",
|
||||
// "orx-compute-graph",
|
||||
// "orx-compute-graph-nodes",
|
||||
@@ -63,11 +63,11 @@ val orxFeatures = setOf<String>(
|
||||
"orx-shade-styles",
|
||||
// "orx-shader-phrases",
|
||||
"orx-shapes",
|
||||
// "orx-svg",
|
||||
"orx-svg",
|
||||
// "orx-syphon",
|
||||
// "orx-temporal-blur",
|
||||
// "orx-tensorflow",
|
||||
// "orx-text-writer",
|
||||
"orx-text-writer",
|
||||
// "orx-time-operators",
|
||||
// "orx-timer",
|
||||
// "orx-triangulation",
|
||||
@@ -104,10 +104,9 @@ val applicationLogging = Logging.FULL
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
java
|
||||
application
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.shadow)
|
||||
alias(libs.plugins.jpackage)
|
||||
alias(libs.plugins.runtime)
|
||||
alias(libs.plugins.gitarchive.tomarkdown).apply(false)
|
||||
alias(libs.plugins.versions)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
@@ -141,14 +140,8 @@ dependencies {
|
||||
implementation(libs.kotlin.logging)
|
||||
|
||||
when (applicationLogging) {
|
||||
Logging.NONE -> {
|
||||
runtimeOnly(libs.slf4j.nop)
|
||||
}
|
||||
|
||||
Logging.SIMPLE -> {
|
||||
runtimeOnly(libs.slf4j.simple)
|
||||
}
|
||||
|
||||
Logging.NONE -> runtimeOnly(libs.slf4j.nop)
|
||||
Logging.SIMPLE -> runtimeOnly(libs.slf4j.simple)
|
||||
Logging.FULL -> {
|
||||
runtimeOnly(libs.log4j.slf4j2)
|
||||
runtimeOnly(libs.log4j.core)
|
||||
@@ -204,12 +197,12 @@ tasks {
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
tasks {
|
||||
named("jpackage") {
|
||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
||||
doLast {
|
||||
val destPath = "build/jpackage/" + if (OperatingSystem.current().isMacOsX)
|
||||
"openrndr-application.app/Contents/Resources/data"
|
||||
val destPath = if (OperatingSystem.current().isMacOsX)
|
||||
"build/jpackage/openrndr-application.app/Contents/Resources/data"
|
||||
else
|
||||
"openrndr-application/data"
|
||||
"build/jpackage/openrndr-application/data"
|
||||
|
||||
copy {
|
||||
from("data") { include("**/*") }
|
||||
@@ -223,53 +216,30 @@ tasks {
|
||||
from("${layout.buildDirectory.get()}/jpackage") {
|
||||
include("**/*")
|
||||
}
|
||||
isPreserveFileTimestamps = true
|
||||
isReproducibleFileOrder = true
|
||||
useFileSystemPermissions()
|
||||
dependsOn("jpackage")
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
tasks.register("copyDependencies", Copy::class) {
|
||||
from(configurations.runtimeClasspath).into(layout.buildDirectory.dir("jars"))
|
||||
runtime {
|
||||
jpackage {
|
||||
imageName = "openrndr-application"
|
||||
skipInstaller = true
|
||||
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 {
|
||||
}
|
||||
linux {
|
||||
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")
|
||||
options = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages")
|
||||
modules = listOf("jdk.unsupported", "java.management", "java.desktop")
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
||||
tasks {
|
||||
register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
||||
historySize = 20
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
@@ -279,9 +249,7 @@ tasks {
|
||||
|
||||
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
||||
|
||||
fun isNonStable(
|
||||
version: String
|
||||
) = nonStableKeywords.any {
|
||||
fun isNonStable(version: String) = nonStableKeywords.any {
|
||||
version.lowercase().contains(it)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[versions]
|
||||
kotlin = "2.2.0"
|
||||
openrndr = "0.4.5-alpha9"
|
||||
orx = "0.4.5-alpha9"
|
||||
kotlin = "2.2.10"
|
||||
openrndr = "0.4.5"
|
||||
orx = "0.4.5"
|
||||
orsl = "0.4.5-alpha5"
|
||||
orml = "0.4.1"
|
||||
slf4j = "2.0.17"
|
||||
@@ -10,11 +10,11 @@ jackson = "2.17.2"
|
||||
junit = "4.13.2"
|
||||
kotlinxCoroutines = "1.10.2"
|
||||
kotlinxSerialization = "1.9.0"
|
||||
kotlinLogging = "7.0.10"
|
||||
kotlinLogging = "7.0.13"
|
||||
kotlinCsvJvm = "1.9.3"
|
||||
jsoup = "1.17.1"
|
||||
shadow = "8.3.8"
|
||||
jpackage = "1.7.3"
|
||||
shadow = "9.1.0"
|
||||
runtime = "1.13.1"
|
||||
versions = "0.52.0"
|
||||
|
||||
[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-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
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" }
|
||||
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
|
||||
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
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
Reference in New Issue
Block a user