Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move tests to included build to separate classpaths #502

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
}
}

apply plugin: 'org.gradle.base'
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
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'
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
def test = tasks.register("test") {
dependsOn gradle.includedBuild("tests").task(":test")
}
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
tasks.named("check") {
dependsOn test
}

tasks.named("generateChangelog") {
Expand Down
19 changes: 4 additions & 15 deletions mockito-kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,23 @@ 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"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
compileOnly 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'

api "org.mockito:mockito-core:5.7.0"

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"
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include 'mockito-kotlin'
include 'tests'
includeBuild 'tests'
14 changes: 4 additions & 10 deletions tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -20,15 +19,10 @@ repositories {
mavenCentral()
}

tasks.named('compileTestKotlin') {
dependsOn ':mockito-kotlin:jar'
}
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved

dependencies {
implementation files("${rootProject.projectDir}/mockito-kotlin/build/libs/mockito-kotlin-${version}.jar")
implementation "org.mockito.kotlin:mockito-kotlin"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.mockito:mockito-core:5.7.0"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
implementation "org.jetbrains.kotlin:kotlin-stdlib"
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved

testImplementation 'junit:junit:4.13.2'
testImplementation "com.nhaarman:expect.kt:1.0.1"
Expand Down
1 change: 1 addition & 0 deletions tests/settings.gradle
TWiStErRob marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
includeBuild '..'
TimvdLippe marked this conversation as resolved.
Show resolved Hide resolved
Loading