Use buildSrc to deduplicate build logic (#262)

This commit is contained in:
Vechro
2022-08-25 12:52:24 +03:00
committed by GitHub
parent 2479f9fe9a
commit f9130d9108
98 changed files with 1091 additions and 1683 deletions

View File

@@ -1,6 +1,5 @@
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
org.openrndr.extra.convention.`kotlin-multiplatform`
}
val embedShaders = tasks.register<EmbedShadersTask>("embedShaders") {
@@ -11,30 +10,12 @@ val embedShaders = tasks.register<EmbedShadersTask>("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)
}
}
}
}
}