/
build.gradle
92 lines (75 loc) · 2.57 KB
/
build.gradle
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
plugins {
id("mpp-android")
}
ext {
mavenName = 'MockK Android Agent'
mavenDescription = 'Android instrumented testing MockK inline mocking agent'
}
apply from: "${gradles}/upload.gradle"
def dispatcherApkResPath = file("$buildDir/generated/dispatcher-apk")
def dispatcherDexResPath = file("$buildDir/generated/dispatcher-dex")
def dispatcherJarResPath = file("$buildDir/generated/dispatcher-jar")
def apkReleaseDispatcherPath = new File(project(':mockk-agent-android-dispatcher').buildDir, "outputs/apk/release")
task copyDispatcherApk(type: Copy) {
dependsOn ':mockk-agent-android-dispatcher:assembleRelease'
from apkReleaseDispatcherPath
into dispatcherApkResPath
include '*.apk'
rename { "dispatcher.apk" }
}
task unzipDispatcherApk(type: Copy) {
dependsOn copyDispatcherApk
from zipTree(new File(dispatcherApkResPath, 'dispatcher.apk'))
into dispatcherDexResPath
include '*.dex'
rename { "classes.dex" }
}
task packageDispatcherJar(type: Jar) {
dependsOn unzipDispatcherApk
archiveFileName.set("dispatcher.jar")
destinationDirectory.set(dispatcherJarResPath)
from dispatcherDexResPath
}
preBuild.dependsOn(packageDispatcherJar)
android {
compileSdkVersion 'android-32'
lintOptions {
abortOnError false
disable 'InvalidPackage'
warning 'NewApi'
}
sourceSets {
main.resources.srcDirs += dispatcherJarResPath
main.resources.includes += "**/*.jar"
main.java.srcDirs += 'src/main/kotlin'
}
packagingOptions {
exclude 'META-INF/main.kotlin_module'
}
defaultConfig {
minSdkVersion 26
targetSdkVersion 32
versionName project['version']
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArgument "notAnnotation", "io.mockk.test.SkipInstrumentedAndroidTest"
ndk {
abiFilters "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
}
}
externalNativeBuild {
cmake {
path = 'CMakeLists.txt'
}
}
}
dependencies {
api project(':mockk-agent-api')
api project(':mockk-agent-common')
implementation "com.linkedin.dexmaker:dexmaker:$dexmaker_version"
implementation "org.objenesis:objenesis:$objenesis_android_version"
androidTestImplementation('androidx.test.espresso:espresso-core:3.4.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestImplementation 'junit:junit:4.13.1'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
}