-
-
Notifications
You must be signed in to change notification settings - Fork 48
/
Copy pathbuild.gradle.kts
111 lines (102 loc) · 3.47 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
plugins {
id ("com.android.application")
kotlin("android")
id ("com.osacky.fladle")
}
android {
namespace = "com.osacky.flank.gradle.sample.kotlin"
compileSdk = 33
defaultConfig {
applicationId = "com.osacky.flank.gradle.sample.kotlin"
minSdk = 23
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
testOptions.execution = "ANDROIDX_TEST_ORCHESTRATOR"
flavorDimensions += "flavor"
productFlavors {
create("chocolate") {
dimension = "flavor"
}
create("vanilla") {
dimension = "flavor"
}
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}
androidComponents {
beforeVariants(selector().withName("vanilla")) { variantBuilder ->
variantBuilder.enable = false
}
}
fladle {
flankVersion.set("23.10.1")
variant.set("chocolateDebug")
debugApk.set(provider { layout.buildDirectory.file("/outputs/apk/chocolate/debug/*.apk").get().toString()})
serviceAccountCredentials.set(project.layout.projectDirectory.file("flank-gradle-5cf02dc90531.json"))
// Project Id is not needed if serviceAccountCredentials are set.
// projectId("flank-gradle")
useOrchestrator.set(true)
environmentVariables.set(project.provider { mapOf("clearPackageData" to "true") })
testTargets.set(project.provider { listOf(
"class com.osacky.flank.gradle.sample.ExampleInstrumentedTest#seeView"
) })
devices.set(project.provider { listOf(
mapOf("model" to "Pixel2", "version" to "26" ),
mapOf("model" to "Nexus5", "version" to "23" )
) })
smartFlankGcsPath.set("gs://test-lab-yr9w6qsdvy45q-iurp80dm95h8a/flank/test_app_android.xml")
configs {
create("oranges") {
useOrchestrator.set(false)
testTargets.set(project.provider { listOf(
"class com.osacky.flank.gradle.sample.ExampleInstrumentedTest#runAndFail"
) })
flakyTestAttempts.set(3)
}
create("additionalTests") {
additionalTestApks.value(project.provider { listOf(
"app: ../main/app/build/output/apk/debug/app.apk",
"test: ../main/app/build/output/apk/androidTest/debug/app-test.apk",
"app: ../sample/app/build/output/apk/debug/sample-app.apk",
"test: ../sample/app/build/output/apk/androidTest/debug/sample-app-test.apk",
"test: ../feature/room/build/output/apk/androidTest/debug/feature-room-test.apk",
"test: ../library/databases/build/output/apk/androidTest/debug/sample-databases-test.apk"
)})
}
}
flakyTestAttempts.set(1)
dependOnAssemble.set(true)
}
fulladleModuleConfig {
maxTestShards.set(24)
clientDetails.set(
mapOf(
"key1" to "val1"
)
)
environmentVariables.set(
mapOf(
"clearPackageData" to "true"
)
)
debugApk.set("${rootProject.file("dummy_app.apk")}")
}
dependencies {
implementation(libs.appcompat)
implementation(libs.navigation.fragment.ktx)
implementation(libs.constraintlayout)
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.espresso.core)
}