Compare commits
132 Commits
openrndr-0
...
feature-va
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e79d83c017 | ||
|
|
2623633588 | ||
|
|
46fb734771 | ||
|
|
0bdb818026 | ||
|
|
d334c11b6a | ||
|
|
7f8af578e6 | ||
|
|
6e328f3871 | ||
|
|
15ab357c05 | ||
|
|
f8cc9b713e | ||
|
|
a0b7df5585 | ||
|
|
3144067340 | ||
|
|
a4525f9b16 | ||
|
|
84f00fa827 | ||
|
|
e97ef57b78 | ||
|
|
2e760f9c53 | ||
|
|
3d6774275a | ||
|
|
b4242bc892 | ||
|
|
d38df2eed7 | ||
|
|
622bfc5077 | ||
|
|
c2756d2b9d | ||
|
|
3ed7c18932 | ||
|
|
86c36a0f35 | ||
|
|
e6a9e319d9 | ||
|
|
a385ebb216 | ||
|
|
e1d44de9a1 | ||
|
|
8191515779 | ||
|
|
7597ac35e2 | ||
|
|
69f698df1f | ||
|
|
f93a523115 | ||
|
|
8f08e44141 | ||
|
|
aa3e5e15ac | ||
|
|
de0ec94804 | ||
|
|
bf588e1baa | ||
|
|
ba99027329 | ||
|
|
5e6fbdd06a | ||
|
|
cd5a98322b | ||
|
|
fef8e76e52 | ||
|
|
315e788a32 | ||
|
|
ca85dec73a | ||
|
|
4247fd0989 | ||
|
|
2d6963b627 | ||
|
|
72270a5421 | ||
|
|
89aeaf68eb | ||
|
|
b164dc2bc5 | ||
|
|
de3079cbee | ||
|
|
e57ba1bff7 | ||
|
|
ce0877cdd1 | ||
|
|
fff6fcee83 | ||
|
|
5ff7884bd5 | ||
|
|
bf7d308796 | ||
|
|
a21da71eb1 | ||
|
|
dbe277002a | ||
|
|
2a4d2142e0 | ||
|
|
7bc745fbed | ||
|
|
374cd51b8a | ||
|
|
0ca9db90d0 | ||
|
|
e7f3475de0 | ||
|
|
ef7cee01c7 | ||
|
|
9e08c6cfb6 | ||
|
|
1565ef12be | ||
|
|
de35f064d8 | ||
|
|
6e5fac82ac | ||
|
|
a9edf8d79f | ||
|
|
418339fe4b | ||
|
|
aad6a8f576 | ||
|
|
4d65172d93 | ||
|
|
b3f94abc82 | ||
|
|
e4dfb4aaed | ||
|
|
524635e1ad | ||
|
|
db5ea1cdd2 | ||
|
|
04139af57c | ||
|
|
c77fd4c99a | ||
|
|
3ef46bcc4e | ||
|
|
1384143d6f | ||
|
|
6b14304c80 | ||
|
|
c6f608f880 | ||
|
|
3bfb55041d | ||
|
|
91e953ab61 | ||
|
|
10ccb692c7 | ||
|
|
0edd57129a | ||
|
|
0278b7dc9e | ||
|
|
440d67654d | ||
|
|
fa280af373 | ||
|
|
0268725ead | ||
|
|
d8d9445062 | ||
|
|
0ccab3a8bf | ||
|
|
0282d5a0b5 | ||
|
|
24e441189a | ||
|
|
d019406420 | ||
|
|
3cdf6ea780 | ||
|
|
df784c99c1 | ||
|
|
80078cc2cb | ||
|
|
527b502e74 | ||
|
|
c4e5b3b1aa | ||
|
|
5b2634fdd1 | ||
|
|
8c2f9c0ec6 | ||
|
|
dec0b36aaf | ||
|
|
cf4ebfc490 | ||
|
|
cc31b08b91 | ||
|
|
3a4d22d940 | ||
|
|
b98a1068f7 | ||
|
|
b57fb1abc6 | ||
|
|
14630e3b5b | ||
|
|
638e579f3e | ||
|
|
9604de3243 | ||
|
|
15fb5393e7 | ||
|
|
c518834f71 | ||
|
|
a83e888dc3 | ||
|
|
498fd6773d | ||
|
|
d5702db78f | ||
|
|
d692d6998d | ||
|
|
3db83af277 | ||
|
|
29db13e82a | ||
|
|
a3c9178d4d | ||
|
|
84f54b3f4e | ||
|
|
4c9e1c552f | ||
|
|
e36cad040e | ||
|
|
ce3bf56b43 | ||
|
|
5ce3313da5 | ||
|
|
9695d5e8af | ||
|
|
5242dae526 | ||
|
|
d97e80c903 | ||
|
|
adf88e1062 | ||
|
|
eda66cc37a | ||
|
|
fa820c6d3c | ||
|
|
411b5f5b12 | ||
|
|
2f2d279e24 | ||
|
|
a35675fd03 | ||
|
|
2477ce7de8 | ||
|
|
0fd7a72d4f | ||
|
|
f907422a5e | ||
|
|
f3d8d0a3dc |
5
.github/workflows/build-on-commit.yaml
vendored
5
.github/workflows/build-on-commit.yaml
vendored
@@ -3,13 +3,14 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next-version
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
|
||||
6
.github/workflows/publish-binaries.yaml
vendored
6
.github/workflows/publish-binaries.yaml
vendored
@@ -23,10 +23,10 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v3
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
run: mv ./build/distributions/openrndr-application.zip ./build/distributions/openrndr-application-${{env.OR_TARGET_NAME}}.zip
|
||||
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1.12.0
|
||||
uses: ncipollo/release-action@v1.14.0
|
||||
id: create_release
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -3,6 +3,11 @@ build
|
||||
out
|
||||
.idea
|
||||
.gradle
|
||||
.kotlin
|
||||
.lwjgl
|
||||
video/
|
||||
screenshots/
|
||||
gui-parameters/
|
||||
ffmpegOutput.txt
|
||||
ShaderError.glsl
|
||||
|
||||
|
||||
73
README.md
73
README.md
@@ -7,62 +7,67 @@ 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 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.
|
||||
- `./gradlew jpackageZip` creates a zip with a stand-alone executable for the current platform (works with Java 14 only)
|
||||
- `./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 (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
|
||||
|
||||
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`.
|
||||
See the [wiki](https://github.com/openrndr/openrndr-template/wiki)
|
||||
|
||||
## Updating OPENRNDR, ORX and other dependencies
|
||||
|
||||
The openrndr-template depends on various packages including the core [openrndr](https://github.com/openrndr/openrndr/) and the [orx](https://github.com/openrndr/orx/) extensions. The version numbers of these dependencies are specified in your [libs.versions.toml](gradle/libs.versions.toml) file. If you want to learn about file format visit the [Gradle documentation](https://docs.gradle.org/current/userguide/platforms.html#sub:conventional-dependencies-toml) website.
|
||||
The openrndr-template depends on various packages including the core [openrndr](https://github.com/openrndr/openrndr/) and the [orx](https://github.com/openrndr/orx/) extensions and
|
||||
provides the optional [orsl](https://github.com/openrndr/orsl/) shader helper modules.
|
||||
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 of OPENRNDR and ORX bring useful features and bug fixes. The most recent versions are
|
||||
<br> for OPENRNDR.
|
||||
<br> for ORX.
|
||||
Newer versions bring useful features and bug fixes. The most recent versions are<br>
|
||||

|
||||

|
||||
.
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
openrndr = "0.4.3-alpha4"
|
||||
orx = "0.4.3-alpha4"
|
||||
openrndr = "0.4.5-alpha5"
|
||||
orx = "0.4.5-alpha5"
|
||||
orsl = "0.4.5-alpha5"
|
||||
|
||||
You can add other dependencies needed by your project to your [build.gradle.kts](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 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
|
||||
⚠️ Remember to reload the Gradle configuration after changing any dependencies.
|
||||
|
||||
## Github Actions
|
||||
|
||||
This repository contains a number of Github Actions under `./github/workflows`.
|
||||
This repository contains various Github Actions under `./github/workflows`:
|
||||
|
||||
[build-on-commit.yaml](.github/workflows/build-on-commit.yaml) runs a basic build on every commit,
|
||||
- [build-on-commit.yaml](.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](.github/workflows/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:
|
||||
|
||||
- [publish-binaries.yaml](.github/workflows/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.
|
||||
You can follow the progress of the action under the Actions tab in GitHub. Once complete, the executables will appear under the Releases section.
|
||||
|
||||
## Building libraries
|
||||
|
||||
This template can be used to create a library with your classes and extensions and reuse them across projects or share them with other people.
|
||||
To publish the project as a library, open [build.gradle.kts](build.gradle.kts) and replace the `conventions.distribute-application` plugin with `conventions.publish-library`.
|
||||
This automatically sets up the `maven-publish` plugin, which adds the `publishToMavenLocal` task.
|
||||
The plugin also adds a `demo` sourceSet with runtime dependencies set to go. Demos can be placed in `src/demo/kotlin` and started right away.
|
||||
|
||||
334
build.gradle.kts
334
build.gradle.kts
@@ -1,329 +1,31 @@
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
group = property("project.group") ?: error("project.group not set")
|
||||
version = property("project.version") ?: error("project.version not set")
|
||||
|
||||
group = "org.openrndr.template"
|
||||
version = "1.0.0"
|
||||
|
||||
val applicationMainClass = "TemplateProgramKt"
|
||||
|
||||
/** ## additional ORX features to be added to this project */
|
||||
val orxFeatures = setOf<String>(
|
||||
// "orx-boofcv",
|
||||
"orx-camera",
|
||||
// "orx-chataigne",
|
||||
"orx-color",
|
||||
"orx-compositor",
|
||||
// "orx-compute-graph",
|
||||
// "orx-compute-graph-nodes",
|
||||
// "orx-dnk3",
|
||||
// "orx-easing",
|
||||
// "orx-expression-evaluator",
|
||||
// "orx-file-watcher",
|
||||
"orx-fx",
|
||||
// "orx-git-archiver",
|
||||
// "orx-glslify",
|
||||
// "orx-gradient-descent",
|
||||
"orx-gui",
|
||||
// "orx-hash-grid",
|
||||
"orx-image-fit",
|
||||
// "orx-integral-image",
|
||||
// "orx-interval-tree",
|
||||
// "orx-jumpflood",
|
||||
// "orx-kdtree",
|
||||
// "orx-keyframer",
|
||||
// "orx-kinect-v1",
|
||||
// "orx-kotlin-parser",
|
||||
// "orx-marching-squares",
|
||||
// "orx-mesh-generators",
|
||||
// "orx-midi",
|
||||
// "orx-minim",
|
||||
"orx-no-clear",
|
||||
"orx-noise",
|
||||
// "orx-obj-loader",
|
||||
"orx-olive",
|
||||
// "orx-osc",
|
||||
// "orx-palette",
|
||||
"orx-panel",
|
||||
// "orx-parameters",
|
||||
// "orx-poisson-fill",
|
||||
// "orx-quadtree",
|
||||
// "orx-rabbit-control",
|
||||
// "orx-realsense2",
|
||||
// "orx-runway",
|
||||
"orx-shade-styles",
|
||||
// "orx-shader-phrases",
|
||||
"orx-shapes",
|
||||
// "orx-syphon",
|
||||
// "orx-temporal-blur",
|
||||
// "orx-tensorflow",
|
||||
// "orx-time-operators",
|
||||
// "orx-timer",
|
||||
// "orx-triangulation",
|
||||
// "orx-turtle",
|
||||
"orx-video-profiles",
|
||||
"orx-view-box",
|
||||
)
|
||||
|
||||
/** ## additional ORML features to be added to this project */
|
||||
val ormlFeatures = setOf<String>(
|
||||
// "orml-blazepose",
|
||||
// "orml-dbface",
|
||||
// "orml-facemesh",
|
||||
// "orml-image-classifier",
|
||||
// "orml-psenet",
|
||||
// "orml-ssd",
|
||||
// "orml-style-transfer",
|
||||
// "orml-super-resolution",
|
||||
// "orml-u2net",
|
||||
)
|
||||
|
||||
/** ## additional OPENRNDR features to be added to this project */
|
||||
val openrndrFeatures = setOfNotNull(
|
||||
if (DefaultNativePlatform("current").architecture.name != "arm-v8") "video" else null
|
||||
)
|
||||
|
||||
/** ## configure the type of logging this project uses */
|
||||
enum class Logging { NONE, SIMPLE, FULL }
|
||||
|
||||
val applicationLogging = Logging.FULL
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
java
|
||||
alias(libs.plugins.kotlin.jvm)
|
||||
alias(libs.plugins.shadow)
|
||||
alias(libs.plugins.runtime)
|
||||
alias(libs.plugins.gitarchive.tomarkdown).apply(false)
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
id("conventions.kotlin-jvm")
|
||||
id("conventions.openrndr-tasks")
|
||||
id("conventions.distribute-application")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(openrndr.application)
|
||||
implementation(openrndr.draw)
|
||||
runtimeOnly(openrndr.gl3)
|
||||
|
||||
// implementation(libs.jsoup)
|
||||
// implementation(libs.gson)
|
||||
// implementation(libs.csv)
|
||||
implementation(openrndr.dialogs)
|
||||
implementation(openrndr.orextensions)
|
||||
|
||||
implementation(openrndr.ffmpeg)
|
||||
implementation(orx.bundles.basic)
|
||||
implementation(orx.olive)
|
||||
implementation(libs.kotlinx.coroutines.core)
|
||||
implementation(libs.kotlinx.serialization.core)
|
||||
implementation(libs.kotlinx.serialization.json)
|
||||
implementation(libs.slf4j.api)
|
||||
implementation(libs.kotlin.logging)
|
||||
|
||||
when (applicationLogging) {
|
||||
Logging.NONE -> {
|
||||
runtimeOnly(libs.slf4j.nop)
|
||||
}
|
||||
Logging.SIMPLE -> {
|
||||
runtimeOnly(libs.slf4j.simple)
|
||||
}
|
||||
Logging.FULL -> {
|
||||
runtimeOnly(libs.log4j.slf4j2)
|
||||
runtimeOnly(libs.log4j.core)
|
||||
runtimeOnly(libs.jackson.databind)
|
||||
runtimeOnly(libs.jackson.json)
|
||||
}
|
||||
}
|
||||
implementation(kotlin("stdlib-jdk8"))
|
||||
runtimeOnly(libs.bundles.logging.simple)
|
||||
|
||||
testImplementation(libs.junit)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
}
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions.jvmTarget = "11"
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
project.setProperty("mainClassName", applicationMainClass)
|
||||
|
||||
application {
|
||||
if (hasProperty("openrndr.application")) {
|
||||
mainClass.set("${property("openrndr.application")}")
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
named<ShadowJar>("shadowJar") {
|
||||
manifest {
|
||||
attributes["Main-Class"] = applicationMainClass
|
||||
attributes["Implementation-Version"] = project.version
|
||||
}
|
||||
minimize {
|
||||
exclude(dependency("org.openrndr:openrndr-gl3:.*"))
|
||||
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
|
||||
exclude(dependency("org.slf4j:slf4j-simple:.*"))
|
||||
exclude(dependency("org.apache.logging.log4j:log4j-slf4j2-impl:.*"))
|
||||
exclude(dependency("com.fasterxml.jackson.core:jackson-databind:.*"))
|
||||
exclude(dependency("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:.*"))
|
||||
}
|
||||
}
|
||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
||||
doLast {
|
||||
val destPath = if(OperatingSystem.current().isMacOsX)
|
||||
"build/jpackage/openrndr-application.app/Contents/Resources/data"
|
||||
else
|
||||
"build/jpackage/openrndr-application/data"
|
||||
|
||||
copy {
|
||||
from("data") {
|
||||
include("**/*")
|
||||
}
|
||||
into(destPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
tasks.register<Zip>("jpackageZip") {
|
||||
archiveFileName.set("openrndr-application.zip")
|
||||
from("$buildDir/jpackage") {
|
||||
include("**/*")
|
||||
}
|
||||
}
|
||||
tasks.findByName("jpackageZip")?.dependsOn("jpackage")
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
runtime {
|
||||
jpackage {
|
||||
imageName = "openrndr-application"
|
||||
skipInstaller = true
|
||||
if (OperatingSystem.current().isMacOsX) {
|
||||
jvmArgs.add("-XstartOnFirstThread")
|
||||
jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources")
|
||||
}
|
||||
}
|
||||
options.set(listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages"))
|
||||
modules.set(listOf("jdk.unsupported", "java.management", "java.desktop"))
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
tasks.register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
||||
historySize.set(20)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------------------------ //
|
||||
|
||||
class Openrndr {
|
||||
val openrndrVersion = libs.versions.openrndr.get()
|
||||
val orxVersion = libs.versions.orx.get()
|
||||
val ormlVersion = libs.versions.orml.get()
|
||||
|
||||
// choices are "orx-tensorflow-gpu", "orx-tensorflow"
|
||||
val orxTensorflowBackend = "orx-tensorflow"
|
||||
|
||||
val currArch = DefaultNativePlatform("current").architecture.name
|
||||
val currOs = OperatingSystem.current()
|
||||
val os = if (project.hasProperty("targetPlatform")) {
|
||||
val supportedPlatforms = setOf("windows", "macos", "linux-x64", "linux-arm64")
|
||||
val platform: String = project.property("targetPlatform") as String
|
||||
if (platform !in supportedPlatforms) {
|
||||
throw IllegalArgumentException("target platform not supported: $platform")
|
||||
} else {
|
||||
platform
|
||||
}
|
||||
} else when {
|
||||
currOs.isWindows -> "windows"
|
||||
currOs.isMacOsX -> when (currArch) {
|
||||
"aarch64", "arm-v8" -> "macos-arm64"
|
||||
else -> "macos"
|
||||
}
|
||||
currOs.isLinux -> when (currArch) {
|
||||
"x86-64" -> "linux-x64"
|
||||
"aarch64" -> "linux-arm64"
|
||||
else -> throw IllegalArgumentException("architecture not supported: $currArch")
|
||||
}
|
||||
else -> throw IllegalArgumentException("os not supported: ${currOs.name}")
|
||||
}
|
||||
|
||||
fun orx(module: String) = "org.openrndr.extra:$module:$orxVersion"
|
||||
fun orml(module: String) = "org.openrndr.orml:$module:$ormlVersion"
|
||||
fun openrndr(module: String) = "org.openrndr:openrndr-$module:$openrndrVersion"
|
||||
fun openrndrNatives(module: String) = "org.openrndr:openrndr-$module-natives-$os:$openrndrVersion"
|
||||
fun orxNatives(module: String) = "org.openrndr.extra:$module-natives-$os:$orxVersion"
|
||||
|
||||
init {
|
||||
dependencies {
|
||||
runtimeOnly(openrndr("gl3"))
|
||||
runtimeOnly(openrndrNatives("gl3"))
|
||||
implementation(openrndr("openal"))
|
||||
runtimeOnly(openrndrNatives("openal"))
|
||||
implementation(openrndr("application"))
|
||||
implementation(openrndr("svg"))
|
||||
implementation(openrndr("animatable"))
|
||||
implementation(openrndr("extensions"))
|
||||
implementation(openrndr("filter"))
|
||||
implementation(openrndr("dialogs"))
|
||||
if ("video" in openrndrFeatures) {
|
||||
implementation(openrndr("ffmpeg"))
|
||||
runtimeOnly(openrndrNatives("ffmpeg"))
|
||||
}
|
||||
for (feature in orxFeatures) {
|
||||
implementation(orx(feature))
|
||||
}
|
||||
for (feature in ormlFeatures) {
|
||||
implementation(orml(feature))
|
||||
}
|
||||
if ("orx-tensorflow" in orxFeatures) runtimeOnly("org.openrndr.extra:$orxTensorflowBackend-natives-$os:$orxVersion")
|
||||
if ("orx-kinect-v1" in orxFeatures) runtimeOnly(orxNatives("orx-kinect-v1"))
|
||||
if ("orx-olive" in orxFeatures) implementation(libs.kotlin.script.runtime)
|
||||
}
|
||||
}
|
||||
}
|
||||
val openrndr = Openrndr()
|
||||
|
||||
if (properties["openrndr.tasks"] == "true") {
|
||||
task("create executable jar for $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
|
||||
task("run $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("run")
|
||||
}
|
||||
|
||||
task("create standalone executable for $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("jpackageZip")
|
||||
}
|
||||
|
||||
task("add IDE file scopes") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
val scopesFolder = File("${project.projectDir}/.idea/scopes")
|
||||
scopesFolder.mkdirs()
|
||||
|
||||
val files = listOf(
|
||||
"Code" to "file:*.kt||file:*.frag||file:*.vert||file:*.glsl",
|
||||
"Text" to "file:*.txt||file:*.md||file:*.xml||file:*.json",
|
||||
"Gradle" to "file[*buildSrc*]:*/||file:*gradle.*||file:*.gradle||file:*/gradle-wrapper.properties||file:*.toml",
|
||||
"Images" to "file:*.png||file:*.jpg||file:*.dds||file:*.exr"
|
||||
)
|
||||
files.forEach { (name, pattern) ->
|
||||
val file = File(scopesFolder, "__$name.xml")
|
||||
if (!file.exists()) {
|
||||
file.writeText(
|
||||
"""
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name=" ★ $name" pattern="$pattern" />
|
||||
</component>
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
buildSrc/build.gradle.kts
Normal file
12
buildSrc/build.gradle.kts
Normal file
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
}
|
||||
|
||||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
|
||||
dependencies {
|
||||
implementation(libs.findLibrary("shadow-gradle-plugin").get())
|
||||
implementation(libs.findLibrary("runtime-gradle-plugin").get())
|
||||
implementation(libs.findLibrary("kotlin-gradle-plugin").get())
|
||||
implementation(libs.findLibrary("xversions-gradle-plugin").get())
|
||||
}
|
||||
39
buildSrc/settings.gradle.kts
Normal file
39
buildSrc/settings.gradle.kts
Normal file
@@ -0,0 +1,39 @@
|
||||
rootProject.name = "buildSrc"
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
mavenLocal {
|
||||
content {
|
||||
includeGroup("org.openrndr")
|
||||
includeGroup("org.openrndr.extra")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
// We use a regex to get the openrndr/orx versions from the primary catalog as there is no public Gradle API to parse catalogs.
|
||||
val orRegEx = Regex("^openrndr[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
|
||||
val orxRegEx = Regex("^orx[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
|
||||
val openrndrVersion = orRegEx.find(File(rootDir,"../gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find openrndr version")
|
||||
val orxVersion = orxRegEx.find(File(rootDir,"../gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find orx version")
|
||||
|
||||
create("orx") {
|
||||
from("org.openrndr.extra:orx-module-catalog:$orxVersion")
|
||||
}
|
||||
create("openrndr") {
|
||||
from("org.openrndr:openrndr-module-catalog:$openrndrVersion")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
gradlePluginPortal()
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package conventions
|
||||
import org.gradle.internal.os.OperatingSystem
|
||||
import kotlin.collections.set
|
||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
||||
|
||||
plugins {
|
||||
id("com.gradleup.shadow")
|
||||
id("org.beryx.runtime")
|
||||
}
|
||||
|
||||
val applicationMainClass: String by properties
|
||||
|
||||
application {
|
||||
mainClass = if (hasProperty("openrndr.application"))
|
||||
"${property("openrndr.application")}"
|
||||
else
|
||||
applicationMainClass
|
||||
}
|
||||
|
||||
tasks {
|
||||
named<ShadowJar>("shadowJar") {
|
||||
manifest {
|
||||
attributes["Main-Class"] = applicationMainClass
|
||||
attributes["Implementation-Version"] = project.version
|
||||
}
|
||||
minimize {
|
||||
exclude(dependency("org.openrndr:openrndr-gl3:.*"))
|
||||
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
|
||||
exclude(dependency("org.slf4j:slf4j-simple:.*"))
|
||||
exclude(dependency("org.apache.logging.log4j:log4j-slf4j2-impl:.*"))
|
||||
exclude(dependency("com.fasterxml.jackson.core:jackson-databind:.*"))
|
||||
exclude(dependency("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:.*"))
|
||||
exclude(dependency("org.bytedeco:.*"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
||||
doLast {
|
||||
val destPath = if (OperatingSystem.current().isMacOsX)
|
||||
"build/jpackage/openrndr-application.app/Contents/Resources/data"
|
||||
else
|
||||
"build/jpackage/openrndr-application/data"
|
||||
|
||||
copy {
|
||||
from("data") { include("**/*") }
|
||||
into(destPath)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
register<Zip>("jpackageZip") {
|
||||
archiveFileName = "openrndr-application.zip"
|
||||
from("${layout.buildDirectory.get()}/jpackage") {
|
||||
include("**/*")
|
||||
}
|
||||
dependsOn("jpackage")
|
||||
}
|
||||
}
|
||||
|
||||
runtime {
|
||||
jpackage {
|
||||
imageName = "openrndr-application"
|
||||
skipInstaller = true
|
||||
if (OperatingSystem.current().isMacOsX) {
|
||||
jvmArgs.add("-XstartOnFirstThread")
|
||||
jvmArgs.add("-Duser.dir=${"$"}APPDIR/../Resources")
|
||||
}
|
||||
}
|
||||
options = listOf("--strip-debug", "--compress", "1", "--no-header-files", "--no-man-pages")
|
||||
modules = listOf("jdk.unsupported", "java.management", "java.desktop")
|
||||
}
|
||||
71
buildSrc/src/main/kotlin/conventions/kotlin-jvm.gradle.kts
Normal file
71
buildSrc/src/main/kotlin/conventions/kotlin-jvm.gradle.kts
Normal file
@@ -0,0 +1,71 @@
|
||||
package conventions
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
||||
|
||||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
|
||||
plugins {
|
||||
java
|
||||
kotlin("jvm")
|
||||
id("com.github.ben-manes.versions")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
java {
|
||||
targetCompatibility = JavaVersion.valueOf("VERSION_${libs.findVersion("jvmTarget").get().displayName}")
|
||||
sourceCompatibility = JavaVersion.valueOf("VERSION_${libs.findVersion("jvmTarget").get().displayName}")
|
||||
}
|
||||
|
||||
kotlin {
|
||||
compilerOptions {
|
||||
apiVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinApi").get().displayName.replace(".", "_")}"))
|
||||
languageVersion.set(KotlinVersion.valueOf("KOTLIN_${libs.findVersion("kotlinLanguage").get().displayName.replace(".", "_")}"))
|
||||
jvmTarget.set(JvmTarget.valueOf("JVM_${libs.findVersion("jvmTarget").get().displayName}"))
|
||||
}
|
||||
}
|
||||
|
||||
fun arch(arch: String = System.getProperty("os.arch")): String {
|
||||
return when (arch) {
|
||||
"x86-64", "x86_64", "amd64" -> "x86-64"
|
||||
"arm64", "aarch64" -> "aarch64"
|
||||
else -> error("unsupported arch $arch")
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.addHostMachineAttributesToRuntimeConfigurations() {
|
||||
val currentOperatingSystemName: String = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName()
|
||||
val currentArchitectureName: String = arch()
|
||||
|
||||
configurations.matching {
|
||||
it.name.endsWith("runtimeClasspath", ignoreCase = true)
|
||||
}.configureEach {
|
||||
attributes {
|
||||
attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(currentOperatingSystemName))
|
||||
attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(currentArchitectureName))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addHostMachineAttributesToRuntimeConfigurations()
|
||||
|
||||
|
||||
tasks {
|
||||
dependencyUpdates {
|
||||
gradleReleaseChannel = "current"
|
||||
|
||||
val nonStableKeywords = listOf("alpha", "beta", "rc")
|
||||
|
||||
fun isNonStable(version: String) = nonStableKeywords.any {
|
||||
version.lowercase().contains(it)
|
||||
}
|
||||
|
||||
rejectVersionIf {
|
||||
isNonStable(candidate.version) && !isNonStable(currentVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package conventions
|
||||
|
||||
val applicationMainClass by properties
|
||||
tasks.register("create executable jar for $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("shadowJar")
|
||||
}
|
||||
|
||||
tasks.register("run $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("run")
|
||||
}
|
||||
|
||||
tasks.register("create standalone executable for $applicationMainClass") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
dependsOn("jpackageZip")
|
||||
}
|
||||
|
||||
tasks.register("add IDE file scopes") {
|
||||
group = " \uD83E\uDD8C OPENRNDR"
|
||||
val scopesFolder = File("${project.projectDir}/.idea/scopes")
|
||||
scopesFolder.mkdirs()
|
||||
|
||||
val files = listOf(
|
||||
"Code" to "file:*.kt||file:*.frag||file:*.vert||file:*.glsl",
|
||||
"Text" to "file:*.txt||file:*.md||file:*.xml||file:*.json",
|
||||
"Gradle" to "file[*buildSrc*]:*/||file:*gradle.*||file:*.gradle||file:*/gradle-wrapper.properties||file:*.toml",
|
||||
"Media" to "file:*.png||file:*.jpg||file:*.dds||file:*.exr||file:*.mp3||file:*.wav||file:*.mp4||file:*.mov||file:*.svg"
|
||||
)
|
||||
files.forEach { (name, pattern) ->
|
||||
val file = File(scopesFolder, "__$name.xml")
|
||||
if (!file.exists()) {
|
||||
file.writeText(
|
||||
"""
|
||||
<component name="DependencyValidationManager">
|
||||
<scope name=" ★ $name" pattern="$pattern" />
|
||||
</component>
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package conventions
|
||||
|
||||
import org.gradle.kotlin.dsl.java
|
||||
import org.gradle.kotlin.dsl.kotlin
|
||||
|
||||
plugins {
|
||||
java
|
||||
kotlin("jvm")
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
val openrndr = extensions.getByType<VersionCatalogsExtension>().named("openrndr")
|
||||
|
||||
val demo = sourceSets.create("demo")
|
||||
val main = sourceSets.getByName("main")
|
||||
|
||||
demo.compileClasspath += main.compileClasspath
|
||||
demo.runtimeClasspath += main.runtimeClasspath
|
||||
demo.compileClasspath += main.output
|
||||
demo.runtimeClasspath += main.output
|
||||
|
||||
dependencies {
|
||||
"demoRuntimeOnly"(openrndr.findLibrary("gl3").get())
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
create<MavenPublication>("maven") {
|
||||
from(components["java"])
|
||||
groupId = property("project.group")?.toString() ?: error("project.group not set")
|
||||
artifactId = property("project.name")?.toString() ?: error("project.name not set")
|
||||
description = property("project.name")?.toString() ?: error("project.name not set")
|
||||
version = property("project.version")?.toString() ?: error("project.version not set")
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,10 @@
|
||||
project.name=openrndr-template
|
||||
project.group=org.openrndr
|
||||
project.version=1.0.0
|
||||
applicationMainClass=TemplateProgramKt
|
||||
openrndr.tasks=true
|
||||
kotlin.code.style=official
|
||||
org.gradle.unsafe.configuration-cache=false
|
||||
#org.gradle.configuration-cache=true
|
||||
#org.gradle.configuration-cache.parallel=true
|
||||
#org.gradle.configuration-cache.problems=warn
|
||||
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
[versions]
|
||||
kotlin = "1.8.21"
|
||||
openrndr = "0.4.3"
|
||||
orx = "0.4.3"
|
||||
jvmTarget = "17"
|
||||
kotlin = "2.2.10"
|
||||
kotlinApi = "2.2"
|
||||
kotlinLanguage = "2.2"
|
||||
|
||||
openrndr = "0.5.0-SNAPSHOT"
|
||||
orx = "0.5.0-SNAPSHOT"
|
||||
orsl = "0.4.5-alpha5"
|
||||
orml = "0.4.1"
|
||||
|
||||
slf4j = "2.0.7"
|
||||
log4j = "2.20.0"
|
||||
jackson = "2.14.2"
|
||||
slf4j = "2.0.17"
|
||||
log4j = "2.23.1"
|
||||
jackson = "2.17.2"
|
||||
junit = "4.13.2"
|
||||
kotlinxCoroutines = "1.10.2"
|
||||
kotlinxSerialization = "1.9.0"
|
||||
kotlinLogging = "7.0.13"
|
||||
kotlinCsvJvm = "1.9.3"
|
||||
jsoup = "1.17.1"
|
||||
shadow = "9.1.0"
|
||||
runtime = "1.13.1"
|
||||
versions = "0.52.0"
|
||||
|
||||
[libraries]
|
||||
kotlin-script-runtime = { group = "org.jetbrains.kotlin", name = "kotlin-script-runtime", version.ref = "kotlin" }
|
||||
@@ -19,15 +33,27 @@ log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.
|
||||
jackson-databind = { group = "com.fasterxml.jackson.core", name = "jackson-databind", version.ref = "jackson" }
|
||||
jackson-json = { group = "com.fasterxml.jackson.dataformat", name = "jackson-dataformat-yaml", version.ref = "jackson" }
|
||||
|
||||
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version = "1.6.4" }
|
||||
kotlin-logging = { group = "io.github.microutils", name = "kotlin-logging", version = "3.0.5" }
|
||||
junit = { group = "junit", name = "junit", version = "4.13.2" }
|
||||
jsoup = { group = "org.jsoup", name = "jsoup", version = "1.16.1" }
|
||||
gson = { group = "com.google.code.gson", name = "gson", version = "2.10.1" }
|
||||
csv = { group = "com.github.doyaaaaaken", name = "kotlin-csv-jvm", version = "1.9.0" }
|
||||
shadow-gradle-plugin = { group = "com.gradleup.shadow", name = "com.gradleup.shadow.gradle.plugin", version.ref = "shadow" }
|
||||
runtime-gradle-plugin = { group = "org.beryx.runtime", name = "org.beryx.runtime.gradle.plugin", version.ref = "runtime" }
|
||||
kotlin-gradle-plugin = { group = "org.jetbrains.kotlin.jvm", name = "org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" }
|
||||
xversions-gradle-plugin = { group = "com.github.ben-manes.versions", name = "com.github.ben-manes.versions.gradle.plugin", version.ref = "versions" }
|
||||
kotlinx-coroutines-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" }
|
||||
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
||||
kotlinx-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerialization" }
|
||||
kotlin-logging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "kotlinLogging" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
jsoup = { group = "org.jsoup", name = "jsoup", version.ref = "jsoup" }
|
||||
csv = { group = "com.github.doyaaaaaken", name = "kotlin-csv-jvm", version.ref = "kotlinCsvJvm" }
|
||||
|
||||
[plugins]
|
||||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
|
||||
shadow = { id = "com.github.johnrengelman.shadow", version = "7.1.2" }
|
||||
runtime = { id = "org.beryx.runtime", version = "1.13.0" }
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
|
||||
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" }
|
||||
|
||||
[bundles]
|
||||
logging-none = ["slf4j-nop"]
|
||||
logging-simple = ["slf4j-simple"]
|
||||
loggin-full = ["log4j-slf4j2", "log4j-core", "jackson-databind", "jackson-json"]
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
||||
30
gradlew
vendored
30
gradlew
vendored
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -83,7 +85,8 @@ done
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
@@ -111,7 +114,7 @@ case "$( uname )" in #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
CLASSPATH="\\\"\\\""
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
@@ -130,10 +133,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
@@ -141,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
@@ -149,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
@@ -198,16 +204,16 @@ fi
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
|
||||
26
gradlew.bat
vendored
26
gradlew.bat
vendored
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
rootProject.name = "openrndr-template"
|
||||
rootProject.name = extra["project.name"]?.toString() ?: error("project.name not set")
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
@@ -6,3 +6,30 @@ pluginManagement {
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
mavenLocal {
|
||||
content {
|
||||
includeGroup("org.openrndr")
|
||||
includeGroup("org.openrndr.extra")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
versionCatalogs {
|
||||
// We use a regex to get the openrndr/orx versions from the primary catalog as there is no public Gradle API to parse catalogs.
|
||||
val orRegEx = Regex("^openrndr[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
|
||||
val orxRegEx = Regex("^orx[ ]*=[ ]*(?:\\{[ ]*require[ ]*=[ ]*)?\"(.*)\"[ ]*(?:\\})?", RegexOption.MULTILINE)
|
||||
val openrndrVersion = orRegEx.find(File(rootDir,"gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find openrndr version")
|
||||
val orxVersion = orxRegEx.find(File(rootDir,"gradle/libs.versions.toml").readText())?.groupValues?.get(1) ?: error("can't find orx version")
|
||||
|
||||
create("orx") {
|
||||
from("org.openrndr.extra:orx-module-catalog:$orxVersion")
|
||||
}
|
||||
create("openrndr") {
|
||||
from("org.openrndr:openrndr-module-catalog:$openrndrVersion")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.loadFont
|
||||
import org.openrndr.draw.loadImage
|
||||
import org.openrndr.draw.tint
|
||||
import org.openrndr.extra.color.colormatrix.tint
|
||||
import kotlin.math.cos
|
||||
import kotlin.math.sin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user