diff --git a/build.gradle b/build.gradle index b0f964ae..14320510 100644 --- a/build.gradle +++ b/build.gradle @@ -7,16 +7,22 @@ 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.3.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" apply plugin: "org.shipkit.shipkit-github-release" -allprojects { - group = 'org.mockito.kotlin' +def test = tasks.register("test") { + dependsOn gradle.includedBuild("tests").task(":test") +} +tasks.named("check") { + dependsOn test } tasks.named("generateChangelog") { diff --git a/mockito-kotlin/build.gradle b/mockito-kotlin/build.gradle index 3e048e89..b2b547c8 100644 --- a/mockito-kotlin/build.gradle +++ b/mockito-kotlin/build.gradle @@ -5,25 +5,14 @@ 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" - } -} +group = 'org.mockito.kotlin' 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' api "org.mockito:mockito-core:5.7.0" @@ -31,8 +20,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..a2ace7e6 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,15 +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.mockito:mockito-core:5.7.0" + implementation "org.jetbrains.kotlin:kotlin-stdlib" testImplementation 'junit:junit:4.13.2' testImplementation "com.nhaarman:expect.kt:1.0.1" 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 '..'