Compare commits

...

15 Commits

Author SHA1 Message Date
Edwin Jakobs
f391fed255 Add jpackageZip and Github actions for publishing binaries 2020-05-17 11:00:48 +02:00
Edwin Jakobs
896a8629fa Upgrade OPENRNDR/ORX 2020-05-15 18:15:31 +02:00
Edwin Jakobs
53dec983b1 Upgrade OPENRNDR/ORX, kotlin-coroutines core 1.3.6 2020-05-11 09:08:17 +02:00
Edwin Jakobs
0296f5036f Upgrade to Gradle 6.4 2020-05-06 23:26:31 +02:00
Edwin Jakobs
5151b7af89 Upgrade OPENRNDR, change TemplateLiveProgram.kt 2020-05-06 19:13:30 +02:00
Edwin Jakobs
38254b084d Fix issue with IntelliJ and not having the script runtime on the classpath 2020-04-29 14:48:21 +02:00
Edwin Jakobs
5c0b2b2c3f Upgrade to OPENRNDR 0.3.42-rc.2, ORX 0.3.51-rc.3, Kotlin 1.3.72 2020-04-29 12:13:33 +02:00
Edwin Jakobs
e86cf3f7e6 Upgrade to OPENRNDR 0.3.40, ORX 0.3.50 2020-03-27 22:21:57 +01:00
Edwin Jakobs
3374024592 Merge pull request #4 from reinvdwoerd/patch-3
Added orx-shapes
2020-03-09 14:55:29 +01:00
Rein van der Woerd
14bb87c02e Update build.gradle.kts 2020-03-09 13:18:31 +01:00
Edwin Jakobs
6c0d0ed16b Merge pull request #3 from reinvdwoerd/patch-2
Added missing orx features...
2020-03-04 13:54:40 +01:00
Rein van der Woerd
eab750d7f7 Added missing orx features... 2020-03-04 13:22:19 +01:00
Edwin Jakobs
63bbdb1218 Merge pull request #2 from reinvdwoerd/patch-1
orx-noclear has been renamed to orx-no-clear
2020-03-02 18:14:58 +01:00
Rein van der Woerd
59349d83f2 orx-noclear has been renamed to orx-no-clear 2020-03-02 08:29:03 +01:00
Edwin Jakobs
998a5051c1 Update build.gradle.kts 2020-03-01 15:21:13 +01:00
10 changed files with 236 additions and 87 deletions

15
.github/workflows/build-on-commit.yaml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Build on commit
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 14
- name: Build sources
run: ./gradlew build

View File

@@ -0,0 +1,30 @@
name: Publish Linux/x64 binaries
on:
push:
tags:
- v0.*
- v0.*.*
- v1.*
- v1.*.*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Build with Gradle
run: ./gradlew jpackageZip
- name: Create Release
uses: ncipollo/release-action@v1.6.1
id: create_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replaceArtifacts: false
body: Fully automated release
artifacts: "./build/distributions/openrndr-application-linux-x64.zip"

View File

@@ -0,0 +1,30 @@
name: Publish macOS binaries
on:
push:
tags:
- v0.*
- v0.*.*
- v1.*
- v1.*.*
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Build with Gradle
run: ./gradlew jpackageZip
- name: Create Release
uses: ncipollo/release-action@v1.6.1
id: create_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replaceArtifacts: false
body: Fully automated release
artifacts: "./build/distributions/openrndr-application-macos.zip"

View File

@@ -0,0 +1,30 @@
name: Publish Windows binaries
on:
push:
tags:
- v0.*
- v0.*.*
- v1.*
- v1.*.*
-
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 14
uses: actions/setup-java@v1
with:
java-version: 14
- name: Build with Gradle
run: ./gradlew jpackageZip
- name: Create Release
uses: ncipollo/release-action@v1.6.1
id: create_release
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
replaceArtifacts: false
body: Fully automated release
artifacts: "./build/distributions/openrndr-application-windows.zip"

View File

@@ -12,7 +12,13 @@ You will find some [basic instructions](https://guide.openrndr.org/#/02_Getting_
- `run` runs the TemplateProgram - `run` runs the TemplateProgram
- `jar` creates an executable platform specific jar file with all dependencies - `jar` creates an executable platform specific jar file with all dependencies
- `zipDistribution` creates a zip file containing the application jar and the data folder - `zipDistribution` creates a zip file containing the application jar and the data folder
- `jpackageZip` creates a zip with a stand-alone executable for the current platform (works with Java 14 only)
## Cross builds ## Cross builds
To create runnable jars for a platform different from the platform you use to build one uses `./gradlew jar --PtargetPlatform=<platform>`. The supported platforms are `windows`, `macos`, `linux-x64` and `linux-arm64`. Note that the `linux-arm64` platform will only work with OPENRNDR snapshot builds from master and OPENRNDR 0.3.39 (a future version). To create runnable jars for a platform different from the platform you use to build one uses `./gradlew jar --PtargetPlatform=<platform>`. The supported platforms are `windows`, `macos`, `linux-x64` and `linux-arm64`. Note that the `linux-arm64` platform will only work with OPENRNDR snapshot builds from master and OPENRNDR 0.3.39 (a future version).
## Github Actions
This repository contains a number of Github Actions in `./github/workflows`.
The actions enable a basic build run on commit, plus publication actions that are executed when
a commit is tagged with a version number like `v0.*` or `v1.*`.

View File

@@ -1,10 +1,11 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.gradle.internal.os.OperatingSystem import org.gradle.internal.os.OperatingSystem
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
/* the name of this project, default is the template version but you are free to change these */ /* the name of this project, default is the template version but you are free to change these */
group = "org.openrndr.template" group = "org.openrndr.template"
version = "0.3.10" version = "0.3.12"
val applicationMainClass = "TemplateProgramKt" val applicationMainClass = "TemplateProgramKt"
@@ -13,43 +14,48 @@ val orxFeatures = setOf(
// "orx-camera", // "orx-camera",
"orx-compositor", "orx-compositor",
// "orx-easing", // "orx-easing",
// "orx-filter-extension",
// "orx-file-watcher", // "orx-file-watcher",
// "orx-parameters",
// "orx-filter-extension",
"orx-fx", "orx-fx",
"orx-gui", // "orx-glslify",
// "orx-gradient-descent",
// "orx-integral-image", // "orx-integral-image",
// "orx-interval-tree", // "orx-interval-tree",
"orx-image-fit",
// "orx-jumpflood", // "orx-jumpflood",
// "orx-kinect-v1", "orx-gui",
"orx-image-fit",
// "orx-kdtree", // "orx-kdtree",
// "orx-mesh-generators" // "orx-mesh-generators",
// "orx-midi", // "orx-midi",
// "orx-noclear", // "orx-no-clear",
"orx-noise", "orx-noise",
// "orx-obj" // "orx-obj-loader",
"orx-olive", "orx-olive",
// "orx-osc" // "orx-osc",
// "orx-palette" // "orx-palette",
// "orx-runway" // "orx-poisson-fill",
"orx-shade-styles" // "orx-runway",
// "orx-shader-phrases",
"orx-shade-styles",
// "orx-shapes",
// "orx-syphon",
// "orx-temporal-blur",
// "orx-kinect-v1",
"orx-panel"
) )
/* Which OPENRNDR libraries should be added to this project? */ /* Which OPENRNDR libraries should be added to this project? */
val openrndrFeatures = setOf( val openrndrFeatures = setOf(
"panel",
"video" "video"
) )
/* Which version of OPENRNDR, ORX and Panel should be used? */ /* Which version of OPENRNDR and ORX should be used? */
val openrndrUseSnapshot = false val openrndrUseSnapshot = false
val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.39" val openrndrVersion = if (openrndrUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.42"
val panelUseSnapshot = false
val panelVersion = if (panelUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.21"
val orxUseSnapshot = false val orxUseSnapshot = false
val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.47" val orxVersion = if (orxUseSnapshot) "0.4.0-SNAPSHOT" else "0.3.51"
//<editor-fold desc="This is code for OPENRNDR, no need to edit this .. most of the times"> //<editor-fold desc="This is code for OPENRNDR, no need to edit this .. most of the times">
val supportedPlatforms = setOf("windows", "macos", "linux-x64", "linux-arm64") val supportedPlatforms = setOf("windows", "macos", "linux-x64", "linux-arm64")
@@ -80,18 +86,20 @@ enum class Logging {
} }
/* What type of logging should this project use? */ /* What type of logging should this project use? */
val applicationLogging = Logging.SIMPLE val applicationLogging = Logging.FULL
val kotlinVersion = "1.3.61" val kotlinVersion = "1.3.72"
plugins { plugins {
java java
kotlin("jvm") version("1.3.61") kotlin("jvm") version("1.3.72")
id("com.github.johnrengelman.shadow") version ("5.2.0")
id("org.beryx.runtime") version ("1.8.1")
} }
repositories { repositories {
mavenCentral() mavenCentral()
if (openrndrUseSnapshot || orxUseSnapshot || panelUseSnapshot) { if (openrndrUseSnapshot || orxUseSnapshot) {
mavenLocal() mavenLocal()
} }
maven(url = "https://dl.bintray.com/openrndr/openrndr") maven(url = "https://dl.bintray.com/openrndr/openrndr")
@@ -114,13 +122,11 @@ fun DependencyHandler.orxNatives(module: String): Any {
} }
dependencies { dependencies {
/* This is where you add additional (third-party) dependencies */ /* This is where you add additional (third-party) dependencies */
// implementation("org.jsoup:jsoup:1.12.2") // implementation("org.jsoup:jsoup:1.12.2")
// implementation("com.google.code.gson:gson:2.8.6") // implementation("com.google.code.gson:gson:2.8.6")
//<editor-fold desc="Managed dependencies">
runtimeOnly(openrndr("gl3")) runtimeOnly(openrndr("gl3"))
runtimeOnly(openrndrNatives("gl3")) runtimeOnly(openrndrNatives("gl3"))
implementation(openrndr("openal")) implementation(openrndr("openal"))
@@ -131,20 +137,20 @@ dependencies {
implementation(openrndr("extensions")) implementation(openrndr("extensions"))
implementation(openrndr("filter")) implementation(openrndr("filter"))
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.3") implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core","1.3.6")
implementation("io.github.microutils", "kotlin-logging","1.7.8") implementation("io.github.microutils", "kotlin-logging","1.7.9")
when(applicationLogging) { when(applicationLogging) {
Logging.NONE -> { Logging.NONE -> {
runtimeOnly("org.slf4j","slf4j-nop","1.7.29") runtimeOnly("org.slf4j","slf4j-nop","1.7.30")
} }
Logging.SIMPLE -> { Logging.SIMPLE -> {
runtimeOnly("org.slf4j","slf4j-simple","1.7.29") runtimeOnly("org.slf4j","slf4j-simple","1.7.30")
} }
Logging.FULL -> { Logging.FULL -> {
runtimeOnly("org.apache.logging.log4j", "log4j-slf4j-impl", "2.13.0") runtimeOnly("org.apache.logging.log4j", "log4j-slf4j-impl", "2.13.1")
runtimeOnly("com.fasterxml.jackson.core", "jackson-databind", "2.10.1") runtimeOnly("com.fasterxml.jackson.core", "jackson-databind", "2.10.3")
runtimeOnly("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.10.1") runtimeOnly("com.fasterxml.jackson.dataformat", "jackson-dataformat-yaml", "2.10.3")
} }
} }
@@ -153,10 +159,6 @@ dependencies {
runtimeOnly(openrndrNatives("ffmpeg")) runtimeOnly(openrndrNatives("ffmpeg"))
} }
if ("panel" in openrndrFeatures) {
implementation("org.openrndr.panel:openrndr-panel:$panelVersion")
}
for (feature in orxFeatures) { for (feature in orxFeatures) {
implementation(orx(feature)) implementation(orx(feature))
} }
@@ -166,12 +168,11 @@ dependencies {
} }
if ("orx-olive" in orxFeatures) { if ("orx-olive" in orxFeatures) {
implementation("org.jetbrains.kotlin", "kotlin-scripting-compiler-embeddable") implementation("org.jetbrains.kotlin:kotlin-script-runtime:$kotlinVersion")
} }
implementation(kotlin("stdlib-jdk8")) implementation(kotlin("stdlib-jdk8"))
testImplementation("junit", "junit", "4.12") testImplementation("junit", "junit", "4.12")
//</editor-fold>
} }
// -------------------------------------------------------------------------------------------------------------------- // --------------------------------------------------------------------------------------------------------------------
@@ -183,28 +184,64 @@ tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8" kotlinOptions.jvmTarget = "1.8"
} }
tasks.withType<Jar> {
project.setProperty("mainClassName", applicationMainClass)
tasks {
named<ShadowJar>("shadowJar") {
manifest { manifest {
attributes["Main-Class"] = applicationMainClass attributes["Main-Class"] = applicationMainClass
} }
doFirst { minimize {
from(configurations.compileClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) exclude(dependency("org.openrndr:openrndr-gl3:.*"))
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) }) exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:.*"))
}
}
named<org.beryx.runtime.JPackageTask>("jpackage") {
doLast {
when (OperatingSystem.current()) {
OperatingSystem.WINDOWS, OperatingSystem.LINUX -> {
copy {
from("data") {
include("**/*")
}
into("build/jpackage/openrndr-application/data")
}
}
OperatingSystem.MAC_OS -> {
copy {
from("data") {
include("**/*")
}
into("build/jpackage/openrndr-application.app/data")
}
}
}
}
} }
exclude(listOf("META-INF/*.RSA", "META-INF/*.SF", "META-INF/*.DSA", "**/module-info*"))
archiveFileName.set("application-$openrndrOs.jar")
} }
tasks.create("zipDistribution", Zip::class.java) { tasks.register<Zip>("jpackageZip") {
archiveFileName.set("application-$openrndrOs.zip") archiveFileName.set("openrndr-application-$openrndrOs.zip")
from("./") { from("$buildDir/jpackage") {
include("data/**") include("**/*")
} }
from("$buildDir/libs/application-$openrndrOs.jar") }
}.dependsOn(tasks.jar) tasks.findByName("jpackageZip")?.dependsOn("jpackage")
tasks.create("run", JavaExec::class.java) { runtime {
main = applicationMainClass jpackage {
classpath = sourceSets.main.get().runtimeClasspath imageName = "openrndr-application"
}.dependsOn(tasks.build) skipInstaller = true
if (OperatingSystem.current() == OperatingSystem.MAC_OS) {
jvmArgs.add("-XstartOnFirstThread")
}
}
options.empty()
options.add("--strip-debug")
options.add("--compress")
options.add("1")
options.add("--no-header-files")
options.add("--no-man-pages")
modules.empty()
modules.add("jdk.unsupported")
}

View File

@@ -1,5 +1,5 @@
#Thu Aug 01 12:32:31 CEST 2019 #Thu Aug 01 12:32:31 CEST 2019
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-6.4-all.zip
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

View File

@@ -1,14 +1,12 @@
import org.openrndr.Program
import org.openrndr.application import org.openrndr.application
import org.openrndr.extra.olive.Olive import org.openrndr.color.ColorRGBa
import org.openrndr.extra.olive.oliveProgram
/** /**
* This is a template for a live program. * This is a template for a live program.
* The first you will run this program it will create a script file at src/main/kotlin/live.kts
* This script file can be modified while the program is running.
* *
* Please refer to https://guide.openrndr.org/#/10_OPENRNDR_Extras/C03_Live_coding for more * It uses oliveProgram {} instead of program {}. All code inside the
* instructions on using the live coding environment. * oliveProgram {} can be changed while the program is running.
*/ */
fun main() = application { fun main() = application {
@@ -16,7 +14,9 @@ fun main() = application {
width = 800 width = 800
height = 800 height = 800
} }
program { oliveProgram {
extend(Olive<Program>()) extend {
drawer.clear(ColorRGBa.PINK)
}
} }
} }

View File

@@ -2,10 +2,11 @@ Configuration:
status: warn status: warn
Appenders: Appenders:
Console: Console:
name: Console - name: Console_Info
target: SYSTEM_OUT target: SYSTEM_ERR
PatternLayout: PatternLayout:
Pattern: "%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" 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: "%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
@@ -14,7 +15,7 @@ Configuration:
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: debug level: info
AppenderRef: AppenderRef:
- ref: Console - ref: Console_Info
- ref: File_Appender - ref: File_Appender