-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
127 lines (112 loc) · 4.35 KB
/
build.gradle.kts
File metadata and controls
127 lines (112 loc) · 4.35 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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
import de.mannodermaus.gradle.plugins.junit5.dsl.UnsupportedDeviceBehavior
import okhttp3.buildsupport.androidBuild
plugins {
id("okhttp.base-conventions")
id("com.android.library")
id("de.mannodermaus.android-junit5")
}
android {
compileSdk {
version = release(37)
}
namespace = "okhttp.android.test"
defaultConfig {
minSdk = 21
// 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"
testInstrumentationRunnerArguments += mapOf(
"runnerBuilder" to "de.mannodermaus.junit5.AndroidJUnit5Builder",
"notPackage" to "org.bouncycastle",
"configurationParameters" to "junit.jupiter.extensions.autodetection.enabled=true"
)
}
compileOptions {
targetCompatibility(JavaVersion.VERSION_11)
sourceCompatibility(JavaVersion.VERSION_11)
}
testOptions {
targetSdk = 37
unitTests.isIncludeAndroidResources = true
}
// issue merging due to conflict with httpclient and something else
packagingOptions.resources.excludes += setOf(
"META-INF/DEPENDENCIES",
"META-INF/LICENSE.md",
"META-INF/LICENSE-notice.md",
"README.txt",
"org/bouncycastle/LICENSE",
"META-INF/versions/9/OSGI-INF/MANIFEST.MF"
)
}
if (androidBuild) {
androidComponents {
onVariants(selector().all()) { variant ->
variant.androidTest?.sources?.java?.apply {
addStaticSourceDirectory("../okhttp-brotli/src/test/java")
addStaticSourceDirectory("../okhttp-dnsoverhttps/src/test/java")
addStaticSourceDirectory("../okhttp-logging-interceptor/src/test/java")
addStaticSourceDirectory("../okhttp-sse/src/test/java")
}
}
}
}
dependencies {
implementation(libs.kotlin.reflect)
implementation(libs.playservices.safetynet)
"friendsImplementation"(projects.okhttp)
"friendsImplementation"(projects.okhttpDnsoverhttps)
implementation(libs.androidx.activity)
testImplementation(projects.okhttp)
testImplementation(libs.junit)
testImplementation(libs.junit.ktx)
testImplementation(libs.assertk)
testImplementation(projects.okhttpTls)
"friendsTestImplementation"(projects.loggingInterceptor)
testImplementation(libs.androidx.test.runner)
testImplementation(libs.robolectric)
testImplementation(libs.androidx.espresso.core)
testImplementation(libs.square.okio.fakefilesystem)
testImplementation(projects.okhttpTestingSupport)
testImplementation(libs.conscrypt.openjdk)
testImplementation(libs.junit.jupiter.engine)
testImplementation(libs.junit.vintage.engine)
androidTestImplementation(projects.okhttpTestingSupport) {
exclude("org.openjsse", "openjsse")
exclude("org.conscrypt", "conscrypt-openjdk-uber")
exclude("software.amazon.cryptools", "AmazonCorrettoCryptoProvider")
}
androidTestImplementation(libs.assertk)
androidTestImplementation(libs.bouncycastle.bcprov)
androidTestImplementation(libs.bouncycastle.bctls)
androidTestImplementation(libs.conscrypt.android)
androidTestImplementation(projects.mockwebserver3Junit4)
androidTestImplementation(projects.mockwebserver3Junit5)
androidTestImplementation(projects.okhttpBrotli)
androidTestImplementation(projects.okhttpZstd)
androidTestImplementation(projects.okhttpDnsoverhttps)
androidTestImplementation(projects.loggingInterceptor)
androidTestImplementation(projects.okhttpSse)
androidTestImplementation(projects.okhttpTls)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.http.client5)
androidTestImplementation(libs.kotlin.test.common)
androidTestImplementation(libs.kotlin.test.junit)
androidTestImplementation(libs.square.moshi)
androidTestImplementation(libs.square.moshi.kotlin)
androidTestImplementation(libs.square.okio.fakefilesystem)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.junit.jupiter.api)
androidTestImplementation(libs.junit5android.core)
androidTestRuntimeOnly(libs.junit5android.runner)
}
junitPlatform {
instrumentationTests.behaviorForUnsupportedDevices = UnsupportedDeviceBehavior.Skip
filters {
excludeTags("Remote")
}
}
tasks.withType<Test> {
// Fix for robolectric https://github.com/robolectric/robolectric/pull/10996
jvmArgs("--add-opens", "java.base/jdk.internal.access=ALL-UNNAMED")
}