Skip to content

Commit

Permalink
more build refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
robertfmurdock committed Jul 16, 2023
1 parent 0efaff8 commit 42c02c2
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 143 deletions.
41 changes: 20 additions & 21 deletions libraries/action/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,6 @@ kotlin {
sourceSets.named("jvmMain") {
kotlin.srcDir("build/generated/ksp/jvm/jvmMain/kotlin")
}

}

tasks {
named("jvmTest", Test::class) {
systemProperty("junit.jupiter.extensions.autodetection.enabled", "true")
useJUnitPlatform()
}
"formatKotlinJsMain" {
dependsOn("kspKotlinJs")
}
"formatKotlinJsTest" {
dependsOn("kspTestKotlinJs")
}
"lintKotlinJsMain" {
dependsOn("kspKotlinJs")
}
"lintKotlinJsTest" {
dependsOn("kspTestKotlinJs")
}
}

dependencies {
Expand Down Expand Up @@ -66,4 +46,23 @@ dependencies {
"jvmTestImplementation"("org.slf4j:slf4j-simple")
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-api")
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-engine")
}
}

tasks {
named<Test>("jvmTest") {
systemProperty("junit.jupiter.extensions.autodetection.enabled", "true")
useJUnitPlatform()
}
"formatKotlinJsMain" {
dependsOn("kspKotlinJs")
}
"formatKotlinJsTest" {
dependsOn("kspTestKotlinJs")
}
"lintKotlinJsMain" {
dependsOn("kspKotlinJs")
}
"lintKotlinJsTest" {
dependsOn("kspTestKotlinJs")
}
}
2 changes: 0 additions & 2 deletions libraries/logging/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ plugins {
kotlin("plugin.serialization")
id("com.zegreatrob.coupling.plugins.mp")
}

kotlin {
targets {
jvm()
js { nodejs() }
}
}

dependencies {
commonMainImplementation("org.jetbrains.kotlin:kotlin-stdlib-common")
commonMainImplementation("io.github.microutils:kotlin-logging")
Expand Down
2 changes: 0 additions & 2 deletions libraries/model/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("com.zegreatrob.coupling.plugins.mp")
}

kotlin {
targets {
jvm()
Expand All @@ -11,7 +10,6 @@ kotlin {
}
}
}

dependencies {
commonMainApi(enforcedPlatform(project(":libraries:dependency-bom")))
commonMainApi(kotlin("stdlib"))
Expand Down
1 change: 0 additions & 1 deletion libraries/repository/compound/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ kotlin {
js { nodejs() }
}
}

dependencies {
commonMainApi(project(":libraries:model"))
commonMainApi(project(":libraries:repository:core"))
Expand Down
51 changes: 17 additions & 34 deletions libraries/repository/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,22 @@ kotlin {
useCommonJs()
}
}
}
dependencies {
commonMainApi(project(":libraries:model"))
commonMainApi("org.jetbrains.kotlinx:kotlinx-coroutines-core")

sourceSets {
getByName("commonMain") {
dependencies {
api(project(":libraries:model"))
api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}
}
getByName("commonTest") {
dependencies {
implementation(project(":libraries:test-logging"))
implementation("com.zegreatrob.testmints:standard")
implementation("com.zegreatrob.testmints:minassert")
implementation("org.jetbrains.kotlin:kotlin-test")
}
}
getByName("jvmMain") {
dependencies {
api(kotlin("reflect"))
api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
}
}
getByName("jvmTest") {
dependencies {
implementation(kotlin("reflect"))
implementation("org.junit.jupiter:junit-jupiter-api")
implementation("org.junit.jupiter:junit-jupiter-engine")
}
}
getByName("jsMain") {
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-js")
}
}
}
commonTestImplementation(project(":libraries:test-logging"))
commonTestImplementation("com.zegreatrob.testmints:standard")
commonTestImplementation("com.zegreatrob.testmints:minassert")
commonTestImplementation("org.jetbrains.kotlin:kotlin-test")

"jvmMainApi"(kotlin("reflect"))
"jvmMainApi"("org.jetbrains.kotlinx:kotlinx-coroutines-core")

"jvmTestImplementation"(kotlin("reflect"))
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-api")
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-engine")

"jsMainApi"("org.jetbrains.kotlin:kotlin-stdlib-js")
}
14 changes: 7 additions & 7 deletions libraries/repository/dynamo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ kotlin {
}
}

tasks {
named("jsNodeTest", KotlinJsTest::class) {
dependsOn("composeUp")
environment("LOCAL_DYNAMO", "true")
}
}

dockerCompose {
tcpPortsToIgnoreWhenWaiting.set(listOf(5555))
setProjectName("Coupling-root")
Expand Down Expand Up @@ -55,3 +48,10 @@ dependencies {
jsTestImplementation("org.jetbrains.kotlin:kotlin-test-annotations-common")
jsTestImplementation("org.jetbrains.kotlin:kotlin-test-js")
}

tasks {
named("jsNodeTest", KotlinJsTest::class) {
dependsOn("composeUp")
environment("LOCAL_DYNAMO", "true")
}
}
62 changes: 20 additions & 42 deletions libraries/repository/memory/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,47 +9,25 @@ kotlin {
useCommonJs()
}
}
}

sourceSets {
getByName("commonMain") {
dependencies {
implementation(project(":libraries:model"))
implementation(project(":libraries:repository:core"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("com.benasher44:uuid")
}
}
getByName("commonTest") {
dependencies {
implementation(project(":libraries:test-logging"))
implementation(project(":libraries:repository:validation"))
implementation("com.zegreatrob.testmints:standard")
implementation("com.zegreatrob.testmints:minassert")
implementation("org.jetbrains.kotlin:kotlin-test")
}
}
getByName("jvmMain") {
dependencies {
api(kotlin("reflect"))
}
}
getByName("jvmTest") {
dependencies {
implementation(kotlin("reflect"))
implementation("org.junit.jupiter:junit-jupiter-api")
implementation("org.junit.jupiter:junit-jupiter-engine")
}
}
dependencies {
commonMainImplementation(project(":libraries:model"))
commonMainImplementation(project(":libraries:repository:core"))
commonMainImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
commonMainImplementation("com.benasher44:uuid")

getByName("jsMain") {
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-js")
}
}
getByName("jsTest") {
dependencies {
implementation("com.zegreatrob.testmints:async")
}
}
}
}
commonTestImplementation(project(":libraries:test-logging"))
commonTestImplementation(project(":libraries:repository:validation"))
commonTestImplementation("com.zegreatrob.testmints:standard")
commonTestImplementation("com.zegreatrob.testmints:minassert")
commonTestImplementation("org.jetbrains.kotlin:kotlin-test")

"jvmMainApi"(kotlin("reflect"))

"jvmTestImplementation"(kotlin("reflect"))
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-api")
"jvmTestImplementation"("org.junit.jupiter:junit-jupiter-engine")

"jsTestImplementation"("com.zegreatrob.testmints:async")
}
43 changes: 15 additions & 28 deletions libraries/repository/validation/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,20 @@ kotlin {
useCommonJs()
}
}
}

sourceSets {
getByName("commonMain") {
dependencies {
api(project(":libraries:repository:core"))
api(project(":libraries:test-logging"))
api(project(":libraries:stub-model"))
api("org.jetbrains.kotlinx:kotlinx-datetime")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core")
api("org.jetbrains.kotlin:kotlin-test")
api("com.zegreatrob.testmints:standard")
api("com.zegreatrob.testmints:async")
api("com.zegreatrob.testmints:minassert")
}
}
dependencies {
commonMainApi(project(":libraries:repository:core"))
commonMainApi(project(":libraries:test-logging"))
commonMainApi(project(":libraries:stub-model"))
commonMainApi("org.jetbrains.kotlinx:kotlinx-datetime")
commonMainApi("org.jetbrains.kotlinx:kotlinx-coroutines-core")
commonMainApi("org.jetbrains.kotlin:kotlin-test")
commonMainApi("com.zegreatrob.testmints:standard")
commonMainApi("com.zegreatrob.testmints:async")
commonMainApi("com.zegreatrob.testmints:minassert")

getByName("jvmMain") {
dependencies {
api(kotlin("reflect"))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlin:kotlin-test-junit")
}
}
getByName("jsMain") {
dependencies {
api("org.jetbrains.kotlin:kotlin-stdlib-js")
}
}
}
}
"jvmMainApi"(kotlin("reflect"))
"jvmMainImplementation"(kotlin("reflect"))
"jvmMainImplementation"("org.jetbrains.kotlin:kotlin-test-junit")
}
3 changes: 0 additions & 3 deletions server/action/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import org.jmailen.gradle.kotlinter.tasks.FormatTask
import org.jmailen.gradle.kotlinter.tasks.LintTask

plugins {
id("com.zegreatrob.coupling.plugins.mp")
id("com.zegreatrob.testmints.action-mint")
Expand Down
6 changes: 3 additions & 3 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ tasks {
stage
)
}
register("serverlessBuild", NodeExec::class) {
register<NodeExec>("serverlessBuild") {
configureBuild("prod")
}
register("serverlessBuildSandbox", NodeExec::class) {
register<NodeExec>("serverlessBuildSandbox") {
configureBuild("sandbox")
}
register("serverlessBuildPrerelease", NodeExec::class) {
register<NodeExec>("serverlessBuildPrerelease") {
configureBuild("prerelease")
}
}
Expand Down

0 comments on commit 42c02c2

Please sign in to comment.