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,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"))
}
}
}
}
}