-
-
Notifications
You must be signed in to change notification settings - Fork 332
/
build.gradle.kts
72 lines (57 loc) · 2.06 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import buildsrc.config.androidClassesDexAttributes
import buildsrc.config.asConsumer
plugins {
buildsrc.convention.`android-library`
buildsrc.convention.`mockk-publishing`
}
description = "Android instrumented testing MockK inline mocking agent"
val mavenName: String by extra("MockK Android Agent")
val mavenDescription: String by extra("${project.description}")
@Suppress("UnstableApiUsage")
android {
externalNativeBuild {
cmake {
path = file("CMakeLists.txt")
}
}
sourceSets {
named("main").configure {
resources {
srcDirs({ packageDispatcherJar.map { it.destinationDirectory } })
}
}
}
defaultConfig {
testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["notAnnotation"] = "io.mockk.test.SkipInstrumentedAndroidTest"
ndk {
abiFilters += setOf("armeabi-v7a", "x86", "x86_64", "arm64-v8a")
}
}
}
val androidClassesDex: Configuration by configurations.creating {
description = "Fetch Android classes.dex files"
asConsumer()
androidClassesDexAttributes()
}
dependencies {
api(projects.modules.mockkAgentApi)
api(projects.modules.mockkAgent)
implementation(kotlin("reflect"))
implementation("com.linkedin.dexmaker:dexmaker:${buildsrc.config.Deps.Versions.dexmaker}")
implementation("org.objenesis:objenesis:${buildsrc.config.Deps.Versions.objenesis}")
androidTestImplementation("androidx.test.espresso:espresso-core:${buildsrc.config.Deps.Versions.androidxEspresso}") {
exclude("com.android.support:support-annotations")
}
androidTestImplementation(kotlin("test"))
androidClassesDex(projects.modules.mockkAgentAndroidDispatcher)
}
val packageDispatcherJar by tasks.registering(Jar::class) {
group = LifecycleBasePlugin.BUILD_GROUP
from(androidClassesDex.asFileTree)
archiveFileName.set("dispatcher.jar")
destinationDirectory.set(temporaryDir)
}
tasks.preBuild {
dependsOn(packageDispatcherJar)
}