Skip to content

Commit

Permalink
Update all Gradle files to mention kotlin.test
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Oct 25, 2023
1 parent e75d31e commit 6a44225
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 129 deletions.
10 changes: 0 additions & 10 deletions arrow-libs/core/arrow-annotations/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,10 @@ apply(from = property("ANIMALSNIFFER_MPP"))
kotlin {
sourceSets {
commonMain {
dependencies {
implementation(libs.kotlin.stdlibCommon)
}
}
jvmMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}
jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
}
}
}

jvm {
Expand Down
20 changes: 6 additions & 14 deletions arrow-libs/core/arrow-atomic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,17 @@ kotlin {
sourceSets {
commonMain {
dependencies {
api(libs.kotlin.stdlibCommon)
api(libs.kotlin.stdlib)
}
}

commonTest {
dependencies {
implementation(projects.arrowFxCoroutines)
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
implementation(libs.coroutines.test)
}
}

jvmMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}

jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
}
}
}
Expand All @@ -63,3 +51,7 @@ tasks.withType<KotlinCompile>().configureEach {
freeCompilerArgs = freeCompilerArgs + "-Xexpect-actual-classes"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
7 changes: 6 additions & 1 deletion arrow-libs/core/arrow-core-retrofit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id(libs.plugins.kotlin.jvm.get().pluginId)
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.arrowGradleConfig.publish)

alias(libs.plugins.kotlinx.serialization) // Needed for testing only
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
Expand All @@ -24,6 +23,8 @@ dependencies {
compileOnly(libs.squareup.retrofit)

testImplementation(projects.arrowCore)
testImplementation(libs.kotlin.test)
testImplementation(libs.coroutines.test)
testImplementation(libs.kotest.frameworkEngine)
testImplementation(libs.kotest.assertionsCore)
testImplementation(libs.kotest.property)
Expand All @@ -41,3 +42,7 @@ tasks.jar {
attributes["Automatic-Module-Name"] = "arrow.core.retrofit"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
9 changes: 7 additions & 2 deletions arrow-libs/core/arrow-core-serialization/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ plugins {
id(libs.plugins.kotlin.multiplatform.get().pluginId)
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.arrowGradleConfig.publish)

alias(libs.plugins.kotest.multiplatform)
id(libs.plugins.kotlinx.serialization.get().pluginId)
}
Expand All @@ -16,14 +15,16 @@ kotlin {
commonMain {
dependencies {
api(projects.arrowCore)
api(libs.kotlin.stdlibCommon)
api(libs.kotlin.stdlib)
api(libs.kotlinx.serializationCore)
}
}

commonTest {
dependencies {
implementation(libs.kotlinx.serializationJson)
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
Expand All @@ -45,3 +46,7 @@ kotlin {
}
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
28 changes: 11 additions & 17 deletions arrow-libs/core/arrow-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,27 @@ kotlin {
dependencies {
api(projects.arrowAtomic)
api(projects.arrowAnnotations)
api(libs.kotlin.stdlibCommon)
api(libs.kotlin.stdlib)
}
}

commonTest {
dependencies {
implementation(projects.arrowFxCoroutines)
implementation(projects.arrowFunctions)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
}

jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}

jvmMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}

jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
}
}
}

jvm {
Expand All @@ -71,3 +61,7 @@ kotlin {
tasks.named<KotlinCompile>("compileTestKotlinJvm") {
kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
}

tasks.withType<Test> {
useJUnitPlatform()
}
28 changes: 11 additions & 17 deletions arrow-libs/core/arrow-functions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,35 +26,25 @@ kotlin {
dependencies {
api(projects.arrowAtomic)
api(projects.arrowAnnotations)
api(libs.kotlin.stdlibCommon)
api(libs.kotlin.stdlib)
}
}
commonTest {
dependencies {
implementation(projects.arrowFxCoroutines)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
}

jvmTest {
dependencies {
runtimeOnly(libs.kotest.runnerJUnit5)
}
}

jvmMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}

jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
}
}
}

jvm {
Expand All @@ -65,3 +55,7 @@ kotlin {
}
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
20 changes: 6 additions & 14 deletions arrow-libs/fx/arrow-fx-coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 +22,18 @@ kotlin {
dependencies {
api(projects.arrowCore)
api(libs.coroutines.core)
implementation(libs.kotlin.stdlibCommon)
implementation(libs.kotlin.stdlib)
}
}

commonTest {
dependencies {
implementation(projects.arrowCore)
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.frameworkEngine)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
implementation(libs.coroutines.test)
}
}

jvmMain {
dependencies {
implementation(libs.kotlin.stdlib)
}
}

jsMain {
dependencies {
implementation(libs.kotlin.stdlibJS)
}
}
}
Expand All @@ -58,3 +46,7 @@ kotlin {
}
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
4 changes: 2 additions & 2 deletions arrow-libs/fx/arrow-fx-stm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ kotlin {
commonTest {
dependencies {
implementation(projects.arrowFxCoroutines)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
implementation(libs.kotlin.test)
implementation(libs.coroutines.test)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
}
}
Expand Down
10 changes: 4 additions & 6 deletions arrow-libs/optics/arrow-optics-ksp-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ dependencies {
implementation(libs.ksp)

testImplementation(libs.kotlin.stdlib)
testImplementation(libs.junitJupiter)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.kotlin.test)
testImplementation(libs.assertj)
testImplementation(libs.classgraph)
testImplementation(libs.kotlinCompileTesting) {
Expand All @@ -45,8 +44,7 @@ dependencies {
testRuntimeOnly(projects.arrowOptics)
}

tasks {
withType<Test>().configureEach {
maxParallelForks = 1
}
tasks.withType<Test> {
maxParallelForks = 1
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.optics.plugin

import org.junit.jupiter.api.Test
import kotlin.test.Test

// from https://kotlinlang.slack.com/archives/C5UPMM0A0/p1688822411819599
// and https://github.com/overfullstack/my-lab/blob/master/arrow/src/test/kotlin/ga/overfullstack/optics/OpticsLab.kt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.optics.plugin

import org.junit.jupiter.api.Test
import kotlin.test.Test

class DSLTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package arrow.optics.plugin

import arrow.optics.plugin.internals.noCompanion
import org.junit.jupiter.api.Test
import kotlin.test.Test

class IsoTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.optics.plugin

import org.junit.jupiter.api.Test
import kotlin.test.Test

class LensTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.optics.plugin

import org.junit.jupiter.api.Test
import kotlin.test.Test

class OptionalTests {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package arrow.optics.plugin

import org.junit.jupiter.api.Test
import kotlin.test.Test

class PrismTests {

Expand Down
10 changes: 6 additions & 4 deletions arrow-libs/optics/arrow-optics-reflect/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ dependencies {
implementation(libs.kotlin.stdlib)

testImplementation(libs.kotlin.stdlib)
testImplementation(libs.junitJupiterEngine)
testImplementation(libs.kotlin.test)
testImplementation(libs.coroutines.test)
testImplementation(libs.kotlin.reflect)

testImplementation(libs.kotest.frameworkEngine)
testImplementation(libs.kotest.assertionsCore)
testImplementation(libs.kotest.property)
testRuntimeOnly(libs.kotest.runnerJUnit5)
}

tasks.jar {
manifest {
attributes["Automatic-Module-Name"] = "arrow.optics.reflect"
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Loading

0 comments on commit 6a44225

Please sign in to comment.