Skip to content

Commit

Permalink
chore(test): Convert Java -> Kotlin.
Browse files Browse the repository at this point in the history
  • Loading branch information
nstdio committed Mar 31, 2022
1 parent 740de64 commit fa342ae
Show file tree
Hide file tree
Showing 92 changed files with 4,807 additions and 4,807 deletions.
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies {
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
implementation("net.researchgate:gradle-release:2.8.1")
implementation("com.github.dpaukov:combinatoricslib3:3.3.3")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20-RC2")
}

tasks.withType<KotlinCompile> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
plugins {
`java-library`
jacoco
kotlin("jvm")
}

group = "io.github.nstdio"
Expand All @@ -28,6 +29,18 @@ java {
withSourcesJar()
}

configurations
.filter { arrayOf("compileClasspath", "runtimeClasspath").contains(it.name) }
.forEach {
it.exclude("org.jetbrains.kotlin", "kotlin-stdlib-jdk8")
}

sourceSets {
main {
java.srcDirs -= file("src/main/kotlin")
}
}

val lombokVersion = "1.18.22"

dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.configurationcache.extensions.capitalized
import org.gradle.kotlin.dsl.invoke
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.paukov.combinatorics3.Generator
import java.lang.Boolean
import kotlin.String
Expand All @@ -44,6 +45,7 @@ import kotlin.to

plugins {
`java-library`
idea
id("de.jjohannes.extra-java-module-info")
}

Expand All @@ -52,15 +54,20 @@ val isCI = System.getenv("CI").toBoolean()
java {
sourceSets {
create("spiTest") {
compileClasspath += sourceSets.main.get().output
runtimeClasspath += sourceSets.main.get().output
val output = sourceSets.main.get().output
compileClasspath += output
runtimeClasspath += output
}
}
}

val sourceSetsSpiTest by sourceSets.named("spiTest")
val spiTestImplementation by configurations

idea.module {
testSourceDirs.addAll(sourceSetsSpiTest.allSource.srcDirs)
}


mapOf(
"spiTestImplementation" to "testImplementation",
"spiTestRuntimeOnly" to "testRuntimeOnly",
Expand All @@ -80,8 +87,8 @@ tasks.withType<Test> {
}

val junitVersion = "5.8.2"
val commonIoVersion = "1.3.2"
val assertJVersion = "3.22.0"
val mockitoVersion = "4.4.0"
val jsonPathAssertVersion = "2.7.0"
val slf4jVersion = "1.7.36"
val jacksonVersion = "2.13.2"
Expand Down Expand Up @@ -109,15 +116,14 @@ dependencies {
testImplementation("org.assertj:assertj-core:$assertJVersion")
testImplementation("com.jayway.jsonpath:json-path-assert:$jsonPathAssertVersion")

testImplementation("org.apache.commons:commons-io:$commonIoVersion")

/** Jupiter */
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")

testImplementation("org.slf4j:slf4j-simple:$slf4jVersion")

testImplementation("org.awaitility:awaitility:4.2.0")
testImplementation("org.mockito:mockito-core:4.4.0")

testImplementation("com.github.tomakehurst:wiremock-jre8:2.32.0")
testImplementation("com.tngtech.archunit:archunit-junit5:0.23.1")
Expand Down Expand Up @@ -159,6 +165,12 @@ tasks.create<Task>("spiMatrixTest") {
dependsOn(tasks.filter { it.name.startsWith("spiTest") })
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

tasks.check {
dependsOn("spiMatrixTest")
}
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit fa342ae

Please sign in to comment.