Compare commits
2 Commits
master
...
openrndr-t
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2e52f074f2 | ||
|
|
7d6ac87a34 |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,2 +0,0 @@
|
|||||||
*.bat eol=crlf
|
|
||||||
|
|
||||||
21
.github/workflows/build-on-commit.yaml
vendored
21
.github/workflows/build-on-commit.yaml
vendored
@@ -1,21 +0,0 @@
|
|||||||
name: Build on commit
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
- next-version
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
|
||||||
#cache: 'gradle'
|
|
||||||
|
|
||||||
- name: Build sources
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
59
.github/workflows/publish-binaries.yaml
vendored
59
.github/workflows/publish-binaries.yaml
vendored
@@ -1,59 +0,0 @@
|
|||||||
name: Publish binaries
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- v1.*
|
|
||||||
- v1.*.*
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
# Required to make env var work on Windows
|
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Set up JDK 17
|
|
||||||
uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
|
||||||
#cache: 'gradle'
|
|
||||||
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew jpackageZip
|
|
||||||
|
|
||||||
- run: echo "OR_TARGET_NAME=linux-x64" >> $GITHUB_ENV
|
|
||||||
if: matrix.os == 'ubuntu-latest'
|
|
||||||
|
|
||||||
- run: echo "OR_TARGET_NAME=macos" >> $GITHUB_ENV
|
|
||||||
if: matrix.os == 'macos-latest'
|
|
||||||
|
|
||||||
- run: echo "OR_TARGET_NAME=windows" >> $GITHUB_ENV
|
|
||||||
if: matrix.os == 'windows-latest'
|
|
||||||
|
|
||||||
- name: Rename jpackage zip
|
|
||||||
run: mv ./build/distributions/openrndr-application.zip ./build/distributions/openrndr-application-${{env.OR_TARGET_NAME}}.zip
|
|
||||||
|
|
||||||
- name: Create Release
|
|
||||||
uses: ncipollo/release-action@v1.14.0
|
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
allowUpdates: true
|
|
||||||
replacesArtifacts: false
|
|
||||||
body: Fully automated release
|
|
||||||
artifacts: "./build/distributions/openrndr-application-${{env.OR_TARGET_NAME}}.zip"
|
|
||||||
|
|
||||||
8
.gitignore
vendored
8
.gitignore
vendored
@@ -3,11 +3,3 @@ build
|
|||||||
out
|
out
|
||||||
.idea
|
.idea
|
||||||
.gradle
|
.gradle
|
||||||
.kotlin
|
|
||||||
.lwjgl
|
|
||||||
video/
|
|
||||||
screenshots/
|
|
||||||
gui-parameters/
|
|
||||||
ffmpegOutput.txt
|
|
||||||
ShaderError.glsl
|
|
||||||
|
|
||||||
|
|||||||
68
README.md
68
README.md
@@ -1,66 +1,12 @@
|
|||||||
# OPENRNDR template project
|
# openrndr-template
|
||||||
|
A feature rich template for creating OPENRNDR programs based on Gradle/Kts
|
||||||
|
|
||||||
A feature rich template for creating OPENRNDR programs based on [Gradle/Kts](https://en.wikipedia.org/wiki/Gradle).
|
You will find some [basic instructions](https://guide.openrndr.org/#/02_Getting_Started_with_OPENRNDR/C00_SetupYourFirstProgram) in the [OPENRNDR guide](https://guide.openrndr.org)
|
||||||
|
|
||||||
The template consists of a configuration for Gradle and two example OPENRNDR programs. The Gradle configuration should serve as the
|
The template consists of a configuration for Gradle and an example OPENRNDR program. The Gradle configuration should serve as the
|
||||||
go-to starting point for writing OPENRNDR-based software.
|
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).
|
|
||||||
|
|
||||||
## Gradle tasks
|
## Gradle tasks
|
||||||
|
- `run` runs the TemplateProgram
|
||||||
- `./gradlew run` runs `TemplateProgram.kt` (Use `gradlew.bat run` under Windows)
|
- `jar` creates an executable platform specific jar file with all dependencies
|
||||||
- `./gradlew run -Popenrndr.application=MyProgramKt` runs `src/main/kotlin/myProgram.kt`
|
- `zipDistribution` creates a zip file containing the application jar and the data folder
|
||||||
- `./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`.
|
|
||||||
|
|
||||||
## 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 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 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:
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Github Actions
|
|
||||||
|
|
||||||
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,
|
|
||||||
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:
|
|
||||||
```
|
|
||||||
git tag -a v1.0.0 -m "v1.0.0"
|
|
||||||
git push origin v1.0.0
|
|
||||||
```
|
|
||||||
|
|
||||||
You can follow the progress of the action under the Actions tab in GitHub. Once complete, the executables will appear under the Releases section.
|
|
||||||
|
|||||||
461
build.gradle.kts
461
build.gradle.kts
@@ -1,374 +1,141 @@
|
|||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
import org.gradle.internal.os.OperatingSystem
|
import org.gradle.internal.os.OperatingSystem
|
||||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
||||||
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
|
|
||||||
|
|
||||||
group = "org.openrndr.template"
|
val kotlinVersion = "1.3.50"
|
||||||
version = "1.0.0"
|
|
||||||
|
|
||||||
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-compositor",
|
|
||||||
// "orx-compute-graph",
|
|
||||||
// "orx-compute-graph-nodes",
|
|
||||||
"orx-delegate-magic",
|
|
||||||
// "orx-dnk3",
|
|
||||||
// "orx-easing",
|
|
||||||
"orx-envelopes",
|
|
||||||
// "orx-expression-evaluator",
|
|
||||||
// "orx-fcurve",
|
|
||||||
// "orx-fft",
|
|
||||||
// "orx-file-watcher",
|
|
||||||
"orx-fx",
|
|
||||||
// "orx-git-archiver",
|
|
||||||
// "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-math",
|
|
||||||
// "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-property-watchers",
|
|
||||||
// "orx-quadtree",
|
|
||||||
// "orx-rabbit-control",
|
|
||||||
// "orx-realsense2",
|
|
||||||
// "orx-runway",
|
|
||||||
"orx-shade-styles",
|
|
||||||
// "orx-shader-phrases",
|
|
||||||
"orx-shapes",
|
|
||||||
"orx-svg",
|
|
||||||
// "orx-syphon",
|
|
||||||
// "orx-temporal-blur",
|
|
||||||
// "orx-tensorflow",
|
|
||||||
"orx-text-writer",
|
|
||||||
// "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 {
|
plugins {
|
||||||
java
|
java
|
||||||
alias(libs.plugins.kotlin.jvm)
|
kotlin("jvm") version("1.3.50")
|
||||||
alias(libs.plugins.shadow)
|
|
||||||
alias(libs.plugins.runtime)
|
|
||||||
alias(libs.plugins.gitarchive.tomarkdown).apply(false)
|
|
||||||
alias(libs.plugins.versions)
|
|
||||||
alias(libs.plugins.kotlin.serialization)
|
|
||||||
}
|
}
|
||||||
|
group = "org.openrndr.template"
|
||||||
|
version = "0.3.3"
|
||||||
|
|
||||||
|
val applicationMainClass = "TemplateProgramKt"
|
||||||
|
val applicationFullLogging = false
|
||||||
|
|
||||||
|
val openrndrUseSnapshot = false
|
||||||
|
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.35"
|
||||||
|
val openrndrOs = when (OperatingSystem.current()) {
|
||||||
|
OperatingSystem.WINDOWS -> "windows"
|
||||||
|
OperatingSystem.MAC_OS -> "macos"
|
||||||
|
OperatingSystem.LINUX -> "linux-x64"
|
||||||
|
else -> throw IllegalArgumentException("os not supported")
|
||||||
|
}
|
||||||
|
|
||||||
|
// supported features are: video, panel
|
||||||
|
val openrndrFeatures = setOf("video", "panel")
|
||||||
|
|
||||||
|
val panelUseSnapshot = false
|
||||||
|
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.17-m3"
|
||||||
|
|
||||||
|
val orxUseSnapshot = false
|
||||||
|
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.32"
|
||||||
|
|
||||||
|
// supported features are: orx-camera, orx-compositor,orx-easing, orx-filter-extension,orx-file-watcher, orx-kinect-v1
|
||||||
|
// orx-integral-image, orx-interval-tree, orx-jumpflood,orx-kdtree, orx-mesh-generators,orx-midi, orx-no-clear,
|
||||||
|
// orx-noise, orx-obj, orx-olive
|
||||||
|
|
||||||
|
val orxFeatures = setOf("orx-noise")
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
if (openrndrUseSnapshot || orxUseSnapshot || panelUseSnapshot) {
|
||||||
|
mavenLocal()
|
||||||
|
}
|
||||||
|
maven(url = "https://dl.bintray.com/openrndr/openrndr")
|
||||||
|
}
|
||||||
|
|
||||||
|
fun DependencyHandler.orx(module: String): Any {
|
||||||
|
return "org.openrndr.extra:$module:$orxVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun DependencyHandler.openrndr(module: String): Any {
|
||||||
|
return "org.openrndr:openrndr-$module:$openrndrVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun DependencyHandler.openrndrNatives(module: String): Any {
|
||||||
|
return "org.openrndr:openrndr-$module-natives-$openrndrOs:$openrndrVersion"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun DependencyHandler.orxNatives(module: String): Any {
|
||||||
|
return "org.openrndr.extra:$module-natives-$openrndrOs:$orxVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
runtime(openrndr("gl3"))
|
||||||
|
runtime(openrndrNatives("gl3"))
|
||||||
|
compile(openrndr("core"))
|
||||||
|
compile(openrndr("svg"))
|
||||||
|
compile(openrndr("animatable"))
|
||||||
|
compile(openrndr("extensions"))
|
||||||
|
compile(openrndr("filter"))
|
||||||
|
|
||||||
// implementation(libs.jsoup)
|
compile("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.0-RC")
|
||||||
// implementation(libs.csv)
|
|
||||||
|
|
||||||
/* ORSL dependencies */
|
compile("io.github.microutils", "kotlin-logging","1.7.2")
|
||||||
|
|
||||||
// implementation(libs.orsl.shader.generator)
|
if (!applicationFullLogging) {
|
||||||
// implementation(libs.orsl.extension.color)
|
runtime("org.slf4j","slf4j-nop","1.7.25")
|
||||||
// implementation(libs.orsl.extension.easing)
|
} else {
|
||||||
// implementation(libs.orsl.extension.gradient)
|
runtime("org.apache.logging.log4j", "log4j-slf4j-impl", "2.12.0")
|
||||||
// implementation(libs.orsl.extension.noise)
|
runtime("com.fasterxml.jackson.core", "jackson-databind", "2.8.7")
|
||||||
// implementation(libs.orsl.extension.pbr)
|
runtime("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.8.7")
|
||||||
// implementation(libs.orsl.extension.raymarching)
|
|
||||||
// implementation(libs.orsl.extension.sdf)
|
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ("video" in openrndrFeatures) {
|
||||||
|
compile(openrndr("ffmpeg"))
|
||||||
|
runtime(openrndrNatives("ffmpeg"))
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("panel" in openrndrFeatures) {
|
||||||
|
compile("org.openrndr.panel:openrndr-panel:$panelVersion")
|
||||||
|
}
|
||||||
|
|
||||||
|
for (feature in orxFeatures) {
|
||||||
|
compile(orx(feature))
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("orx-olive" in orxFeatures) {
|
||||||
|
compile("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable")
|
||||||
|
}
|
||||||
|
|
||||||
|
if ("orx-kinect-v1" in orxFeatures) {
|
||||||
|
runtime(orxNatives("orx-kinect-v1"))
|
||||||
|
}
|
||||||
|
|
||||||
implementation(kotlin("stdlib-jdk8"))
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
testImplementation(libs.junit)
|
testCompile("junit", "junit", "4.12")
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
configure<JavaPluginConvention> {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
java {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_17
|
|
||||||
targetCompatibility = JavaVersion.VERSION_17
|
|
||||||
}
|
}
|
||||||
kotlin {
|
tasks.withType<KotlinCompile> {
|
||||||
compilerOptions {
|
kotlinOptions.jvmTarget = "1.8"
|
||||||
languageVersion = KotlinVersion.KOTLIN_2_0
|
|
||||||
apiVersion = KotlinVersion.KOTLIN_2_0
|
|
||||||
jvmTarget = JvmTarget.JVM_17
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
tasks.withType<Jar> {
|
||||||
|
manifest {
|
||||||
|
attributes["Main-Class"] = applicationMainClass
|
||||||
|
}
|
||||||
|
doFirst {
|
||||||
|
from(configurations.compileClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||||
|
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||||
|
}
|
||||||
|
|
||||||
application {
|
exclude(listOf("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA", "**/module-info*"))
|
||||||
mainClass = if (hasProperty("openrndr.application"))
|
archiveFileName.set("application-$openrndrOs.jar")
|
||||||
"${property("openrndr.application")}"
|
|
||||||
else
|
|
||||||
applicationMainClass
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks.create("zipDistribution", Zip::class.java) {
|
||||||
named<ShadowJar>("shadowJar") {
|
archiveFileName.set("application-$openrndrOs.zip")
|
||||||
manifest {
|
from("./") {
|
||||||
attributes["Main-Class"] = applicationMainClass
|
include("data/**")
|
||||||
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:.*"))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
from("$buildDir/libs/application-$openrndrOs.jar")
|
||||||
|
}.dependsOn(tasks.jar)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
tasks.create("run", JavaExec::class.java) {
|
||||||
|
main = applicationMainClass
|
||||||
tasks {
|
classpath = sourceSets.main.get().runtimeClasspath
|
||||||
named<org.beryx.runtime.JPackageTask>("jpackage") {
|
}.dependsOn(tasks.build)
|
||||||
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")
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
register<org.openrndr.extra.gitarchiver.GitArchiveToMarkdown>("gitArchiveToMarkDown") {
|
|
||||||
historySize = 20
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
|
||||||
|
|
||||||
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)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------------ //
|
|
||||||
|
|
||||||
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("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") {
|
|
||||||
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()
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
BIN
data/fonts/IBMPlexMono-Regular.ttf
Normal file
BIN
data/fonts/IBMPlexMono-Regular.ttf
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,92 +0,0 @@
|
|||||||
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
|
|
||||||
|
|
||||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
||||||
This license is copied below, and is also available with a FAQ at:
|
|
||||||
http://scripts.sil.org/OFL
|
|
||||||
|
|
||||||
-----------------------------------------------------------
|
|
||||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
||||||
-----------------------------------------------------------
|
|
||||||
|
|
||||||
PREAMBLE
|
|
||||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
||||||
development of collaborative font projects, to support the font creation
|
|
||||||
efforts of academic and linguistic communities, and to provide a free and
|
|
||||||
open framework in which fonts may be shared and improved in partnership
|
|
||||||
with others.
|
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
|
||||||
redistributed and/or sold with any software provided that any reserved
|
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
|
||||||
however, cannot be released under any other type of license. The
|
|
||||||
requirement for fonts to remain under this license does not apply
|
|
||||||
to any document created using the fonts or their derivatives.
|
|
||||||
|
|
||||||
DEFINITIONS
|
|
||||||
"Font Software" refers to the set of files released by the Copyright
|
|
||||||
Holder(s) under this license and clearly marked as such. This may
|
|
||||||
include source files, build scripts and documentation.
|
|
||||||
|
|
||||||
"Reserved Font Name" refers to any names specified as such after the
|
|
||||||
copyright statement(s).
|
|
||||||
|
|
||||||
"Original Version" refers to the collection of Font Software components as
|
|
||||||
distributed by the Copyright Holder(s).
|
|
||||||
|
|
||||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
||||||
or substituting -- in part or in whole -- any of the components of the
|
|
||||||
Original Version, by changing formats or by porting the Font Software to a
|
|
||||||
new environment.
|
|
||||||
|
|
||||||
"Author" refers to any designer, engineer, programmer, technical
|
|
||||||
writer or other person who contributed to the Font Software.
|
|
||||||
|
|
||||||
PERMISSION & CONDITIONS
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
||||||
redistribute, and sell modified and unmodified copies of the Font
|
|
||||||
Software, subject to the following conditions:
|
|
||||||
|
|
||||||
1) Neither the Font Software nor any of its individual components,
|
|
||||||
in Original or Modified Versions, may be sold by itself.
|
|
||||||
|
|
||||||
2) Original or Modified Versions of the Font Software may be bundled,
|
|
||||||
redistributed and/or sold with any software, provided that each copy
|
|
||||||
contains the above copyright notice and this license. These can be
|
|
||||||
included either as stand-alone text files, human-readable headers or
|
|
||||||
in the appropriate machine-readable metadata fields within text or
|
|
||||||
binary files as long as those fields can be easily viewed by the user.
|
|
||||||
|
|
||||||
3) No Modified Version of the Font Software may use the Reserved Font
|
|
||||||
Name(s) unless explicit written permission is granted by the corresponding
|
|
||||||
Copyright Holder. This restriction only applies to the primary font name as
|
|
||||||
presented to the users.
|
|
||||||
|
|
||||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
||||||
Software shall not be used to promote, endorse or advertise any
|
|
||||||
Modified Version, except to acknowledge the contribution(s) of the
|
|
||||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
||||||
permission.
|
|
||||||
|
|
||||||
5) The Font Software, modified or unmodified, in part or in whole,
|
|
||||||
must be distributed entirely under this license, and must not be
|
|
||||||
distributed under any other license. The requirement for fonts to
|
|
||||||
remain under this license does not apply to any document created
|
|
||||||
using the Font Software.
|
|
||||||
|
|
||||||
TERMINATION
|
|
||||||
This license becomes null and void if any of the above conditions are
|
|
||||||
not met.
|
|
||||||
|
|
||||||
DISCLAIMER
|
|
||||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
||||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
||||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
||||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
||||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 95 KiB |
@@ -1,6 +1 @@
|
|||||||
openrndr.tasks=true
|
kotlin.code.style=official
|
||||||
kotlin.code.style=official
|
|
||||||
#org.gradle.configuration-cache=true
|
|
||||||
#org.gradle.configuration-cache.parallel=true
|
|
||||||
#org.gradle.configuration-cache.problems=warn
|
|
||||||
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
[versions]
|
|
||||||
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"
|
|
||||||
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" }
|
|
||||||
|
|
||||||
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
|
||||||
slf4j-nop = { group = "org.slf4j", name = "slf4j-nop", version.ref = "slf4j" }
|
|
||||||
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
|
|
||||||
log4j-slf4j2 = { group = "org.apache.logging.log4j", name = "log4j-slf4j2-impl", version.ref = "log4j" }
|
|
||||||
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
|
|
||||||
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" }
|
|
||||||
|
|
||||||
orsl-shader-generator = { group = "org.openrndr.extra", name = "orsl-shader-generator", version.ref = "orsl" }
|
|
||||||
orsl-extension-color = { group = "org.openrndr.extra", name = "orsl-extension-color", version.ref = "orsl" }
|
|
||||||
orsl-extension-easing = { group = "org.openrndr.extra", name = "orsl-extension-easing", version.ref = "orsl" }
|
|
||||||
orsl-extension-gradient = { group = "org.openrndr.extra", name = "orsl-extension-gradient", version.ref = "orsl" }
|
|
||||||
orsl-extension-noise = { group = "org.openrndr.extra", name = "orsl-extension-noise", version.ref = "orsl" }
|
|
||||||
orsl-extension-pbr = { group = "org.openrndr.extra", name = "orsl-extension-pbr", version.ref = "orsl" }
|
|
||||||
orsl-extension-raymarching = { group = "org.openrndr.extra", name = "orsl-extension-raymarching", version.ref = "orsl" }
|
|
||||||
orsl-extension-sdf = { group = "org.openrndr.extra", name = "orsl-extension-sdf", version.ref = "orsl" }
|
|
||||||
|
|
||||||
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" }
|
|
||||||
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" }
|
|
||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
7
gradle/wrapper/gradle-wrapper.properties
vendored
7
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,6 @@
|
|||||||
|
#Thu Aug 01 12:32:31 CEST 2019
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
|
||||||
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
|
|
||||||
networkTimeout=10000
|
|
||||||
validateDistributionUrl=true
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
311
gradlew
vendored
311
gradlew
vendored
@@ -1,129 +1,78 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
#
|
|
||||||
# Copyright © 2015-2021 the original authors.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
##
|
||||||
# Gradle start up script for POSIX generated by Gradle.
|
## Gradle start up script for UN*X
|
||||||
#
|
##
|
||||||
# Important for running:
|
|
||||||
#
|
|
||||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
|
||||||
# noncompliant, but you have some other compliant shell such as ksh or
|
|
||||||
# bash, then to run this script, type that shell name before the whole
|
|
||||||
# command line, like:
|
|
||||||
#
|
|
||||||
# ksh Gradle
|
|
||||||
#
|
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
|
||||||
# requires all of these POSIX shell features:
|
|
||||||
# * functions;
|
|
||||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
|
||||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
|
||||||
# * compound commands having a testable exit status, especially «case»;
|
|
||||||
# * various built-in commands including «command», «set», and «ulimit».
|
|
||||||
#
|
|
||||||
# Important for patching:
|
|
||||||
#
|
|
||||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
|
||||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
|
||||||
#
|
|
||||||
# The "traditional" practice of packing multiple parameters into a
|
|
||||||
# space-separated string is a well documented source of bugs and security
|
|
||||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
|
||||||
# options in "$@", and eventually passing that to Java.
|
|
||||||
#
|
|
||||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
|
||||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
|
||||||
# see the in-line comments for details.
|
|
||||||
#
|
|
||||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
|
||||||
# Darwin, MinGW, and NonStop.
|
|
||||||
#
|
|
||||||
# (3) This script is generated from the Groovy template
|
|
||||||
# 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/.
|
|
||||||
#
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
|
|
||||||
# Resolve links: $0 may be a link
|
# Resolve links: $0 may be a link
|
||||||
app_path=$0
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
# Need this for daisy-chained symlinks.
|
while [ -h "$PRG" ] ; do
|
||||||
while
|
ls=`ls -ld "$PRG"`
|
||||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
[ -h "$app_path" ]
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
do
|
PRG="$link"
|
||||||
ls=$( ls -ld "$app_path" )
|
else
|
||||||
link=${ls#*' -> '}
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
case $link in #(
|
fi
|
||||||
/*) app_path=$link ;; #(
|
|
||||||
*) app_path=$APP_HOME$link ;;
|
|
||||||
esac
|
|
||||||
done
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
# This is normally unused
|
APP_NAME="Gradle"
|
||||||
# shellcheck disable=SC2034
|
APP_BASE_NAME=`basename "$0"`
|
||||||
APP_BASE_NAME=${0##*/}
|
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
DEFAULT_JVM_OPTS='"-Xmx64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD="maximum"
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
} >&2
|
}
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
} >&2
|
}
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "$( uname )" in #(
|
case "`uname`" in
|
||||||
CYGWIN* ) cygwin=true ;; #(
|
CYGWIN* )
|
||||||
Darwin* ) darwin=true ;; #(
|
cygwin=true
|
||||||
MSYS* | MINGW* ) msys=true ;; #(
|
;;
|
||||||
NONSTOP* ) nonstop=true ;;
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
NONSTOP* )
|
||||||
|
nonstop=true
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH="\\\"\\\""
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
else
|
else
|
||||||
JAVACMD=$JAVA_HOME/bin/java
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
@@ -132,120 +81,92 @@ Please set the JAVA_HOME variable in your environment to match the
|
|||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD="java"
|
||||||
if ! command -v java >/dev/null 2>&1
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
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
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||||
case $MAX_FD in #(
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
max*)
|
if [ $? -eq 0 ] ; then
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
# shellcheck disable=SC2039,SC3045
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
|
||||||
warn "Could not query maximum file descriptor limit"
|
|
||||||
esac
|
|
||||||
case $MAX_FD in #(
|
|
||||||
'' | soft) :;; #(
|
|
||||||
*)
|
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
|
||||||
# shellcheck disable=SC2039,SC3045
|
|
||||||
ulimit -n "$MAX_FD" ||
|
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Collect all arguments for the java command, stacking in reverse order:
|
|
||||||
# * args from the command line
|
|
||||||
# * the main class name
|
|
||||||
# * -classpath
|
|
||||||
# * -D...appname settings
|
|
||||||
# * --module-path (only if needed)
|
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if "$cygwin" || "$msys" ; then
|
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
|
||||||
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
for arg do
|
|
||||||
if
|
|
||||||
case $arg in #(
|
|
||||||
-*) false ;; # don't mess with options #(
|
|
||||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
|
||||||
[ -e "$t" ] ;; #(
|
|
||||||
*) false ;;
|
|
||||||
esac
|
|
||||||
then
|
|
||||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
|
||||||
fi
|
fi
|
||||||
# Roll the args list around exactly as many times as the number of
|
ulimit -n $MAX_FD
|
||||||
# args, so each arg winds up back in the position where it started, but
|
if [ $? -ne 0 ] ; then
|
||||||
# possibly modified.
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
#
|
fi
|
||||||
# NB: a `for` loop captures its iteration list before it begins, so
|
else
|
||||||
# changing the positional parameters here affects neither the number of
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
# iterations, nor the values presented in `arg`.
|
fi
|
||||||
shift # remove old arg
|
fi
|
||||||
set -- "$@" "$arg" # push replacement arg
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
done
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Escape application args
|
||||||
|
save () {
|
||||||
|
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||||
|
echo " "
|
||||||
|
}
|
||||||
|
APP_ARGS=$(save "$@")
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||||
# and any embedded shellness will be escaped.
|
cd "$(dirname "$0")"
|
||||||
# * 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" \
|
|
||||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
|
||||||
if ! command -v xargs >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
die "xargs is not available"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Use "xargs" to parse quoted args.
|
|
||||||
#
|
|
||||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
|
||||||
#
|
|
||||||
# In Bash we could simply go:
|
|
||||||
#
|
|
||||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
|
||||||
# set -- "${ARGS[@]}" "$@"
|
|
||||||
#
|
|
||||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
|
||||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
|
||||||
# character that might be a shell metacharacter, then use eval to reverse
|
|
||||||
# that process (while maintaining the separation between arguments), and wrap
|
|
||||||
# the whole thing up as a single "set" statement.
|
|
||||||
#
|
|
||||||
# This will of course break if any of these variables contains a newline or
|
|
||||||
# an unmatched quote.
|
|
||||||
#
|
|
||||||
|
|
||||||
eval "set -- $(
|
|
||||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
|
||||||
xargs -n1 |
|
|
||||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
|
||||||
tr '\n' ' '
|
|
||||||
)" '"$@"'
|
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|||||||
80
gradlew.bat
vendored
80
gradlew.bat
vendored
@@ -1,22 +1,4 @@
|
|||||||
@rem
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem Copyright 2015 the original author or authors.
|
|
||||||
@rem
|
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
@rem you may not use this file except in compliance with the License.
|
|
||||||
@rem You may obtain a copy of the License at
|
|
||||||
@rem
|
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
@rem
|
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
@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 ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@@ -27,29 +9,25 @@
|
|||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
@rem This is normally unused
|
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
|
||||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
set DEFAULT_JVM_OPTS="-Xmx64m"
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -57,36 +35,48 @@ goto fail
|
|||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%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" %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
exit /b 1
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|||||||
2
settings.gradle
Normal file
2
settings.gradle
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
rootProject.name = 'openrndr-template'
|
||||||
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
rootProject.name = "openrndr-template"
|
|
||||||
|
|
||||||
pluginManagement {
|
|
||||||
repositories {
|
|
||||||
gradlePluginPortal()
|
|
||||||
mavenLocal()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import org.openrndr.application
|
|
||||||
import org.openrndr.color.ColorRGBa
|
|
||||||
import org.openrndr.extra.olive.oliveProgram
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This is a template for a live program.
|
|
||||||
*
|
|
||||||
* It uses oliveProgram {} instead of program {}. All code inside the
|
|
||||||
* oliveProgram {} can be changed while the program is running.
|
|
||||||
*/
|
|
||||||
|
|
||||||
fun main() = application {
|
|
||||||
configure {
|
|
||||||
width = 800
|
|
||||||
height = 800
|
|
||||||
}
|
|
||||||
oliveProgram {
|
|
||||||
extend {
|
|
||||||
drawer.clear(ColorRGBa.PINK)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
import org.openrndr.application
|
import org.openrndr.application
|
||||||
import org.openrndr.color.ColorRGBa
|
import org.openrndr.color.ColorRGBa
|
||||||
import org.openrndr.draw.loadFont
|
import org.openrndr.draw.FontImageMap
|
||||||
import org.openrndr.draw.loadImage
|
import org.openrndr.draw.loadImage
|
||||||
import org.openrndr.extra.color.colormatrix.tint
|
import org.openrndr.draw.tint
|
||||||
import kotlin.math.cos
|
|
||||||
import kotlin.math.sin
|
|
||||||
|
|
||||||
fun main() = application {
|
fun main() = application {
|
||||||
configure {
|
configure {
|
||||||
@@ -13,19 +11,20 @@ fun main() = application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
program {
|
program {
|
||||||
val image = loadImage("data/images/pm5544.png")
|
|
||||||
val font = loadFont("data/fonts/default.otf", 64.0)
|
val image = loadImage("file:data/images/pm5544.png")
|
||||||
|
val font = FontImageMap.fromUrl("file:data/fonts/IBMPlexMono-Regular.ttf", 64.0)
|
||||||
|
|
||||||
extend {
|
extend {
|
||||||
drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
|
drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
|
||||||
drawer.image(image)
|
drawer.image(image)
|
||||||
|
|
||||||
drawer.fill = ColorRGBa.PINK
|
drawer.fill = ColorRGBa.PINK
|
||||||
drawer.circle(cos(seconds) * width / 2.0 + width / 2.0, sin(0.5 * seconds) * height / 2.0 + height / 2.0, 140.0)
|
drawer.circle(Math.cos(seconds)*width/2.0+width/2.0, Math.sin(0.5*seconds)*height/2.0 + height/2.0, 140.0)
|
||||||
|
|
||||||
drawer.fontMap = font
|
drawer.fontMap = font
|
||||||
drawer.fill = ColorRGBa.WHITE
|
drawer.fill = ColorRGBa.WHITE
|
||||||
drawer.text("OPENRNDR", width / 2.0, height / 2.0)
|
drawer.text("OPENRNDR", width/2.0, height /2.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,20 @@
|
|||||||
Configuration:
|
Configuration:
|
||||||
status: warn
|
status: warn
|
||||||
Appenders:
|
Appenders:
|
||||||
Console:
|
Console:
|
||||||
- name: Console_Info
|
name: Console
|
||||||
target: SYSTEM_ERR
|
target: SYSTEM_OUT
|
||||||
PatternLayout:
|
PatternLayout:
|
||||||
Pattern: "%highlight{${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=green, TRACE=green} %style{[%t]}{white} %style{%-30.30c{1.}}{white} %style{ ↘ %m%n%ex}{white}"
|
Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
|
||||||
#Pattern: "%style{%d{yyyy-MM-dd HH:mm:ss.SSS}}{white} %highlight{${LOG_LEVEL_PATTERN:-%5p}}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=green, TRACE=green} %style{[%t]}{white} %style{%-30.30c{1.}}{cyan} %style{:%m%n%ex}{white}"
|
File:
|
||||||
File:
|
append: false
|
||||||
append: false
|
name: File_Appender
|
||||||
name: File_Appender
|
fileName: application.log
|
||||||
fileName: application.log
|
PatternLayout:
|
||||||
PatternLayout:
|
Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
|
||||||
Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"
|
|
||||||
Loggers:
|
Loggers:
|
||||||
Root:
|
Root:
|
||||||
level: info
|
level: debug
|
||||||
AppenderRef:
|
AppenderRef:
|
||||||
- ref: Console_Info
|
- ref: Console
|
||||||
- ref: File_Appender
|
- ref: File_Appender
|
||||||
Reference in New Issue
Block a user