Add collectScreenshots task to kotlin-jvm convention

This commit is contained in:
Edwin Jakobs
2023-04-04 20:50:41 +02:00
parent 3cef8d202a
commit 5fe2d30f80
6 changed files with 6 additions and 52 deletions

View File

@@ -1,9 +1,9 @@
package org.openrndr.extra.convention package org.openrndr.extra.convention
import ScreenshotsHelper.collectScreenshots
import org.gradle.accessors.dm.LibrariesForLibs import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.net.URI
val libs = the<LibrariesForLibs>() val libs = the<LibrariesForLibs>()
@@ -33,7 +33,11 @@ group = "org.openrndr.extra"
val main: SourceSet by sourceSets.getting val main: SourceSet by sourceSets.getting
@Suppress("UNUSED_VARIABLE") @Suppress("UNUSED_VARIABLE")
val demo: SourceSet by sourceSets.creating val demo: SourceSet by sourceSets.creating {
if (name != "openrndr-demos") {
collectScreenshots(project, this@creating) { }
}
}
dependencies { dependencies {
implementation(libs.kotlin.stdlib) implementation(libs.kotlin.stdlib)

View File

@@ -1,25 +0,0 @@
import org.openrndr.animatable.Animatable
import org.openrndr.animatable.easing.Easing
import org.openrndr.application
import org.openrndr.math.Vector2
import org.openrndr.shape.contour
fun main() = application {
program {
val a = object {
var x = 0.0
}
animate {
updateAnimation()
a::x.animate(1000.0, 5000, Easing.CubicInOut)
a::x.complete()
a::x.animate(0.0, 5000, Easing.CubicInOut)
}
extend {
drawer.circle(a.x, height/2.0, 40.0)
}
}
}

View File

@@ -1,14 +1,7 @@
import ScreenshotsHelper.collectScreenshots
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` org.openrndr.extra.convention.`kotlin-jvm`
} }
sourceSets {
val demo by getting
collectScreenshots(project, demo) { }
}
dependencies { dependencies {
implementation(libs.openrndr.application) implementation(libs.openrndr.application)
implementation(libs.openrndr.math) implementation(libs.openrndr.math)

View File

@@ -4,11 +4,6 @@ plugins {
org.openrndr.extra.convention.`kotlin-jvm` org.openrndr.extra.convention.`kotlin-jvm`
} }
sourceSets {
val demo by getting
collectScreenshots(project, demo) { }
}
dependencies { dependencies {
api(project(":orx-parameters")) api(project(":orx-parameters"))
api(project(":orx-jvm:orx-panel")) api(project(":orx-jvm:orx-panel"))

View File

@@ -1,4 +1,3 @@
import ScreenshotsHelper.collectScreenshots
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { plugins {
@@ -15,11 +14,6 @@ tasks.test {
} }
} }
sourceSets {
val demo by getting
collectScreenshots(project, demo) { }
}
dependencies { dependencies {
implementation(libs.openrndr.application) implementation(libs.openrndr.application)
implementation(libs.openrndr.math) implementation(libs.openrndr.math)

View File

@@ -1,14 +1,7 @@
import ScreenshotsHelper.collectScreenshots
plugins { plugins {
org.openrndr.extra.convention.`kotlin-jvm` org.openrndr.extra.convention.`kotlin-jvm`
} }
sourceSets {
val demo by getting
collectScreenshots(project, demo) { }
}
dependencies { dependencies {
implementation(libs.openrndr.application) implementation(libs.openrndr.application)
implementation(libs.openrndr.math) implementation(libs.openrndr.math)