-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
58 lines (45 loc) · 1.89 KB
/
build.gradle.kts
File metadata and controls
58 lines (45 loc) · 1.89 KB
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
plugins {
alias(libs.plugins.android.app)
alias(libs.plugins.android.junit)
alias(libs.plugins.kotlin.android)
id("jacoco")
}
android {
namespace = "de.mannodermaus.junit5.sample"
defaultConfig {
applicationId = "de.mannodermaus.junit5.sample"
minSdk = Android.sampleMinSdkVersion
targetSdk = Android.targetSdkVersion
versionCode = 1
versionName = "1.0"
// Make sure to use the AndroidJUnitRunner (or a sub-class) in order to hook in the JUnit 5
// Test Builder
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// These two lines are not needed for a normal integration;
// this sample project disables the automatic integration, so it must be done manually
testInstrumentationRunnerArguments["runnerBuilder"] =
"de.mannodermaus.junit5.AndroidJUnitFrameworkBuilder"
testInstrumentationRunnerArguments["configurationParameters"] =
"junit.jupiter.execution.parallel.enabled=true,junit.jupiter.execution.parallel.mode.default=concurrent"
buildFeatures { buildConfig = true }
buildConfigField("boolean", "MY_VALUE", "true")
testOptions { animationsDisabled = true }
}
}
junitPlatform {
// Configure JUnit 5 tests here
filters("debug") { excludeTags("slow") }
}
replaceAndroidTestLibsWithLocalProjectDependencies()
dependencies {
implementation(libs.kotlin.stdlib)
testImplementation(libs.junit.jupiter.api)
testImplementation(libs.junit.jupiter.params)
testRuntimeOnly(libs.junit.jupiter.engine)
androidTestImplementation(libs.junit.vintage.api)
androidTestImplementation(libs.androidx.test.runner)
// Android Instrumentation Tests wth JUnit 5
androidTestImplementation(libs.junit.jupiter.api)
androidTestImplementation(libs.junit.jupiter.params)
androidTestImplementation(libs.espresso)
}