diff --git a/build.gradle b/build.gradle index 8215cf7d..e6ba09d5 100644 --- a/build.gradle +++ b/build.gradle @@ -23,9 +23,9 @@ def multiplatformModules = [ "orx-parameters", "orx-fx", "orx-easing", - "orx-color" - - + "orx-color", + "orx-image-fit", + "orx-shade-styles" ] project.ext { diff --git a/orx-image-fit/build.gradle.kts b/orx-image-fit/build.gradle.kts new file mode 100644 index 00000000..6e6dff4c --- /dev/null +++ b/orx-image-fit/build.gradle.kts @@ -0,0 +1,96 @@ +import Orx_embed_shaders_gradle.EmbedShadersTask + +plugins { + kotlin("multiplatform") + kotlin("plugin.serialization") + id("orx.embed-shaders") +} + +val kotlinxSerializationVersion: String by rootProject.extra +val kotestVersion: String by rootProject.extra +val junitJupiterVersion: String by rootProject.extra +val jvmTarget: String by rootProject.extra +val kotlinApiVersion: String by rootProject.extra +val kotlinVersion: String by rootProject.extra +val kotlinLoggingVersion: String by rootProject.extra +val kluentVersion: String by rootProject.extra +val openrndrVersion: String by rootProject.extra +val openrndrOS: String by rootProject.extra +val spekVersion: String by rootProject.extra + +kotlin { + jvm { + compilations { + val demo by creating { + defaultSourceSet { + kotlin.srcDir("src/demo") + dependencies { + implementation(project(":orx-camera")) + implementation("org.openrndr:openrndr-application:$openrndrVersion") + implementation("org.openrndr:openrndr-extensions:$openrndrVersion") + runtimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion") + runtimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion") + implementation(compilations["main"]!!.output.allOutputs) + } + } + } + } + compilations.all { + kotlinOptions.jvmTarget = jvmTarget + kotlinOptions.apiVersion = kotlinApiVersion + } + 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("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion") + implementation("org.openrndr:openrndr-application:$openrndrVersion") + implementation("org.openrndr:openrndr-draw:$openrndrVersion") + implementation("org.openrndr:openrndr-filter:$openrndrVersion") + implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") + implementation("io.github.microutils:kotlin-logging:$kotlinLoggingVersion") + } + } + @Suppress("UNUSED_VARIABLE") + val commonTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion") + implementation("io.kotest:kotest-assertions-core:$kotestVersion") + } + } + + @Suppress("UNUSED_VARIABLE") + val jvmTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + implementation(kotlin("test-junit5")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion") + runtimeOnly("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion") + runtimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion") + implementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") + implementation("org.amshove.kluent:kluent:$kluentVersion") + } + } + + @Suppress("UNUSED_VARIABLE") + val jsTest by getting { + dependencies { + implementation(kotlin("test-js")) + } + } + } +} \ No newline at end of file diff --git a/orx-image-fit/src/main/kotlin/ImageFit.kt b/orx-image-fit/src/commonMain/kotlin/ImageFit.kt similarity index 100% rename from orx-image-fit/src/main/kotlin/ImageFit.kt rename to orx-image-fit/src/commonMain/kotlin/ImageFit.kt diff --git a/orx-shade-styles/build.gradle b/orx-shade-styles/build.gradle deleted file mode 100644 index b550d111..00000000 --- a/orx-shade-styles/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -sourceSets { - demo { - java { - srcDirs = ["src/demo/kotlin"] - compileClasspath += main.getCompileClasspath() - runtimeClasspath += main.getRuntimeClasspath() - } - } -} -dependencies { - api project(":orx-parameters") - implementation project(":orx-color") - implementation project(":orx-shader-phrases") - demoImplementation("org.openrndr:openrndr-application:$openrndrVersion") - demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion") - demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion") - demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion") - demoImplementation(sourceSets.getByName("main").output) - -} \ No newline at end of file diff --git a/orx-shade-styles/build.gradle.kts b/orx-shade-styles/build.gradle.kts new file mode 100644 index 00000000..bba10258 --- /dev/null +++ b/orx-shade-styles/build.gradle.kts @@ -0,0 +1,97 @@ +import Orx_embed_shaders_gradle.EmbedShadersTask + +plugins { + kotlin("multiplatform") + kotlin("plugin.serialization") + id("orx.embed-shaders") +} + +val kotlinxSerializationVersion: String by rootProject.extra +val kotestVersion: String by rootProject.extra +val junitJupiterVersion: String by rootProject.extra +val jvmTarget: String by rootProject.extra +val kotlinApiVersion: String by rootProject.extra +val kotlinVersion: String by rootProject.extra +val kotlinLoggingVersion: String by rootProject.extra +val kluentVersion: String by rootProject.extra +val openrndrVersion: String by rootProject.extra +val openrndrOS: String by rootProject.extra +val spekVersion: String by rootProject.extra + +kotlin { + jvm { + compilations { + val demo by creating { + defaultSourceSet { + kotlin.srcDir("src/demo") + dependencies { + implementation(project(":orx-camera")) + implementation("org.openrndr:openrndr-application:$openrndrVersion") + implementation("org.openrndr:openrndr-extensions:$openrndrVersion") + runtimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion") + runtimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion") + implementation(compilations["main"]!!.output.allOutputs) + } + } + } + } + compilations.all { + kotlinOptions.jvmTarget = jvmTarget + kotlinOptions.apiVersion = kotlinApiVersion + } + 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(project(":orx-color")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinxSerializationVersion") + implementation("org.openrndr:openrndr-application:$openrndrVersion") + implementation("org.openrndr:openrndr-draw:$openrndrVersion") + implementation("org.openrndr:openrndr-filter:$openrndrVersion") + implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion") + implementation("io.github.microutils:kotlin-logging:$kotlinLoggingVersion") + } + } + @Suppress("UNUSED_VARIABLE") + val commonTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion") + implementation("io.kotest:kotest-assertions-core:$kotestVersion") + } + } + + @Suppress("UNUSED_VARIABLE") + val jvmTest by getting { + dependencies { + implementation(kotlin("test-common")) + implementation(kotlin("test-annotations-common")) + implementation(kotlin("test-junit5")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationVersion") + runtimeOnly("org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion") + runtimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion") + implementation("org.spekframework.spek2:spek-dsl-jvm:$spekVersion") + implementation("org.amshove.kluent:kluent:$kluentVersion") + } + } + + @Suppress("UNUSED_VARIABLE") + val jsTest by getting { + dependencies { + implementation(kotlin("test-js")) + } + } + } +} \ No newline at end of file diff --git a/orx-shade-styles/src/main/kotlin/AngularGradient.kt b/orx-shade-styles/src/commonMain/kotlin/AngularGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/AngularGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/AngularGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/ColorspaceHelper.kt b/orx-shade-styles/src/commonMain/kotlin/ColorspaceHelper.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/ColorspaceHelper.kt rename to orx-shade-styles/src/commonMain/kotlin/ColorspaceHelper.kt diff --git a/orx-shade-styles/src/main/kotlin/HalfAngularGradient.kt b/orx-shade-styles/src/commonMain/kotlin/HalfAngularGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/HalfAngularGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/HalfAngularGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/LinearGradient.kt b/orx-shade-styles/src/commonMain/kotlin/LinearGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/LinearGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/LinearGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/NPointGradient.kt b/orx-shade-styles/src/commonMain/kotlin/NPointGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/NPointGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/NPointGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/NPointLinearGradient.kt b/orx-shade-styles/src/commonMain/kotlin/NPointLinearGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/NPointLinearGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/NPointLinearGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/NPointRadialGradient.kt b/orx-shade-styles/src/commonMain/kotlin/NPointRadialGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/NPointRadialGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/NPointRadialGradient.kt diff --git a/orx-shade-styles/src/main/kotlin/RadialGradient.kt b/orx-shade-styles/src/commonMain/kotlin/RadialGradient.kt similarity index 100% rename from orx-shade-styles/src/main/kotlin/RadialGradient.kt rename to orx-shade-styles/src/commonMain/kotlin/RadialGradient.kt