Skip to content

Commit

Permalink
[orx-poisson-fill] Fix demos, attempt 2
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinRNDR committed Jan 21, 2022
1 parent 65cc33a commit df1b7ac
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ project.ext {
jsoupVersion = '1.14.3'
kotestVersion = '5.0.1'
junitJupiterVersion = '5.7.1'
slf4jVersion = '1.7.33'
}


Expand Down
22 changes: 13 additions & 9 deletions buildSrc/src/main/kotlin/CollectScreenShots.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {

}
inputChanges.getFileChanges(inputDir).forEach { change ->
println(change)
if (change.fileType == FileType.DIRECTORY) return@forEach
if (change.file.extension == "class" && !(change.file.name.contains("$"))) {
if (change.file.extension == "class") {
val klassName = change.file.nameWithoutExtension
if (klassName.dropLast(2) in ignore.get())
return@forEach
Expand All @@ -59,14 +60,17 @@ abstract class CollectScreenshotsTask @Inject constructor() : DefaultTask() {
val klass = ucl.loadClass(klassName)
println("Collecting screenshot for ${klassName} ${klass}")

val mainMethod = klass.getMethod("main")
println(mainMethod)
project.javaexec {
this.classpath += project.files(inputDir.get().asFile, preloadClass)
this.classpath += runtimeDependencies.get()
this.mainClass.set(klassName)
this.workingDir(project.rootProject.projectDir)
jvmArgs("-DtakeScreenshot=true", "-DscreenshotPath=${outputDir.get().asFile}/$klassName.png")
try {
val mainMethod = klass.getMethod("main")
project.javaexec {
this.classpath += project.files(inputDir.get().asFile, preloadClass)
this.classpath += runtimeDependencies.get()
this.mainClass.set(klassName)
this.workingDir(project.rootProject.projectDir)
jvmArgs("-DtakeScreenshot=true", "-DscreenshotPath=${outputDir.get().asFile}/$klassName.png")
}
} catch (e: NoSuchMethodException) {
// silently ignore
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions orx-jvm/orx-poisson-fill/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sourceSets {

val openrndrVersion: String by rootProject.extra
val openrndrOS: String by rootProject.extra
val slf4jVersion:String by rootProject.extra

val demoImplementation by configurations.getting {}
val demoRuntimeOnly by configurations.getting {}
Expand All @@ -24,6 +25,7 @@ dependencies {
implementation("org.openrndr:openrndr-filter:$openrndrVersion")
demoImplementation("org.openrndr:openrndr-application:$openrndrVersion")
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
demoRuntimeOnly("org.slf4j:slf4j-simple:$slf4jVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
demoImplementation(sourceSets.getByName("main").output)
Expand Down
2 changes: 0 additions & 2 deletions orx-jvm/orx-poisson-fill/src/demo/kotlin/DemoPoissonFill01.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import kotlin.math.sin

fun main() {
data class Thing(val color: ColorRGBa, var pos: Polar, val speed: Polar)


application {
program {
val dry = renderTarget(width, height) {
Expand Down

0 comments on commit df1b7ac

Please sign in to comment.