diff --git a/build.gradle b/build.gradle index b2494245..63994644 100644 --- a/build.gradle +++ b/build.gradle @@ -7,9 +7,12 @@ buildscript { classpath "org.shipkit:shipkit-changelog:1.2.0" classpath "org.shipkit:shipkit-auto-version:1.2.2" classpath "io.github.gradle-nexus:publish-plugin:1.0.0" + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20" + classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.9.10" } } +apply plugin: 'org.gradle.base' apply plugin: "io.github.gradle-nexus.publish-plugin" apply plugin: 'org.shipkit.shipkit-auto-version' apply plugin: "org.shipkit.shipkit-changelog" @@ -19,6 +22,13 @@ allprojects { group = 'org.mockito.kotlin' } +def test = tasks.register("test") { + dependsOn gradle.includedBuild("tests").task(":test") +} +tasks.named("check") { + dependsOn test +} + tasks.named("generateChangelog") { previousRevision = project.ext.'shipkit-auto-version.previous-version' githubToken = System.getenv("GITHUB_TOKEN") diff --git a/mockito-kotlin/build.gradle b/mockito-kotlin/build.gradle index 9b38018c..7fd8fff6 100644 --- a/mockito-kotlin/build.gradle +++ b/mockito-kotlin/build.gradle @@ -5,25 +5,12 @@ apply plugin: 'kotlin' apply from: '../gradle/publishing.gradle' apply plugin: 'org.jetbrains.dokka' -buildscript { - ext.kotlin_version = "1.9.20" - - repositories { - mavenCentral() - } - - dependencies { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.9.10" - } -} - repositories { mavenCentral() } dependencies { - compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + compileOnly "org.jetbrains.kotlin:kotlin-stdlib" compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0' implementation "org.mockito:mockito-core:5.7.0" @@ -31,8 +18,8 @@ dependencies { testImplementation 'junit:junit:4.13.2' testImplementation 'com.nhaarman:expect.kt:1.0.1' - testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version" + testImplementation "org.jetbrains.kotlin:kotlin-stdlib" + testImplementation "org.jetbrains.kotlin:kotlin-test" testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0' testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0" diff --git a/settings.gradle b/settings.gradle index 5086f47a..5bbc1461 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ include 'mockito-kotlin' -include 'tests' \ No newline at end of file +includeBuild 'tests' diff --git a/tests/build.gradle b/tests/build.gradle index 5e05cf4e..f6665b2a 100644 --- a/tests/build.gradle +++ b/tests/build.gradle @@ -2,13 +2,12 @@ import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile buildscript { - ext.kotlin_version = System.getenv("KOTLIN_VERSION") ?: '1.9.20' - println "$project uses Kotlin $kotlin_version" - repositories { mavenCentral() } dependencies { + def kotlin_version = System.getenv("KOTLIN_VERSION") ?: '1.9.20' + println "$project uses Kotlin $kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -20,14 +19,10 @@ repositories { mavenCentral() } -tasks.named('compileTestKotlin') { - dependsOn ':mockito-kotlin:jar' -} - dependencies { - implementation files("${rootProject.projectDir}/mockito-kotlin/build/libs/mockito-kotlin-${version}.jar") + implementation "org.mockito.kotlin:mockito-kotlin" - implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib" implementation "org.mockito:mockito-core:5.7.0" testImplementation 'junit:junit:4.13.2' diff --git a/tests/settings.gradle b/tests/settings.gradle new file mode 100644 index 00000000..53785818 --- /dev/null +++ b/tests/settings.gradle @@ -0,0 +1 @@ +includeBuild '..'