diff --git a/build.gradle b/build.gradle index 81f5ae83..018a9c07 100644 --- a/build.gradle +++ b/build.gradle @@ -1,21 +1,11 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -// root build.gradle -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath "org.jetbrains.dokka:dokka-gradle-plugin:0.9.17" - classpath "com.netflix.nebula:nebula-release-plugin:16.0.0" - } +plugins { + alias(libs.plugins.nebula.release) apply false + alias(libs.plugins.gradle.nexus.publish) + id("org.openrndr.extra.convention.dokka") } -plugins { - // remember to update all the versions here when upgrading kotlin version - id 'org.jetbrains.kotlin.jvm' apply false - id 'org.jetbrains.kotlin.multiplatform' apply false - id "io.github.gradle-nexus.publish-plugin" version "1.1.0" +repositories { + mavenCentral() } def multiplatformModules = [ @@ -41,33 +31,7 @@ def multiplatformModules = [ def doNotPublish = ["openrndr-demos"] -apply plugin: 'org.jetbrains.dokka' - -ext.isReleaseVersion = !version.endsWith("SNAPSHOT") - -def openrndrUseSnapshot = isReleaseVersion - -allprojects { - group 'org.openrndr.extra' - repositories { - mavenCentral() - if (openrndrUseSnapshot) { - mavenLocal() - } - maven { - url = "https://maven.openrndr.org" - } - } - -} - -dokka { - moduleName = "$rootProject.name" - outputDirectory = "$buildDir/docs" - outputFormat = "html" - includes = ['Module.md'] - sourceDirs = files(subprojects.collect { p -> new File(p.projectDir, "/src/main/kotlin") }) -} +def isReleaseVersion = !version.endsWith("SNAPSHOT") task buildMainReadme { doFirst { @@ -159,7 +123,6 @@ configure(allprojects.findAll { !doNotPublish.contains(it.name) && (multiplatfor archiveClassifier = "javadoc" } - publishing { publications { matching { it.name == "jvm" }.all { p -> @@ -168,6 +131,11 @@ configure(allprojects.findAll { !doNotPublish.contains(it.name) && (multiplatfor } publications { all { + versionMapping { + allVariants { + fromResolutionOf("allSourceSetsRuntimeDependenciesMetadata") + } + } pom { name = "$project.name" description = "$project.name" @@ -214,20 +182,15 @@ configure(allprojects.findAll { !doNotPublish.contains(it.name) && (multiplatfor required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } sign publishing.publications } - } // publishable && JVM only configure(allprojects.findAll { !doNotPublish.contains(it.name) && !multiplatformModules.contains(it.name) }) { -// apply plugin: 'idea' apply plugin: 'java' - apply plugin: 'kotlin' apply plugin: 'maven-publish' apply plugin: 'nebula.release' apply plugin: 'signing' - def proj = it - println proj java { withJavadocJar() withSourcesJar() @@ -236,6 +199,11 @@ configure(allprojects.findAll { !doNotPublish.contains(it.name) && !multiplatfor publications { maven(MavenPublication) { from components.java + versionMapping { + allVariants { + fromResolutionOf("default") + } + } groupId = "org.openrndr.extra" artifactId = "$project.name" description = "$project.name" @@ -286,37 +254,10 @@ configure(allprojects.findAll { !doNotPublish.contains(it.name) && !multiplatfor required { isReleaseVersion && gradle.taskGraph.hasTask("publish") } sign publishing.publications } - - dependencies { - implementation libs.kotlin.logging - implementation libs.kotlin.coroutines - implementation libs.kotlin.stdlib - implementation libs.openrndr.application - implementation libs.openrndr.math - testImplementation libs.spek.dsl - testImplementation libs.kluent - testImplementation libs.kotlin.test - testRuntimeOnly libs.spek.junit5 - testRuntimeOnly libs.kotlin.reflect - } - - - test { - useJUnitPlatform { - includeEngines 'spek2' - } - } - - javadoc { - options.addBooleanOption 'Xdoclint:none', true - } - - tasks.withType(org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompile).all { - kotlinOptions.freeCompilerArgs += ["-Xuse-experimental=kotlinx.coroutines.InternalCoroutinesApi"] - } } -group = "org.openrndr" +group = "org.openrndr.extra" + nexusPublishing { repositories { sonatype { @@ -331,29 +272,7 @@ nexusPublishing { subprojects { // Equivalent Kotlin is: tasks.register("dependenciesAll") { ... tasks.register("dependenciesAll", DependencyReportTask) { - group = "help" + group = HelpTasksPlugin.HELP_GROUP description = "Displays all dependencies, including subprojects." } - - kotlin { - // https://youtrack.jetbrains.com/issue/KT-43095/Add-support-for-Java-Toolchain-to-the-Gradle-plugin#focus=Comments-27-5192573.0-0 - jvmToolchain { toolchain -> - (toolchain as JavaToolchainSpec).languageVersion.set(JavaLanguageVersion.of(libs.versions.jvmTarget.get())) - } - tasks.withType(KotlinCompile).configureEach { - kotlinOptions.jvmTarget = libs.versions.jvmTarget.get() - kotlinOptions.apiVersion = libs.versions.kotlinApi.get() - } - } -} - - -//configure(allprojects.findAll { it.name != "openrndr-demos" }) { -// apply plugin: 'maven-publish' -// apply plugin: 'nebula.release' -//} - - -//collectScreenshots.dependsOn { -// project.subprojects.findAll { it.sourceSets.hasProperty("demo") }.collect { it.tasks.demoClasses } -//} +} \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 6d632a12..6d71f3d8 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -2,31 +2,31 @@ plugins { `kotlin-dsl` } -sourceSets { - val preload by creating { - this.java { - srcDir("src/preload/kotlin") - } - } - val main by getting -} +val preload: SourceSet by sourceSets.creating repositories { mavenCentral() mavenLocal() - gradlePluginPortal() } -val openrndrVersion = - (findProperty("OPENRNDR.version")?.toString() ?: System.getenv("OPENRNDR_VERSION"))?.replace("v", "") +val openrndrVersion: String = + (extra.properties["OPENRNDR.version"] as String? ?: System.getenv("OPENRNDR_VERSION"))?.removePrefix("v") ?: "0.5.1-SNAPSHOT" +configurations.all { + resolutionStrategy.eachDependency { + if (requested.group == "org.openrndr") useVersion(openrndrVersion) + } +} + dependencies { - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20") - implementation("org.jetbrains.kotlin:kotlin-serialization:1.6.20") - val preloadImplementation by configurations.getting - preloadImplementation("org.openrndr:openrndr-application:$openrndrVersion") - preloadImplementation("org.openrndr:openrndr-extensions:$openrndrVersion") + implementation(libs.kotlin.gradle.plugin) + implementation(libs.dokka.gradle.plugin) + implementation(libs.kotlin.serialization.gradle.plugin) + // https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) + "preloadImplementation"(libs.openrndr.application) + "preloadImplementation"(libs.openrndr.extensions) } tasks.getByName("compileKotlin").dependsOn("compilePreloadKotlin") \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 00000000..fa8bc749 --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,7 @@ +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/FFmpegRule.kt b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/FFmpegRule.kt new file mode 100644 index 00000000..98c477c0 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/FFmpegRule.kt @@ -0,0 +1,44 @@ +package org.openrndr.extra.convention + +import org.gradle.api.artifacts.CacheableRule +import org.gradle.api.artifacts.ComponentMetadataContext +import org.gradle.api.artifacts.ComponentMetadataRule +import org.gradle.api.model.ObjectFactory +import org.gradle.kotlin.dsl.named +import org.gradle.nativeplatform.MachineArchitecture +import org.gradle.nativeplatform.OperatingSystemFamily +import javax.inject.Inject + +@CacheableRule +abstract class FFmpegRule : ComponentMetadataRule { + val jvmNativeVariants: List = listOf( + JvmNativeVariant("linux-arm64", OperatingSystemFamily.LINUX, "arm64"), + JvmNativeVariant("linux-x86_64", OperatingSystemFamily.LINUX, "x86-64"), + JvmNativeVariant("macos-arm64", OperatingSystemFamily.MACOS, "arm64"), + JvmNativeVariant("macos-x86_64", OperatingSystemFamily.MACOS, "x86-64"), + JvmNativeVariant("windows-x86_64", OperatingSystemFamily.WINDOWS, "x86-64") + ) + + @get:Inject + abstract val objects: ObjectFactory + + override fun execute(context: ComponentMetadataContext) = context.details.run { + withVariant("runtime") { + attributes { + attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named("none")) + attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named("none")) + } + } + for ((targetName, os, arch) in jvmNativeVariants) { + addVariant("$targetName-runtime", "runtime") { + attributes { + attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(os)) + attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(arch)) + } + withFiles { + addFile("${id.name}-${id.version}-$targetName.jar") + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/LwjglRule.kt b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/LwjglRule.kt new file mode 100644 index 00000000..554aee59 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/LwjglRule.kt @@ -0,0 +1,46 @@ +package org.openrndr.extra.convention + +import org.gradle.api.artifacts.CacheableRule +import org.gradle.api.artifacts.ComponentMetadataContext +import org.gradle.api.artifacts.ComponentMetadataRule +import org.gradle.api.model.ObjectFactory +import org.gradle.kotlin.dsl.named +import org.gradle.nativeplatform.MachineArchitecture +import org.gradle.nativeplatform.OperatingSystemFamily +import javax.inject.Inject + +@CacheableRule +abstract class LwjglRule : ComponentMetadataRule { + val jvmNativeVariants: List = listOf( + JvmNativeVariant("natives-linux-arm64", OperatingSystemFamily.LINUX, "arm64"), + JvmNativeVariant("natives-linux", OperatingSystemFamily.LINUX, "x86-64"), + JvmNativeVariant("natives-macos-arm64", OperatingSystemFamily.MACOS, "arm64"), + JvmNativeVariant("natives-macos", OperatingSystemFamily.MACOS, "x86-64"), + JvmNativeVariant("natives-windows", OperatingSystemFamily.WINDOWS, "x86-64") + ) + + @get:Inject + abstract val objects: ObjectFactory + + override fun execute(context: ComponentMetadataContext) = context.details.run { + if (id.group != "org.lwjgl") return + if (id.name == "lwjgl-egl") return + withVariant("runtime") { + attributes { + attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named("none")) + attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named("none")) + } + } + for ((targetName, os, arch) in jvmNativeVariants) { + addVariant("$targetName-runtime", "runtime") { + attributes { + attributes.attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(os)) + attributes.attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(arch)) + } + withFiles { + addFile("${id.name}-${id.version}-$targetName.jar") + } + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/Utils.kt b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/Utils.kt new file mode 100644 index 00000000..3677c258 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/Utils.kt @@ -0,0 +1,25 @@ +package org.openrndr.extra.convention + +import org.gradle.api.Project +import org.gradle.kotlin.dsl.get +import org.gradle.kotlin.dsl.named +import org.gradle.nativeplatform.MachineArchitecture +import org.gradle.nativeplatform.OperatingSystemFamily +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform +import org.jetbrains.kotlin.gradle.plugin.KotlinCompilation + +data class JvmNativeVariant(val targetName: String, val os: String, val arch: String) + +val currentOperatingSystemName: String = DefaultNativePlatform.getCurrentOperatingSystem().toFamilyName() +val currentArchitectureName: String = DefaultNativePlatform.getCurrentArchitecture().name + +fun Project.addHostMachineAttributesToRuntimeConfigurations() { + 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)) + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/component-metadata-rule.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/component-metadata-rule.gradle.kts new file mode 100644 index 00000000..3d8a9f74 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/component-metadata-rule.gradle.kts @@ -0,0 +1,21 @@ +package org.openrndr.extra.convention + +addHostMachineAttributesToRuntimeConfigurations() + +val openrndrVersion: String = + (extra.properties["OPENRNDR.version"] as String? ?: System.getenv("OPENRNDR_VERSION"))?.removePrefix("v") + ?: "0.5.1-SNAPSHOT" + +configurations.all { + resolutionStrategy.eachDependency { + if (requested.group == "org.openrndr") useVersion(openrndrVersion) + } +} + +dependencies { + components { + all() + withModule("org.bytedeco:javacpp") + withModule("org.bytedeco:ffmpeg") + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts new file mode 100644 index 00000000..9bce7196 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/dokka.gradle.kts @@ -0,0 +1,37 @@ +package org.openrndr.extra.convention + +import org.jetbrains.dokka.gradle.DokkaTaskPartial +import java.net.URL + +plugins { + id("org.jetbrains.dokka") +} + +repositories { + mavenCentral() +} + +tasks.withType() { + dokkaSourceSets { + configureEach { + skipDeprecated.set(true) + val sourcesDirectory = try { + file("src/$name/kotlin", PathValidation.EXISTS) + } catch (_: InvalidUserDataException) { + return@configureEach + } + // Specifies the location of the project source code on the Web. + // If provided, Dokka generates "source" links for each declaration. + sourceLink { + // Unix based directory relative path to the root of the project (where you execute gradle respectively). + localDirectory.set(sourcesDirectory) + // URL showing where the source code can be accessed through the web browser + remoteUrl.set( + URL("https://github.com/openrndr/orx/blob/master/${moduleName.get()}/src/$name/kotlin") + ) + // Suffix which is used to append the line number to the URL. Use #L for GitHub + remoteLineSuffix.set("#L") + } + } + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts new file mode 100644 index 00000000..49b6b184 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-jvm.gradle.kts @@ -0,0 +1,69 @@ +package org.openrndr.extra.convention + +import org.gradle.accessors.dm.LibrariesForLibs +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.net.URI + +val libs = the() + +plugins { + java + kotlin("jvm") + id("maven-publish") + id("org.openrndr.extra.convention.component-metadata-rule") + id("org.openrndr.extra.convention.dokka") +} + +repositories { + mavenCentral() + maven { + // This is needed to resolve `com.github.ricardomatias:delaunator` + url = URI("https://maven.openrndr.org") + } + mavenLocal() +} + +group = "org.openrndr.extra" + +val main by sourceSets.getting + +@Suppress("UNUSED_VARIABLE") +val demo by sourceSets.creating + +dependencies { + implementation(libs.kotlin.stdlib) + implementation(libs.kotlin.logging) + testImplementation(libs.kotlin.test) + "demoImplementation"(main.output.classesDirs + main.runtimeClasspath) + "demoImplementation"(libs.openrndr.application) + "demoImplementation"(libs.openrndr.extensions) + "demoRuntimeOnly"(libs.openrndr.gl3.core) +} + +kotlin { + jvmToolchain { + this as JavaToolchainSpec + languageVersion.set(JavaLanguageVersion.of(libs.versions.jvmTarget.get())) + } +} + +tasks { + @Suppress("UNUSED_VARIABLE") + val test by getting(Test::class) { + useJUnitPlatform() + testLogging.exceptionFormat = TestExceptionFormat.FULL + } + + @Suppress("UNUSED_VARIABLE") + val javadoc by getting(Javadoc::class) { + options { + this as StandardJavadocDocletOptions + addBooleanOption("Xdoclint:none", true) + } + } + withType() { + kotlinOptions.apiVersion = libs.versions.kotlinApi.get() + kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get() + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts new file mode 100644 index 00000000..6df9a830 --- /dev/null +++ b/buildSrc/src/main/kotlin/org/openrndr/extra/convention/kotlin-multiplatform.gradle.kts @@ -0,0 +1,93 @@ +package org.openrndr.extra.convention + +import org.gradle.accessors.dm.LibrariesForLibs +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import java.net.URI + +val libs = the() + +plugins { + kotlin("multiplatform") + id("maven-publish") + id("org.openrndr.extra.convention.component-metadata-rule") + id("org.openrndr.extra.convention.dokka") +} + +repositories { + mavenCentral() + maven { + // This is needed to resolve `com.github.ricardomatias:delaunator` + url = URI("https://maven.openrndr.org") + } + mavenLocal() +} + +group = "org.openrndr.extra" + +tasks.withType() { + kotlinOptions.apiVersion = libs.versions.kotlinApi.get() + kotlinOptions.languageVersion = libs.versions.kotlinLanguage.get() +} + +kotlin { + jvm { + jvmToolchain { + this as JavaToolchainSpec + languageVersion.set(JavaLanguageVersion.of(libs.versions.jvmTarget.get())) + } + compilations { + val main by getting + @Suppress("UNUSED_VARIABLE") + val demo by creating { + defaultSourceSet { + dependencies { + implementation(main.output.allOutputs) + } + } + } + } + testRuns["test"].executionTask { + useJUnitPlatform() + testLogging.exceptionFormat = TestExceptionFormat.FULL + } + } + + js(IR) { + browser() + nodejs() + } + + sourceSets { + @Suppress("UNUSED_VARIABLE") + val commonMain by getting { + dependencies { + implementation(libs.kotlin.stdlib) + implementation(libs.kotlin.logging) + } + } + + @Suppress("UNUSED_VARIABLE") + val commonTest by getting { + dependencies { + implementation(libs.kotlin.test) + } + } + + @Suppress("UNUSED_VARIABLE") + val jvmTest by getting { + dependencies { + runtimeOnly(libs.bundles.jupiter) + } + } + + @Suppress("UNUSED_VARIABLE") + val jvmDemo by getting { + dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.extensions) + runtimeOnly(libs.openrndr.gl3.core) + } + } + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 24313221..38a20e4d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,16 @@ # suppress inspection "UnusedProperty" for whole file -org.gradle.parallel=true +kotlin.code.style=official +# For optimal compilation performance +org.gradle.jvmargs=-Xmx2G -XX:+UseParallelGC # Enable compatibility with non-hierarchical projects # https://kotlinlang.org/docs/multiplatform-hierarchy.html#for-library-authors kotlin.mpp.enableCompatibilityMetadataVariant=true +kotlin.incremental.multiplatform=true # https://kotlinlang.org/docs/gradle.html#check-for-jvm-target-compatibility-of-related-compile-tasks -kotlin.jvm.target.validation.mode=error \ No newline at end of file +kotlin.jvm.target.validation.mode=error +org.gradle.parallel=true +org.gradle.caching=true +# Whether to automatically bundle the Kotlin standard library (true by default) +# https://kotlinlang.org/docs/gradle.html#dependency-on-the-standard-library +kotlin.stdlib.default.dependency=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..5bad3c88 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,95 @@ +[versions] +kotlinApi = "1.6" +kotlinLanguage = "1.6" +kotlin = "1.6.21" +jvmTarget = "11" +openrndr = "0.0.0" +kotlinxCoroutines = "1.6.4" +kotlinLogging = "2.1.23" +kotlinxSerialization = "1.3.2" +dokka = "1.7.10" +nebulaRelease = "15.3.1" +gradleNexusPublish = "1.1.0" +spek = "2.0.18" +boofcv = "0.40.1" +kluent = "1.68" +junitJupiter = "5.8.2" +slf4j = "1.7.36" +libfreenect = "0.5.7-1.5.7" +librealsense = "2.50.0-1.5.7" +gson = "2.9.0" +antlr = "4.10.1" +tensorflow = "0.4.1" +jarchivelib = "1.2.0" +logbackClassic = "1.2.11" +minim = "2.2.2" +netty = "4.1.79.Final" +rabbitcontrol = "0.3.29" +zxing = "3.5.0" +ktor = "2.0.3" +jgit = "5.12.0.202106070339-r" +javaosc = "0.8" +javaparser = "3.15.21" +delaunator = "1.0.2" + +[libraries] +kotlin-logging = { group = "io.github.microutils", name = "kotlin-logging", version.ref = "kotlinLogging" } +kotlin-coroutines = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core", version.ref = "kotlinxCoroutines" } +kotlin-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" } +kotlin-serialization-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core", version.ref = "kotlinxSerialization" } +kotlin-stdlib = { group = "org.jetbrains.kotlin", name = "kotlin-stdlib", version.ref = "kotlin" } +kotlin-test = { group = "org.jetbrains.kotlin", name = "kotlin-test", version.ref = "kotlin" } +kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" } +kotlin-scriptingJvm = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-jvm", version.ref = "kotlin" } +kotlin-scriptingJvmHost = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-jvm-host", version.ref = "kotlin" } +kotlin-scriptingJSR223 = { group = "org.jetbrains.kotlin", name = "kotlin-scripting-jsr223", version.ref = "kotlin" } +kotlin-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" } +kotlin-serialization-gradle-plugin = { group = "org.jetbrains.kotlin", name = "kotlin-serialization", version.ref = "kotlin" } +dokka-gradle-plugin = { group = "org.jetbrains.dokka", name = "dokka-gradle-plugin", version.ref = "dokka" } + +openrndr-application = { group = "org.openrndr", name = "openrndr-application", version.ref = "openrndr" } +openrndr-extensions = { group = "org.openrndr", name = "openrndr-extensions", version.ref = "openrndr" } +openrndr-math = { group = "org.openrndr", name = "openrndr-math", version.ref = "openrndr" } +openrndr-shape = { group = "org.openrndr", name = "openrndr-shape", version.ref = "openrndr" } +openrndr-draw = { group = "org.openrndr", name = "openrndr-draw", version.ref = "openrndr" } +openrndr-event = { group = "org.openrndr", name = "openrndr-event", version.ref = "openrndr" } +openrndr-filter = { group = "org.openrndr", name = "openrndr-filter", version.ref = "openrndr" } +openrndr-dialogs = { group = "org.openrndr", name = "openrndr-dialogs", version.ref = "openrndr" } +openrndr-ffmpeg = { group = "org.openrndr", name = "openrndr-ffmpeg", version.ref = "openrndr" } +openrndr-svg = { group = "org.openrndr", name = "openrndr-svg", version.ref = "openrndr" } +openrndr-gl3-core = { group = "org.openrndr", name = "openrndr-gl3", version.ref = "openrndr" } + +tensorflow = { group = "org.tensorflow", name = "tensorflow-core-api", version.ref = "tensorflow" } +boofcv = { group = "org.boofcv", name = "boofcv-core", version.ref = "boofcv" } +libfreenect = { group = "org.bytedeco", name = "libfreenect", version.ref = "libfreenect" } +librealsense = { group = "org.bytedeco", name = "librealsense2", version.ref = "librealsense" } +jarchivelib = { group = "org.rauschig", name = "jarchivelib", version.ref = "jarchivelib" } +logback-classic = { group = "ch.qos.logback", name = "logback-classic", version.ref = "logbackClassic" } +minim = { group = "net.compartmental.code", name = "minim", version.ref = "minim" } +netty-all = { group = "io.netty", name = "netty-all", version.ref = "netty" } +rabbitcontrol-rcp = { group = "cc.rabbitcontrol", name = "rcp", version.ref = "rabbitcontrol" } +zxing-core = { group = "com.google.zxing", name = "core", version.ref = "zxing" } +ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" } +ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" } +jgit = { group = "org.eclipse.jgit", name = "org.eclipse.jgit", version.ref = "jgit" } +javaosc-core = { group = "com.illposed.osc", name = "javaosc-core", version.ref = "javaosc" } +javaparser-core = { group = "com.github.javaparser", name = "javaparser-core", version.ref = "javaparser" } +gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } +antlr-core = { group = "org.antlr", name = "antlr4", version.ref = "antlr" } +antlr-runtime = { group = "org.antlr", name = "antlr4-runtime", version.ref = "antlr" } +delaunator = { group = "com.github.ricardomatias", name = "delaunator", version.ref = "delaunator" } + +jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junitJupiter" } +jupiter-engine = { group = "org.junit.jupiter", name = "junit-jupiter-engine", version.ref = "junitJupiter" } +spek-dsl = { group = "org.spekframework.spek2", name = "spek-dsl-jvm", version.ref = "spek" } +spek-junit5 = { group = "org.spekframework.spek2", name = "spek-runner-junit5", version.ref = "spek" } +kluent = { group = "org.amshove.kluent", name = "kluent", version.ref = "kluent" } +slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" } + +[plugins] +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } +nebula-release = { id = "nebula.release", version.ref = "nebulaRelease" } +gradle-nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradleNexusPublish" } + +[bundles] +jupiter = ["jupiter-api", "jupiter-engine"] \ No newline at end of file diff --git a/openrndr-demos/build.gradle b/openrndr-demos/build.gradle deleted file mode 100644 index 5798fec6..00000000 --- a/openrndr-demos/build.gradle +++ /dev/null @@ -1,31 +0,0 @@ -apply plugin: 'java' -apply plugin: 'kotlin' -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - demoImplementation(project(":orx-mesh-generators")) - demoImplementation(project(":orx-camera")) - demoImplementation(project(":orx-parameters")) - demoImplementation(project(":orx-noise")) - demoImplementation(project(":orx-jvm:orx-gui")) - demoImplementation(project(":orx-shader-phrases")) - demoImplementation(libs.slf4j.simple) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoImplementation(libs.openrndr.svg) - - demoRuntimeOnly(libs.openrndr.ffmpeg.natives) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) -} diff --git a/openrndr-demos/build.gradle.kts b/openrndr-demos/build.gradle.kts new file mode 100644 index 00000000..e7f455ba --- /dev/null +++ b/openrndr-demos/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + demoImplementation(project(":orx-mesh-generators")) + demoImplementation(project(":orx-parameters")) + demoImplementation(project(":orx-noise")) + demoImplementation(project(":orx-jvm:orx-gui")) + demoImplementation(project(":orx-shader-phrases")) + demoImplementation(libs.slf4j.simple) + demoImplementation(libs.openrndr.ffmpeg) + demoImplementation(libs.openrndr.svg) +} \ No newline at end of file diff --git a/orx-camera/build.gradle.kts b/orx-camera/build.gradle.kts index 803e4b04..93187500 100644 --- a/orx-camera/build.gradle.kts +++ b/orx-camera/build.gradle.kts @@ -1,81 +1,18 @@ -import EmbedShadersTask - plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { - jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - - implementation(compilations["main"]!!.output.allOutputs) - } - } - } - } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) - } - } - - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) } } } diff --git a/orx-color/build.gradle.kts b/orx-color/build.gradle.kts index 453e1035..72554fd8 100644 --- a/orx-color/build.gradle.kts +++ b/orx-color/build.gradle.kts @@ -1,38 +1,29 @@ import ScreenshotsHelper.collectScreenshots +@Suppress("DSL_SCOPE_VIOLATION") plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` + // kotlinx-serialization ends up on the classpath through openrndr-math and Gradle doesn't know which + // version was used. If openrndr were an included build, we probably wouldn't need to do this. + // https://github.com/gradle/gradle/issues/20084 + id(libs.plugins.kotlin.serialization.get().pluginId) } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - } - dependencies { - implementation(project(":orx-camera")) - implementation(project(":orx-mesh-generators")) - implementation(project(":orx-color")) - implementation(project(":orx-jvm:orx-gui")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - collectScreenshots { } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") + } + collectScreenshots { } + } + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -46,39 +37,33 @@ kotlin { implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } @Suppress("UNUSED_VARIABLE") val commonTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) } } - val jvmMain by getting - @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) implementation(libs.kluent) + implementation(libs.spek.dsl) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } @Suppress("UNUSED_VARIABLE") - val jsTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-camera")) + implementation(project(":orx-mesh-generators")) + implementation(project(":orx-color")) + implementation(project(":orx-jvm:orx-gui")) } } } diff --git a/orx-compositor/build.gradle.kts b/orx-compositor/build.gradle.kts index 765c2187..78fb5ab2 100644 --- a/orx-compositor/build.gradle.kts +++ b/orx-compositor/build.gradle.kts @@ -1,37 +1,19 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-fx")) - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -41,44 +23,26 @@ kotlin { implementation(project(":orx-fx")) implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) implementation(libs.spek.dsl) implementation(libs.kluent) } } @Suppress("UNUSED_VARIABLE") - val jsTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-fx")) } } } diff --git a/orx-compute-graph-nodes/build.gradle.kts b/orx-compute-graph-nodes/build.gradle.kts index 4f284e74..c96e0bae 100644 --- a/orx-compute-graph-nodes/build.gradle.kts +++ b/orx-compute-graph-nodes/build.gradle.kts @@ -1,37 +1,8 @@ -import EmbedShadersTask - plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { - jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - } - } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { @@ -40,42 +11,10 @@ kotlin { implementation(project(":orx-shader-phrases")) implementation(project(":orx-compute-graph")) implementation(project(":orx-image-fit")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) - } - } - - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) } } } diff --git a/orx-compute-graph/build.gradle.kts b/orx-compute-graph/build.gradle.kts index d0092dac..4bc40f08 100644 --- a/orx-compute-graph/build.gradle.kts +++ b/orx-compute-graph/build.gradle.kts @@ -1,72 +1,19 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { - jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } + sourceSets { + all { + languageSettings { + optIn("kotlin.RequiresOptIn") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() - } - - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { api(libs.openrndr.event) implementation(libs.kotlin.coroutines) - implementation(libs.kotlin.logging) - } - } - - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) } } } diff --git a/orx-depth-camera/build.gradle.kts b/orx-depth-camera/build.gradle.kts index 206c42b3..18b852d6 100644 --- a/orx-depth-camera/build.gradle.kts +++ b/orx-depth-camera/build.gradle.kts @@ -1,18 +1,8 @@ plugins { - kotlin("multiplatform") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { - jvm { - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { @@ -22,5 +12,4 @@ kotlin { } } } - -} +} \ No newline at end of file diff --git a/orx-easing/build.gradle.kts b/orx-easing/build.gradle.kts index ab73d194..c16ca93b 100644 --- a/orx-easing/build.gradle.kts +++ b/orx-easing/build.gradle.kts @@ -1,37 +1,19 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(project(":orx-shapes")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -39,42 +21,17 @@ kotlin { val commonMain by getting { dependencies { implementation(project(":orx-parameters")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } @Suppress("UNUSED_VARIABLE") - val commonTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-shapes")) } } } diff --git a/orx-fx/build.gradle.kts b/orx-fx/build.gradle.kts index 25c70d8a..5ceb03a4 100644 --- a/orx-fx/build.gradle.kts +++ b/orx-fx/build.gradle.kts @@ -1,8 +1,7 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } val embedShaders = tasks.register("embedShaders") { @@ -16,33 +15,14 @@ val embedShaders = tasks.register("embedShaders") { kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-color")) - implementation(project(":orx-camera")) - implementation(project(":orx-fx")) - - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -56,49 +36,29 @@ kotlin { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) implementation(project(":orx-color")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) api(shaderKotlin.kotlin) } - } - commonMain.dependsOn(shaderKotlin) - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } + dependsOn(shaderKotlin) } - @Suppress("UNUSED_VARIABLE") - val jvmMain by getting @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) implementation(libs.spek.dsl) implementation(libs.kluent) } } @Suppress("UNUSED_VARIABLE") - val jsMain by getting - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-color")) + implementation(project(":orx-fx")) } } } diff --git a/orx-glslify/build.gradle.kts b/orx-glslify/build.gradle.kts index 0bc5e809..5a5f0cf9 100644 --- a/orx-glslify/build.gradle.kts +++ b/orx-glslify/build.gradle.kts @@ -1,5 +1,21 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) implementation(libs.gson) implementation(libs.jarchivelib) implementation(project(":orx-noise")) + testImplementation(libs.kluent) + testImplementation(libs.spek.dsl) + testRuntimeOnly(libs.spek.junit5) + testRuntimeOnly(libs.kotlin.reflect) } + +tasks.test { + useJUnitPlatform { + includeEngines("spek2") + } +} \ No newline at end of file diff --git a/orx-gradient-descent/build.gradle.kts b/orx-gradient-descent/build.gradle.kts index bba3e7b8..7cb2609a 100644 --- a/orx-gradient-descent/build.gradle.kts +++ b/orx-gradient-descent/build.gradle.kts @@ -1,76 +1,36 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } } - js(IR) { - browser() - nodejs() - } - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(libs.spek.dsl) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } } diff --git a/orx-hash-grid/build.gradle.kts b/orx-hash-grid/build.gradle.kts index bba3e7b8..93187500 100644 --- a/orx-hash-grid/build.gradle.kts +++ b/orx-hash-grid/build.gradle.kts @@ -1,76 +1,18 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { - jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - } - } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() - } - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) - } - } - - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) } } } diff --git a/orx-image-fit/build.gradle.kts b/orx-image-fit/build.gradle.kts index e1125629..15076bd7 100644 --- a/orx-image-fit/build.gradle.kts +++ b/orx-image-fit/build.gradle.kts @@ -1,37 +1,19 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - - } - dependencies { - implementation(project(":orx-shapes")) - implementation(project(":orx-image-fit")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - collectScreenshots { } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -40,42 +22,18 @@ kotlin { dependencies { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } @Suppress("UNUSED_VARIABLE") - val commonTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-shapes")) + implementation(project(":orx-image-fit")) } } } diff --git a/orx-integral-image/build.gradle.kts b/orx-integral-image/build.gradle.kts index a36643e1..adee88e5 100644 --- a/orx-integral-image/build.gradle.kts +++ b/orx-integral-image/build.gradle.kts @@ -1,3 +1,9 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { implementation(project(":orx-fx")) -} + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) +} \ No newline at end of file diff --git a/orx-interval-tree/build.gradle.kts b/orx-interval-tree/build.gradle.kts new file mode 100644 index 00000000..d9e32162 --- /dev/null +++ b/orx-interval-tree/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} \ No newline at end of file diff --git a/orx-jumpflood/build.gradle b/orx-jumpflood/build.gradle deleted file mode 100644 index 6019c6f2..00000000 --- a/orx-jumpflood/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation project(":orx-fx") - implementation project(":orx-parameters") - demoImplementation project(":orx-noise") - demoImplementation project(":orx-jvm:orx-gui") - demoImplementation project(":orx-compositor") - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoImplementation(libs.openrndr.svg) - demoImplementation(libs.openrndr.ffmpeg) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jumpflood/build.gradle.kts b/orx-jumpflood/build.gradle.kts new file mode 100644 index 00000000..da982d22 --- /dev/null +++ b/orx-jumpflood/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(project(":orx-fx")) + implementation(project(":orx-parameters")) + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + demoImplementation(project(":orx-noise")) + demoImplementation(project(":orx-jvm:orx-gui")) + demoImplementation(project(":orx-compositor")) + demoImplementation(libs.openrndr.svg) + demoImplementation(libs.openrndr.ffmpeg) +} \ No newline at end of file diff --git a/orx-jvm/build.gradle.kts b/orx-jvm/build.gradle.kts new file mode 100644 index 00000000..3c33701a --- /dev/null +++ b/orx-jvm/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + org.openrndr.extra.convention.dokka +} \ No newline at end of file diff --git a/orx-jvm/orx-boofcv/build.gradle.kts b/orx-jvm/orx-boofcv/build.gradle.kts index 6cf8be55..8441decd 100644 --- a/orx-jvm/orx-boofcv/build.gradle.kts +++ b/orx-jvm/orx-boofcv/build.gradle.kts @@ -1,25 +1,16 @@ import ScreenshotsHelper.collectScreenshots +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + sourceSets { - val main by getting { } - val demo by creating { - java { - srcDir("src/demo/kotlin") - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } + val demo by getting collectScreenshots(project, demo) { } } -val demoImplementation by configurations.getting {} -val demoRuntimeOnly by configurations.getting {} - dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) api(libs.boofcv) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) } \ No newline at end of file diff --git a/orx-jvm/orx-chataigne/build.gradle b/orx-jvm/orx-chataigne/build.gradle deleted file mode 100644 index 21af4224..00000000 --- a/orx-jvm/orx-chataigne/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} -dependencies { - api project(":orx-jvm:orx-osc") - - implementation libs.gson - demoImplementation(libs.openrndr.application) - - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoRuntimeOnly(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoRuntimeOnly(libs.openrndr.ffmpeg.natives) - - demoImplementation(project(":orx-fx")) -// demoImplementation(project(":orx-osc")) - - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-chataigne/build.gradle.kts b/orx-jvm/orx-chataigne/build.gradle.kts new file mode 100644 index 00000000..085ee7db --- /dev/null +++ b/orx-jvm/orx-chataigne/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + api(project(":orx-jvm:orx-osc")) + implementation(libs.gson) + demoImplementation(libs.openrndr.ffmpeg) + demoImplementation(project(":orx-fx")) +} \ No newline at end of file diff --git a/orx-jvm/orx-depth-camera-calibrator/build.gradle.kts b/orx-jvm/orx-depth-camera-calibrator/build.gradle.kts index fdf14c9b..353d8207 100644 --- a/orx-jvm/orx-depth-camera-calibrator/build.gradle.kts +++ b/orx-jvm/orx-depth-camera-calibrator/build.gradle.kts @@ -1,5 +1,11 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(project(":orx-fx")) api(project(":orx-depth-camera")) api(project(":orx-jvm:orx-gui")) - implementation(project(":orx-fx")) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-dnk3/build.gradle b/orx-jvm/orx-dnk3/build.gradle deleted file mode 100644 index 149daf95..00000000 --- a/orx-jvm/orx-dnk3/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation libs.gson - implementation(project(":orx-fx")) - implementation(project(":orx-jvm:orx-keyframer")) - implementation(project(":orx-easing")) - implementation(project(":orx-shader-phrases")) - implementation(project(":orx-mesh-generators")) - - demoImplementation(project(":orx-camera")) - demoImplementation(project(":orx-mesh-generators")) - demoImplementation(project(":orx-noise")) - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoImplementation(libs.openrndr.filter) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} diff --git a/orx-jvm/orx-dnk3/build.gradle.kts b/orx-jvm/orx-dnk3/build.gradle.kts new file mode 100644 index 00000000..b6613c38 --- /dev/null +++ b/orx-jvm/orx-dnk3/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.gson) + implementation(project(":orx-fx")) + implementation(project(":orx-jvm:orx-keyframer")) + implementation(project(":orx-easing")) + implementation(project(":orx-shader-phrases")) + implementation(project(":orx-mesh-generators")) + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) + demoImplementation(project(":orx-mesh-generators")) + demoImplementation(project(":orx-noise")) + demoImplementation(libs.openrndr.ffmpeg) + demoImplementation(libs.openrndr.filter) +} \ No newline at end of file diff --git a/orx-jvm/orx-file-watcher/build.gradle.kts b/orx-jvm/orx-file-watcher/build.gradle.kts new file mode 100644 index 00000000..a6c4d79d --- /dev/null +++ b/orx-jvm/orx-file-watcher/build.gradle.kts @@ -0,0 +1,15 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +tasks.withType { + kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) +} \ No newline at end of file diff --git a/orx-jvm/orx-git-archiver-gradle/build.gradle.kts b/orx-jvm/orx-git-archiver-gradle/build.gradle.kts index 2b3ee574..b08790d8 100644 --- a/orx-jvm/orx-git-archiver-gradle/build.gradle.kts +++ b/orx-jvm/orx-git-archiver-gradle/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") + org.openrndr.extra.convention.`kotlin-jvm` `java-gradle-plugin` } diff --git a/orx-jvm/orx-git-archiver/build.gradle b/orx-jvm/orx-git-archiver/build.gradle deleted file mode 100644 index e150bf6a..00000000 --- a/orx-jvm/orx-git-archiver/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation(libs.jgit) - - demoImplementation(project(":orx-camera")) - demoImplementation(project(":orx-mesh-generators")) - demoImplementation(project(":orx-noise")) - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoImplementation(libs.openrndr.filter) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} diff --git a/orx-jvm/orx-git-archiver/build.gradle.kts b/orx-jvm/orx-git-archiver/build.gradle.kts new file mode 100644 index 00000000..2bcd1892 --- /dev/null +++ b/orx-jvm/orx-git-archiver/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.jgit) + demoImplementation(project(":orx-mesh-generators")) + demoImplementation(project(":orx-noise")) + demoImplementation(libs.openrndr.ffmpeg) + demoImplementation(libs.openrndr.filter) +} \ No newline at end of file diff --git a/orx-jvm/orx-gui/build.gradle.kts b/orx-jvm/orx-gui/build.gradle.kts index a2529af5..265937ac 100644 --- a/orx-jvm/orx-gui/build.gradle.kts +++ b/orx-jvm/orx-gui/build.gradle.kts @@ -1,33 +1,23 @@ import ScreenshotsHelper.collectScreenshots -sourceSets { - val main by getting { } - val demo by creating { - java { - srcDir("src/demo/kotlin") - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } - collectScreenshots(project, demo) { } +plugins { + org.openrndr.extra.convention.`kotlin-jvm` } -val demoImplementation by configurations.getting {} -val demoRuntimeOnly by configurations.getting {} +sourceSets { + val demo by getting + collectScreenshots(project, demo) { } +} dependencies { api(project(":orx-parameters")) api(project(":orx-jvm:orx-panel")) api(project(":orx-noise")) + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) implementation(libs.openrndr.filter) implementation(libs.openrndr.dialogs) implementation(libs.gson) implementation(libs.kotlin.reflect) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.slf4j.simple) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-keyframer/build.gradle b/orx-jvm/orx-keyframer/build.gradle index ff3ca264..e3fa6a53 100644 --- a/orx-jvm/orx-keyframer/build.gradle +++ b/orx-jvm/orx-keyframer/build.gradle @@ -1,59 +1,43 @@ -//plugins { -// id 'antlr' -//} - -apply plugin: 'antlr' +plugins { + id("org.openrndr.extra.convention.kotlin-jvm") + id("antlr") +} sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } main { java { - srcDir("src/main/java") - srcDir("src/main/kotlin") srcDir("build/generated-src/antlr") } } } - +tasks.test { + useJUnitPlatform { + includeEngines("spek2") + } +} generateGrammarSource { maxHeapSize = "64m" arguments += ["-visitor", "-long-messages"] outputDirectory = file("${project.buildDir}/generated-src/antlr/org/openrndr/extra/keyframer/antlr".toString()) - } dependencies { - antlr(libs.antlr) - implementation(libs.antlrRuntime) + antlr(libs.antlr.core) + implementation(libs.antlr.runtime) implementation(project(":orx-noise")) implementation(project(":orx-easing")) - implementation libs.gson + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.gson) implementation(libs.kotlin.reflect) - - testImplementation(libs.kotlin.test) - - demoImplementation(project(":orx-camera")) + testImplementation(libs.kluent) + testImplementation(libs.spek.dsl) + testRuntimeOnly(libs.spek.junit5) + testRuntimeOnly(libs.kotlin.reflect) demoImplementation(project(":orx-jvm:orx-panel")) - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) } tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") -tasks.getByName("compileTestKotlin").dependsOn("generateTestGrammarSource") - -test { - useJUnitPlatform() -} \ No newline at end of file +tasks.getByName("compileTestKotlin").dependsOn("generateTestGrammarSource") \ No newline at end of file diff --git a/orx-jvm/orx-kinect-common/build.gradle.kts b/orx-jvm/orx-kinect-common/build.gradle.kts index 83fd4f4f..f32630c3 100644 --- a/orx-jvm/orx-kinect-common/build.gradle.kts +++ b/orx-jvm/orx-kinect-common/build.gradle.kts @@ -1,3 +1,8 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { api(project(":orx-depth-camera")) -} + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1-demo/build.gradle.kts b/orx-jvm/orx-kinect-v1-demo/build.gradle.kts index 5ff3ef45..51464ba5 100644 --- a/orx-jvm/orx-kinect-v1-demo/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1-demo/build.gradle.kts @@ -1,10 +1,15 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) implementation(project(":orx-jvm:orx-kinect-v1")) implementation(project(":orx-jvm:orx-depth-camera-calibrator")) implementation(project(":orx-fx")) implementation(project(":orx-jvm:orx-gui")) runtimeOnly(project(":orx-jvm:orx-kinect-v1-${(gradle as ExtensionAware).extra["openrndrClassifier"]}")) runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) runtimeOnly(libs.logback.classic) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1-natives-linux-arm64/build.gradle.kts b/orx-jvm/orx-kinect-v1-natives-linux-arm64/build.gradle.kts index 6cb6dfb3..cd38ca14 100644 --- a/orx-jvm/orx-kinect-v1-natives-linux-arm64/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1-natives-linux-arm64/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.libfreenect) { classifier("linux-arm64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1-natives-linux-x64/build.gradle.kts b/orx-jvm/orx-kinect-v1-natives-linux-x64/build.gradle.kts index 39d3a098..99461916 100644 --- a/orx-jvm/orx-kinect-v1-natives-linux-x64/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1-natives-linux-x64/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.libfreenect) { classifier("linux-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1-natives-macos/build.gradle.kts b/orx-jvm/orx-kinect-v1-natives-macos/build.gradle.kts index bc122e63..1889d3f5 100644 --- a/orx-jvm/orx-kinect-v1-natives-macos/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1-natives-macos/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.libfreenect) { classifier("macosx-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1-natives-windows/build.gradle.kts b/orx-jvm/orx-kinect-v1-natives-windows/build.gradle.kts index a23324bd..05952166 100644 --- a/orx-jvm/orx-kinect-v1-natives-windows/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1-natives-windows/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.libfreenect) { classifier("windows-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kinect-v1/build.gradle.kts b/orx-jvm/orx-kinect-v1/build.gradle.kts index 07ef77b9..41cee592 100644 --- a/orx-jvm/orx-kinect-v1/build.gradle.kts +++ b/orx-jvm/orx-kinect-v1/build.gradle.kts @@ -1,4 +1,11 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) api(project(":orx-jvm:orx-kinect-common")) api(libs.libfreenect) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-kotlin-parser/build.gradle b/orx-jvm/orx-kotlin-parser/build.gradle index 1b874789..7db532ab 100644 --- a/orx-jvm/orx-kotlin-parser/build.gradle +++ b/orx-jvm/orx-kotlin-parser/build.gradle @@ -1,48 +1,25 @@ -//plugins { -// id 'antlr' -//} - -apply plugin: 'antlr' +plugins { + id("org.openrndr.extra.convention.kotlin-jvm") + id("antlr") +} sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } main { java { - srcDir("src/main/java") - srcDir("src/main/kotlin") srcDir("build/generated-src/antlr") } } } - - generateGrammarSource { maxHeapSize = "64m" arguments += ["-visitor", "-long-messages"] outputDirectory = file("${project.buildDir}/generated-src/antlr/org/openrndr/extra/kotlin/antlr".toString()) - } dependencies { - antlr(libs.antlr) - implementation(libs.antlrRuntime) - - demoImplementation(project(":orx-camera")) - demoImplementation(project(":orx-jvm:orx-panel")) - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) + antlr(libs.antlr.core) + implementation(libs.antlr.runtime) } tasks.getByName("compileKotlin").dependsOn("generateGrammarSource") \ No newline at end of file diff --git a/orx-jvm/orx-midi/build.gradle.kts b/orx-jvm/orx-midi/build.gradle.kts new file mode 100644 index 00000000..84b5623f --- /dev/null +++ b/orx-jvm/orx-midi/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) +} \ No newline at end of file diff --git a/orx-jvm/orx-minim/build.gradle.kts b/orx-jvm/orx-minim/build.gradle.kts index eada5288..2feb42fd 100644 --- a/orx-jvm/orx-minim/build.gradle.kts +++ b/orx-jvm/orx-minim/build.gradle.kts @@ -1,30 +1,15 @@ -sourceSets { - val main by getting { } - val demo by creating { - java { - srcDir("src/demo/kotlin") - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } +plugins { + org.openrndr.extra.convention.`kotlin-jvm` } -val demoImplementation by configurations.getting {} -val demoRuntimeOnly by configurations.getting {} - dependencies { api(project(":orx-parameters")) api(project(":orx-jvm:orx-panel")) - api(libs.minim) { exclude(group = "org.apache.maven.plugins", module = "maven-javadoc-plugin") } + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) implementation(libs.kotlin.reflect) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.slf4j.simple) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-olive/build.gradle b/orx-jvm/orx-olive/build.gradle deleted file mode 100644 index 5452d5fb..00000000 --- a/orx-jvm/orx-olive/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation project(":orx-jvm:orx-file-watcher") - implementation project(":orx-jvm:orx-kotlin-parser") - - implementation libs.kotlin.scriptingJvm - implementation libs.kotlin.scriptingJvmHost - implementation libs.kotlin.reflect - implementation libs.kotlin.scriptingJSR223 - - demoImplementation(project(":orx-camera")) - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-olive/build.gradle.kts b/orx-jvm/orx-olive/build.gradle.kts new file mode 100644 index 00000000..c2cede04 --- /dev/null +++ b/orx-jvm/orx-olive/build.gradle.kts @@ -0,0 +1,31 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +tasks.withType { + kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") +} + +tasks.test { + useJUnitPlatform { + includeEngines("spek2") + } +} + +dependencies { + implementation(project(":orx-jvm:orx-file-watcher")) + implementation(project(":orx-jvm:orx-kotlin-parser")) + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.scriptingJvm) + implementation(libs.kotlin.scriptingJvmHost) + implementation(libs.kotlin.reflect) + implementation(libs.kotlin.scriptingJSR223) + implementation(libs.kotlin.coroutines) + testImplementation(libs.kluent) + testImplementation(libs.spek.dsl) + testRuntimeOnly(libs.spek.junit5) + testRuntimeOnly(libs.kotlin.reflect) +} \ No newline at end of file diff --git a/orx-jvm/orx-osc/build.gradle.kts b/orx-jvm/orx-osc/build.gradle.kts index d6a9bf1d..b3b5d2b6 100644 --- a/orx-jvm/orx-osc/build.gradle.kts +++ b/orx-jvm/orx-osc/build.gradle.kts @@ -1,6 +1,10 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { implementation(libs.javaosc.core) { exclude(group = "org.slf4j") exclude(group = "log4j") } -} +} \ No newline at end of file diff --git a/orx-jvm/orx-panel/build.gradle.kts b/orx-jvm/orx-panel/build.gradle.kts index 1fe3fdcf..df7a35c0 100644 --- a/orx-jvm/orx-panel/build.gradle.kts +++ b/orx-jvm/orx-panel/build.gradle.kts @@ -1,27 +1,33 @@ import ScreenshotsHelper.collectScreenshots +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +tasks.withType { + kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") +} + +tasks.test { + useJUnitPlatform { + includeEngines("spek2") + } +} sourceSets { - val main by getting { } - val demo by creating { - java { - srcDir("src/demo/kotlin") - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } + val demo by getting collectScreenshots(project, demo) { } } -val demoImplementation by configurations.getting {} - -val demoRuntimeOnly by configurations.getting {} - dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) implementation(libs.kotlin.reflect) - demoImplementation(libs.openrndr.extensions) + testImplementation(libs.spek.dsl) + testRuntimeOnly(libs.spek.junit5) + testRuntimeOnly(libs.kotlin.reflect) demoImplementation(libs.openrndr.dialogs) demoImplementation(libs.gson) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-poisson-fill/build.gradle.kts b/orx-jvm/orx-poisson-fill/build.gradle.kts index 1aa83565..5f7edf5a 100644 --- a/orx-jvm/orx-poisson-fill/build.gradle.kts +++ b/orx-jvm/orx-poisson-fill/build.gradle.kts @@ -1,28 +1,19 @@ import ScreenshotsHelper.collectScreenshots +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + sourceSets { - val main by getting { } - val demo by creating { - java { - srcDir("src/demo/kotlin") - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } + val demo by getting collectScreenshots(project, demo) { } } -val demoImplementation by configurations.getting {} -val demoRuntimeOnly by configurations.getting {} - dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) implementation(project(":orx-fx")) implementation(project(":orx-noise")) implementation(libs.openrndr.filter) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) demoRuntimeOnly(libs.slf4j.simple) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) } \ No newline at end of file diff --git a/orx-jvm/orx-rabbit-control/build.gradle b/orx-jvm/orx-rabbit-control/build.gradle deleted file mode 100644 index d260a19a..00000000 --- a/orx-jvm/orx-rabbit-control/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation(project(":orx-parameters")) - implementation(project(":orx-compositor")) - implementation(project(":orx-image-fit")) - implementation(project(":orx-fx")) - - implementation(libs.rabbitcontrol.rcp) - implementation(libs.netty.all) - implementation(libs.zxing.core) - implementation(libs.ktor.server.core) - implementation(libs.ktor.server.netty) - - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-rabbit-control/build.gradle.kts b/orx-jvm/orx-rabbit-control/build.gradle.kts new file mode 100644 index 00000000..a37eb34a --- /dev/null +++ b/orx-jvm/orx-rabbit-control/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(project(":orx-parameters")) + implementation(project(":orx-compositor")) + implementation(project(":orx-image-fit")) + implementation(project(":orx-fx")) + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.rabbitcontrol.rcp) + implementation(libs.netty.all) + implementation(libs.zxing.core) + implementation(libs.ktor.server.core) + implementation(libs.ktor.server.netty) +} \ No newline at end of file diff --git a/orx-jvm/orx-realsense2-natives-linux-x64/build.gradle.kts b/orx-jvm/orx-realsense2-natives-linux-x64/build.gradle.kts index eb1f64f4..03b8ede5 100644 --- a/orx-jvm/orx-realsense2-natives-linux-x64/build.gradle.kts +++ b/orx-jvm/orx-realsense2-natives-linux-x64/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.librealsense) { classifier("linux-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-realsense2-natives-macos/build.gradle.kts b/orx-jvm/orx-realsense2-natives-macos/build.gradle.kts index 2e511ec8..6e8f5608 100644 --- a/orx-jvm/orx-realsense2-natives-macos/build.gradle.kts +++ b/orx-jvm/orx-realsense2-natives-macos/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.librealsense) { classifier("macosx-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-realsense2-natives-windows/build.gradle.kts b/orx-jvm/orx-realsense2-natives-windows/build.gradle.kts index b4c32e69..1aa320b6 100644 --- a/orx-jvm/orx-realsense2-natives-windows/build.gradle.kts +++ b/orx-jvm/orx-realsense2-natives-windows/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.librealsense) { classifier("windows-x86_64") }) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-realsense2/build.gradle b/orx-jvm/orx-realsense2/build.gradle deleted file mode 100644 index b6b7b9d0..00000000 --- a/orx-jvm/orx-realsense2/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - api(libs.librealsense) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(project(":orx-jvm:orx-realsense2-${gradle.ext.openrndrClassifier}")) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} diff --git a/orx-jvm/orx-realsense2/build.gradle.kts b/orx-jvm/orx-realsense2/build.gradle.kts new file mode 100644 index 00000000..bc123079 --- /dev/null +++ b/orx-jvm/orx-realsense2/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + api(libs.librealsense) + demoRuntimeOnly(project(":orx-jvm:orx-realsense2-${(gradle as ExtensionAware).extra["openrndrClassifier"]}")) +} \ No newline at end of file diff --git a/orx-jvm/orx-runway/build.gradle b/orx-jvm/orx-runway/build.gradle deleted file mode 100644 index 7b8065d7..00000000 --- a/orx-jvm/orx-runway/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} -dependencies { - implementation(libs.gson) - demoImplementation(libs.openrndr.application) - - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoRuntimeOnly(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoRuntimeOnly(libs.openrndr.ffmpeg.natives) - - demoImplementation(project(":orx-fx")) - - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-runway/build.gradle.kts b/orx-jvm/orx-runway/build.gradle.kts new file mode 100644 index 00000000..d4ebf3ba --- /dev/null +++ b/orx-jvm/orx-runway/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.gson) + demoImplementation(libs.openrndr.ffmpeg) + demoImplementation(project(":orx-fx")) +} \ No newline at end of file diff --git a/orx-jvm/orx-syphon/build.gradle.kts b/orx-jvm/orx-syphon/build.gradle.kts index cb7f2519..525c9fcc 100644 --- a/orx-jvm/orx-syphon/build.gradle.kts +++ b/orx-jvm/orx-syphon/build.gradle.kts @@ -1,5 +1,8 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { implementation(libs.openrndr.application) implementation(libs.openrndr.gl3.core) - implementation(libs.openrndr.gl3.natives) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow-gpu-natives-linux-x64/build.gradle.kts b/orx-jvm/orx-tensorflow-gpu-natives-linux-x64/build.gradle.kts index 8de2ab3b..79b59dcf 100644 --- a/orx-jvm/orx-tensorflow-gpu-natives-linux-x64/build.gradle.kts +++ b/orx-jvm/orx-tensorflow-gpu-natives-linux-x64/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.tensorflow) { classifier("linux-x86_64-gpu") }) } \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow-gpu-natives-windows/build.gradle.kts b/orx-jvm/orx-tensorflow-gpu-natives-windows/build.gradle.kts index 17f4f636..85adcb0c 100644 --- a/orx-jvm/orx-tensorflow-gpu-natives-windows/build.gradle.kts +++ b/orx-jvm/orx-tensorflow-gpu-natives-windows/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.tensorflow) { classifier("windows-x86_64-gpu") }) } \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow-natives-linux-x64/build.gradle.kts b/orx-jvm/orx-tensorflow-natives-linux-x64/build.gradle.kts index ded0db69..7fcedf92 100644 --- a/orx-jvm/orx-tensorflow-natives-linux-x64/build.gradle.kts +++ b/orx-jvm/orx-tensorflow-natives-linux-x64/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.tensorflow) { classifier("linux-x86_64") }) } \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow-natives-macos/build.gradle.kts b/orx-jvm/orx-tensorflow-natives-macos/build.gradle.kts index 16f262a8..3bda1315 100644 --- a/orx-jvm/orx-tensorflow-natives-macos/build.gradle.kts +++ b/orx-jvm/orx-tensorflow-natives-macos/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.tensorflow) { classifier("macosx-x86_64") }) } \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow-natives-windows/build.gradle.kts b/orx-jvm/orx-tensorflow-natives-windows/build.gradle.kts index aa59902e..4b13838c 100644 --- a/orx-jvm/orx-tensorflow-natives-windows/build.gradle.kts +++ b/orx-jvm/orx-tensorflow-natives-windows/build.gradle.kts @@ -1,3 +1,6 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} dependencies { runtimeOnly(variantOf(libs.tensorflow) { classifier("windows-x86_64") }) } \ No newline at end of file diff --git a/orx-jvm/orx-tensorflow/build.gradle b/orx-jvm/orx-tensorflow/build.gradle index dae3fbfd..3b7238d8 100644 --- a/orx-jvm/orx-tensorflow/build.gradle +++ b/orx-jvm/orx-tensorflow/build.gradle @@ -1,11 +1,8 @@ +plugins { + id("org.openrndr.extra.convention.kotlin-jvm") +} + sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } wrapgen { java { srcDirs = ["src/wrapgen/kotlin"] @@ -19,19 +16,13 @@ compileWrapgenKotlin {} dependencies { implementation(libs.gson) - demoImplementation(libs.openrndr.application) - + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) demoRuntimeOnly(project(":orx-jvm:orx-tensorflow-${gradle.ext.openrndrClassifier}")) - - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) demoRuntimeOnly(libs.openrndr.extensions) demoImplementation(libs.openrndr.ffmpeg) - demoRuntimeOnly(libs.openrndr.ffmpeg.natives) demoImplementation(project(":orx-fx")) - demoImplementation(sourceSets.getByName("main").output) api(libs.tensorflow) - // -- wrapgen wrapgenImplementation(libs.javaparser.core) -} +} \ No newline at end of file diff --git a/orx-jvm/orx-triangulation/build.gradle b/orx-jvm/orx-triangulation/build.gradle deleted file mode 100644 index fdf0d730..00000000 --- a/orx-jvm/orx-triangulation/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -def useSnapshot = false -def delaunatorVersion = (useSnapshot) ? "0.4.0-SNAPSHOT" : "1.0.2" - -dependencies { - api project(":orx-noise") - - implementation("com.github.ricardomatias:delaunator:$delaunatorVersion") - - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-triangulation/build.gradle.kts b/orx-jvm/orx-triangulation/build.gradle.kts new file mode 100644 index 00000000..3890419e --- /dev/null +++ b/orx-jvm/orx-triangulation/build.gradle.kts @@ -0,0 +1,10 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + api(project(":orx-noise")) + implementation(libs.openrndr.shape) + implementation(libs.openrndr.math) + implementation(libs.delaunator) +} \ No newline at end of file diff --git a/orx-jvm/orx-video-profiles/build.gradle b/orx-jvm/orx-video-profiles/build.gradle deleted file mode 100644 index ad0490bd..00000000 --- a/orx-jvm/orx-video-profiles/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoImplementation(libs.openrndr.ffmpeg) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - implementation(libs.openrndr.ffmpeg) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-jvm/orx-video-profiles/build.gradle.kts b/orx-jvm/orx-video-profiles/build.gradle.kts new file mode 100644 index 00000000..66e8fa83 --- /dev/null +++ b/orx-jvm/orx-video-profiles/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.ffmpeg) + demoImplementation(libs.openrndr.ffmpeg) +} \ No newline at end of file diff --git a/orx-kdtree/build.gradle b/orx-kdtree/build.gradle deleted file mode 100644 index f32b5b68..00000000 --- a/orx-kdtree/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-kdtree/build.gradle.kts b/orx-kdtree/build.gradle.kts new file mode 100644 index 00000000..a6c4d79d --- /dev/null +++ b/orx-kdtree/build.gradle.kts @@ -0,0 +1,15 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +tasks.withType { + kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlin.RequiresOptIn") +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) +} \ No newline at end of file diff --git a/orx-mesh-generators/build.gradle b/orx-mesh-generators/build.gradle deleted file mode 100644 index 7fa4be0e..00000000 --- a/orx-mesh-generators/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - demoImplementation(project(":orx-camera")) - demoImplementation(project(":orx-shapes")) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-mesh-generators/build.gradle.kts b/orx-mesh-generators/build.gradle.kts new file mode 100644 index 00000000..a051393a --- /dev/null +++ b/orx-mesh-generators/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + demoImplementation(project(":orx-shapes")) +} \ No newline at end of file diff --git a/orx-no-clear/build.gradle.kts b/orx-no-clear/build.gradle.kts index 47695c03..b7ae2131 100644 --- a/orx-no-clear/build.gradle.kts +++ b/orx-no-clear/build.gradle.kts @@ -1,82 +1,27 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } } - js(IR) { - browser() - nodejs() - } - - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.math) implementation(libs.openrndr.shape) implementation(libs.openrndr.draw) } } - - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmMain by getting - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsMain by getting - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) - } - } } -} +} \ No newline at end of file diff --git a/orx-noise/build.gradle.kts b/orx-noise/build.gradle.kts index e49239f6..d7cdc92b 100644 --- a/orx-noise/build.gradle.kts +++ b/orx-noise/build.gradle.kts @@ -1,88 +1,52 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(project(":orx-hash-grid")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") + } + collectScreenshots { } + } + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } } - js(IR) { - browser() - nodejs() - } - - sourceSets { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.math) implementation(libs.openrndr.shape) implementation(libs.openrndr.draw) - implementation(project(":orx-hash-grid")) - } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmMain by getting @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) implementation(libs.spek.dsl) - implementation(libs.kluent) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } @Suppress("UNUSED_VARIABLE") - val jsMain by getting - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-hash-grid")) } } } -} +} \ No newline at end of file diff --git a/orx-obj-loader/build.gradle.kts b/orx-obj-loader/build.gradle.kts new file mode 100644 index 00000000..84b5623f --- /dev/null +++ b/orx-obj-loader/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) +} \ No newline at end of file diff --git a/orx-palette/build.gradle.kts b/orx-palette/build.gradle.kts index d474474d..8ba6e8ea 100644 --- a/orx-palette/build.gradle.kts +++ b/orx-palette/build.gradle.kts @@ -1,5 +1,10 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + dependencies { implementation(libs.gson) implementation(project(":orx-noise")) -} - + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) +} \ No newline at end of file diff --git a/orx-parameters/build.gradle.kts b/orx-parameters/build.gradle.kts index fc362a8c..8c700d19 100644 --- a/orx-parameters/build.gradle.kts +++ b/orx-parameters/build.gradle.kts @@ -1,68 +1,34 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - testRuns["test"].executionTask.configure { - useJUnitPlatform() + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") + } } } - js(IR) { - browser() - nodejs() - } - sourceSets { - val shaderKotlin by creating { - this.kotlin.srcDir("$projectDir/build/generated/shaderKotlin") - } - @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { implementation(libs.openrndr.application) implementation(libs.openrndr.math) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmMain by getting @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsMain by getting - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(libs.spek.dsl) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } } -} +} \ No newline at end of file diff --git a/orx-quadtree/build.gradle.kts b/orx-quadtree/build.gradle.kts index ede9c8d0..13023404 100644 --- a/orx-quadtree/build.gradle.kts +++ b/orx-quadtree/build.gradle.kts @@ -1,38 +1,19 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(project(":orx-noise")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { - - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -41,42 +22,17 @@ kotlin { dependencies { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } @Suppress("UNUSED_VARIABLE") - val commonTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } - - @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-noise")) } } } diff --git a/orx-shade-styles/build.gradle.kts b/orx-shade-styles/build.gradle.kts index fbae726d..c54ba886 100644 --- a/orx-shade-styles/build.gradle.kts +++ b/orx-shade-styles/build.gradle.kts @@ -1,35 +1,19 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-color")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - collectScreenshots { } - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") } + collectScreenshots { } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -39,42 +23,18 @@ kotlin { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) implementation(project(":orx-color")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } @Suppress("UNUSED_VARIABLE") - val jvmTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) - implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-color")) } } } diff --git a/orx-shader-phrases/build.gradle.kts b/orx-shader-phrases/build.gradle.kts index 378ae9cc..b103ce57 100644 --- a/orx-shader-phrases/build.gradle.kts +++ b/orx-shader-phrases/build.gradle.kts @@ -1,6 +1,5 @@ plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } val embedShaders = tasks.register("embedShaders") { @@ -11,30 +10,12 @@ val embedShaders = tasks.register("embedShaders") { kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } } - js(IR) { - browser() - nodejs() - } - sourceSets { val shaderKotlin by creating { this.kotlin.srcDir(embedShaders.outputDir) @@ -43,51 +24,24 @@ kotlin { @Suppress("UNUSED_VARIABLE") val commonMain by getting { dependencies { - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) api(shaderKotlin.kotlin) } - } - commonMain.dependsOn(shaderKotlin) - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } + dependsOn(shaderKotlin) } - @Suppress("UNUSED_VARIABLE") - val jvmMain by getting @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) runtimeOnly(libs.slf4j.simple) - implementation(libs.spek.dsl) implementation(libs.kluent) - } - } - - @Suppress("UNUSED_VARIABLE") - val jsMain by getting - - @Suppress("UNUSED_VARIABLE") - val jsTest by getting { - dependencies { - implementation(kotlin("test-js")) + implementation(libs.spek.dsl) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } } -} - +} \ No newline at end of file diff --git a/orx-shapes/build.gradle.kts b/orx-shapes/build.gradle.kts index 8cdcec2d..22ab7e87 100644 --- a/orx-shapes/build.gradle.kts +++ b/orx-shapes/build.gradle.kts @@ -1,39 +1,24 @@ import ScreenshotsHelper.collectScreenshots plugins { - kotlin("multiplatform") - kotlin("plugin.serialization") + org.openrndr.extra.convention.`kotlin-multiplatform` } kotlin { jvm { - compilations { - val demo by creating { - defaultSourceSet { - kotlin.srcDir("src/demo") - dependencies { - implementation(project(":orx-camera")) - implementation(project(":orx-color")) - implementation(project(":orx-jvm:orx-triangulation")) - implementation(libs.openrndr.application) - implementation(libs.openrndr.extensions) - runtimeOnly(libs.openrndr.gl3.core) - runtimeOnly(libs.openrndr.gl3.natives) - implementation(compilations["main"]!!.output.allOutputs) - } - } - collectScreenshots { - - } + @Suppress("UNUSED_VARIABLE") + val demo by compilations.getting { + // TODO: Move demos to /jvmDemo + defaultSourceSet { + kotlin.srcDir("src/demo/kotlin") + } + collectScreenshots { } + } + testRuns["test"].executionTask { + useJUnitPlatform { + includeEngines("spek2") } } - testRuns["test"].executionTask.configure { - useJUnitPlatform() - } - } - js(IR) { - browser() - nodejs() } sourceSets { @@ -43,12 +28,10 @@ kotlin { implementation(project(":orx-parameters")) implementation(project(":orx-shader-phrases")) implementation(project(":orx-color")) - implementation(libs.kotlin.serialization.core) implementation(libs.openrndr.application) implementation(libs.openrndr.draw) implementation(libs.openrndr.filter) implementation(libs.kotlin.reflect) - implementation(libs.kotlin.logging) } } @@ -59,33 +42,23 @@ kotlin { } } - @Suppress("UNUSED_VARIABLE") - val commonTest by getting { - dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(libs.kotlin.serialization.json) - implementation(libs.kotest) - } - } @Suppress("UNUSED_VARIABLE") val jvmTest by getting { dependencies { - implementation(kotlin("test-common")) - implementation(kotlin("test-annotations-common")) - implementation(kotlin("test-junit5")) - implementation(libs.kotlin.serialization.json) - runtimeOnly(libs.bundles.jupiter) - implementation(libs.spek.dsl) implementation(libs.kluent) + implementation(libs.spek.dsl) + runtimeOnly(libs.spek.junit5) + runtimeOnly(libs.kotlin.reflect) } } @Suppress("UNUSED_VARIABLE") - val jsTest by getting { + val jvmDemo by getting { dependencies { - implementation(kotlin("test-js")) + implementation(project(":orx-camera")) + implementation(project(":orx-color")) + implementation(project(":orx-jvm:orx-triangulation")) } } } diff --git a/orx-temporal-blur/build.gradle b/orx-temporal-blur/build.gradle deleted file mode 100644 index 0eb70577..00000000 --- a/orx-temporal-blur/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation project(":orx-noise") - implementation project(":orx-fx") - implementation(libs.openrndr.filter) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-temporal-blur/build.gradle.kts b/orx-temporal-blur/build.gradle.kts new file mode 100644 index 00000000..51bf95bd --- /dev/null +++ b/orx-temporal-blur/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(project(":orx-noise")) + implementation(project(":orx-fx")) + implementation(libs.openrndr.filter) +} \ No newline at end of file diff --git a/orx-time-operators/build.gradle b/orx-time-operators/build.gradle deleted file mode 100644 index bd35b36c..00000000 --- a/orx-time-operators/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - implementation project(":orx-parameters") - - demoImplementation(project(":orx-camera")) - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-time-operators/build.gradle.kts b/orx-time-operators/build.gradle.kts new file mode 100644 index 00000000..9ef59389 --- /dev/null +++ b/orx-time-operators/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(project(":orx-parameters")) +} \ No newline at end of file diff --git a/orx-timer/build.gradle b/orx-timer/build.gradle deleted file mode 100644 index f32b5b68..00000000 --- a/orx-timer/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} - -dependencies { - demoImplementation(libs.openrndr.application) - demoImplementation(libs.openrndr.extensions) - demoRuntimeOnly(libs.openrndr.gl3.core) - demoRuntimeOnly(libs.openrndr.gl3.natives) - demoImplementation(sourceSets.getByName("main").output) -} \ No newline at end of file diff --git a/orx-timer/build.gradle.kts b/orx-timer/build.gradle.kts new file mode 100644 index 00000000..c0c30fd3 --- /dev/null +++ b/orx-timer/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + org.openrndr.extra.convention.`kotlin-jvm` +} + +dependencies { + implementation(libs.openrndr.application) + implementation(libs.openrndr.math) + implementation(libs.kotlin.coroutines) +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 7e757ba2..bea6ab8c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,103 +13,6 @@ val openrndrClassifier: String by (gradle as ExtensionAware).extra( } ) -val openrndrVersion = - (extra.properties["OPENRNDR.version"] as String? ?: System.getenv("OPENRNDR_VERSION"))?.replace("v", "") - ?: "0.5.1-SNAPSHOT" - -dependencyResolutionManagement { - versionCatalogs { - create("libs") { - version("kotlinApi", "1.6") - version("kotlinLanguage", "1.6") - version("kotlin", "1.6.21") - version("jvmTarget", "11") - version("kotlinxCoroutines", "1.6.4") - version("kotlinLogging", "2.1.23") - version("kotlinxSerialization", "1.3.2") - version("spek", "2.0.18") - version("boofcv", "0.40.1") - version("kluent", "1.68") - version("kotest", "5.3.2") - version("junitJupiter", "5.8.2") - version("slf4j", "1.7.36") - version("openrndr", openrndrVersion) - version("libfreenect", "0.5.7-1.5.7") - version("librealsense", "2.50.0-1.5.7") - version("gson", "2.9.0") - version("antlr", "4.10.1") - version("tensorflow", "0.4.1") - version("jarchivelib", "1.2.0") - version("logbackClassic", "1.2.11") - version("minim", "2.2.2") - version("netty", "4.1.79.Final") - version("rabbitcontrol", "0.3.29") - version("zxing", "3.5.0") - version("ktor", "2.0.3") - version("jgit", "5.12.0.202106070339-r") - version("javaosc", "0.8") - version("javaparser", "3.15.21") - - library("openrndr-application", "org.openrndr", "openrndr-application").versionRef("openrndr") - library("openrndr-extensions", "org.openrndr", "openrndr-extensions").versionRef("openrndr") - library("openrndr-math", "org.openrndr", "openrndr-math").versionRef("openrndr") - library("openrndr-shape", "org.openrndr", "openrndr-shape").versionRef("openrndr") - library("openrndr-draw", "org.openrndr", "openrndr-draw").versionRef("openrndr") - library("openrndr-event", "org.openrndr", "openrndr-event").versionRef("openrndr") - library("openrndr-filter", "org.openrndr", "openrndr-filter").versionRef("openrndr") - library("openrndr-dialogs", "org.openrndr", "openrndr-dialogs").versionRef("openrndr") - library("openrndr-ffmpeg", "org.openrndr", "openrndr-ffmpeg").versionRef("openrndr") - library("openrndr-ffmpeg-natives", "org.openrndr", "openrndr-ffmpeg-$openrndrClassifier").versionRef("openrndr") - library("openrndr-svg", "org.openrndr", "openrndr-svg").versionRef("openrndr") - library("openrndr-gl3-core", "org.openrndr", "openrndr-gl3").versionRef("openrndr") - library("openrndr-gl3-natives", "org.openrndr", "openrndr-gl3-$openrndrClassifier").versionRef("openrndr") - - library("tensorflow", "org.tensorflow", "tensorflow-core-api").versionRef("tensorflow") - library("boofcv", "org.boofcv", "boofcv-core").versionRef("boofcv") - library("libfreenect", "org.bytedeco", "libfreenect").versionRef("libfreenect") - library("librealsense", "org.bytedeco", "librealsense2").versionRef("librealsense") - library("jarchivelib", "org.rauschig", "jarchivelib").versionRef("jarchivelib") - library("logback-classic", "ch.qos.logback", "logback-classic").versionRef("logbackClassic") - library("minim", "net.compartmental.code", "minim").versionRef("minim") - library("netty-all", "io.netty", "netty-all").versionRef("netty") - library("rabbitcontrol-rcp", "cc.rabbitcontrol", "rcp").versionRef("rabbitcontrol") - library("zxing-core", "com.google.zxing", "core").versionRef("zxing") - library("ktor-server-core", "io.ktor", "ktor-server-core").versionRef("ktor") - library("ktor-server-netty", "io.ktor", "ktor-server-netty").versionRef("ktor") - library("jgit", "org.eclipse.jgit", "org.eclipse.jgit").versionRef("jgit") - library("javaosc-core", "com.illposed.osc", "javaosc-core").versionRef("javaosc") - library("javaparser-core", "com.github.javaparser", "javaparser-core").versionRef("javaparser") - - library("kotlin-logging", "io.github.microutils", "kotlin-logging").versionRef("kotlinLogging") - library("kotlin-coroutines", "org.jetbrains.kotlinx", "kotlinx-coroutines-core").versionRef("kotlinxCoroutines") - library("kotlin-serialization-json", "org.jetbrains.kotlinx", "kotlinx-serialization-json").versionRef("kotlinxSerialization") - library("kotlin-serialization-core", "org.jetbrains.kotlinx", "kotlinx-serialization-core").versionRef("kotlinxSerialization") - library("kotlin-stdlib", "org.jetbrains.kotlin", "kotlin-stdlib").versionRef("kotlin") - library("kotlin-test", "org.jetbrains.kotlin", "kotlin-test").versionRef("kotlin") - library("kotlin-reflect", "org.jetbrains.kotlin", "kotlin-reflect").versionRef("kotlin") - library("kotlin-gradlePlugin", "org.jetbrains.kotlin", "kotlin-gradle-plugin").versionRef("kotlin") - library("kotlin-scriptingJvm", "org.jetbrains.kotlin", "kotlin-scripting-jvm").versionRef("kotlin") - library("kotlin-scriptingJvmHost", "org.jetbrains.kotlin", "kotlin-scripting-jvm-host").versionRef("kotlin") - library("kotlin-scriptingJSR223", "org.jetbrains.kotlin", "kotlin-scripting-jsr223").versionRef("kotlin") - - library("spek-dsl", "org.spekframework.spek2", "spek-dsl-jvm").versionRef("spek") - library("spek-junit5", "org.spekframework.spek2", "spek-runner-junit5").versionRef("spek") - - library("jupiter-api", "org.junit.jupiter", "junit-jupiter-api").versionRef("junitJupiter") - library("jupiter-engine", "org.junit.jupiter", "junit-jupiter-engine").versionRef("junitJupiter") - - bundle("jupiter", listOf("jupiter-api", "jupiter-engine")) - - library("kotest", "io.kotest", "kotest-assertions-core").versionRef("kotest") - library("kluent", "org.amshove.kluent", "kluent").versionRef("kluent") - library("slf4j-simple", "org.slf4j", "slf4j-simple").versionRef("slf4j") - library("gson", "com.google.code.gson", "gson").versionRef("gson") - library("antlr", "org.antlr", "antlr4").versionRef("antlr") - library("antlrRuntime", "org.antlr", "antlr4-runtime").versionRef("antlr") - } - } -} - include( listOf( "openrndr-demos", @@ -124,7 +27,6 @@ include( "orx-easing", "orx-jvm:orx-file-watcher", "orx-parameters", - "orx-filter-extension", "orx-fx", "orx-jvm:orx-git-archiver", "orx-jvm:orx-git-archiver-gradle", @@ -182,4 +84,4 @@ include( "orx-depth-camera", "orx-jvm:orx-depth-camera-calibrator" ) -) +) \ No newline at end of file