Skip to content

Commit

Permalink
Convert to Kotlin
Browse files Browse the repository at this point in the history
  • Loading branch information
Raibaz committed Jan 13, 2022
1 parent 531202c commit 6d20a71
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 70 deletions.
70 changes: 0 additions & 70 deletions mockk/android/build.gradle

This file was deleted.

74 changes: 74 additions & 0 deletions mockk/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import io.mockk.dependencies.Deps
import io.mockk.dependencies.kotlinVersion

plugins {
id("mpp-android")
}

extra["mavenName"] = "MockK Android"
extra["mavenDescription"] = "mocking library for Kotlin (Android instrumented test)"

apply(from = "${rootProject.extensions.extraProperties["gradles"]}/upload.gradle")

android {
compileSdkVersion("android-31")


lintOptions {
isAbortOnError = false
disable("InvalidPackage")
warning("NewApi")
}

packagingOptions {
exclude("META-INF/main.kotlin_module")
exclude("META-INF/LICENSE.md")
exclude("META-INF/LICENSE-notice.md")
}

defaultConfig {
minSdk = 21
targetSdk = 31
versionName = "${project.version}"
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments
testInstrumentationRunnerArguments["notAnnotation"] = "io.mockk.test.SkipInstrumentedAndroidTest"
}

sourceSets {
getByName("androidTest").assets.srcDirs("$projectDir/common/src/test/kotlin")
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

}

// very weird hack to make it working in IDE (check settings.gradle)
val mockKProject = findProject(":mockk-jvm")?.project ?: project(":mockk")

dependencies {
api(project(":${mockKProject.name}")) {
exclude(group = "io.mockk", module = "mockk-agent-jvm")
}
implementation(project(":mockk-agent-android"))
implementation(project(":mockk-agent-api"))

testImplementation("junit:junit:4.13.1")
androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2") {
exclude(group = "com.android.support", module = "support-annotations")
}
androidTestImplementation(Deps.Libs.kotlinReflect(kotlinVersion()))
androidTestImplementation(Deps.Libs.kotlinCoroutinesCore())
androidTestImplementation(Deps.Libs.kotlinTestJunit()) {
exclude(group = "junit", module = "junit")
}
androidTestImplementation("com.android.support.test:rules:1.0.2")

androidTestImplementation(Deps.Libs.junitJupiterApi)
androidTestImplementation(Deps.Libs.junitJupiterEngine)
androidTestImplementation(Deps.Libs.junitVintageEngine)
}

0 comments on commit 6d20a71

Please sign in to comment.