xref: /aosp_15_r20/external/robolectric/shadows/httpclient/build.gradle.kts (revision e6ba16074e6af37d123cb567d575f496bf0a58ee)

<lambda>null1*e6ba1607SAndroid Build Coastguard Worker plugins {
2*e6ba1607SAndroid Build Coastguard Worker   alias(libs.plugins.robolectric.deployed.java.module)
3*e6ba1607SAndroid Build Coastguard Worker   alias(libs.plugins.robolectric.java.module)
4*e6ba1607SAndroid Build Coastguard Worker   alias(libs.plugins.robolectric.shadows)
5*e6ba1607SAndroid Build Coastguard Worker }
6*e6ba1607SAndroid Build Coastguard Worker 
<lambda>null7*e6ba1607SAndroid Build Coastguard Worker shadows {
8*e6ba1607SAndroid Build Coastguard Worker   packageName = "org.robolectric.shadows.httpclient"
9*e6ba1607SAndroid Build Coastguard Worker   sdkCheckMode = "OFF"
10*e6ba1607SAndroid Build Coastguard Worker }
11*e6ba1607SAndroid Build Coastguard Worker 
12*e6ba1607SAndroid Build Coastguard Worker val earlyRuntime = configurations.create("earlyRuntime")
13*e6ba1607SAndroid Build Coastguard Worker val axtJunitVersion: String by rootProject.extra
14*e6ba1607SAndroid Build Coastguard Worker 
<lambda>null15*e6ba1607SAndroid Build Coastguard Worker dependencies {
16*e6ba1607SAndroid Build Coastguard Worker   api(project(":annotations"))
17*e6ba1607SAndroid Build Coastguard Worker   api(project(":shadowapi"))
18*e6ba1607SAndroid Build Coastguard Worker   api(project(":utils"))
19*e6ba1607SAndroid Build Coastguard Worker 
20*e6ba1607SAndroid Build Coastguard Worker   // We should keep httpclient version for low level API compatibility.
21*e6ba1607SAndroid Build Coastguard Worker   earlyRuntime(libs.apache.http.core)
22*e6ba1607SAndroid Build Coastguard Worker   api(libs.apache.http.client)
23*e6ba1607SAndroid Build Coastguard Worker   compileOnly(AndroidSdk.LOLLIPOP_MR1.coordinates)
24*e6ba1607SAndroid Build Coastguard Worker 
25*e6ba1607SAndroid Build Coastguard Worker   testImplementation(project(":robolectric"))
26*e6ba1607SAndroid Build Coastguard Worker   testImplementation(libs.junit4)
27*e6ba1607SAndroid Build Coastguard Worker   testImplementation(libs.truth)
28*e6ba1607SAndroid Build Coastguard Worker   testImplementation(libs.mockito)
29*e6ba1607SAndroid Build Coastguard Worker   testImplementation("androidx.test.ext:junit:$axtJunitVersion@aar")
30*e6ba1607SAndroid Build Coastguard Worker 
31*e6ba1607SAndroid Build Coastguard Worker   testCompileOnly(AndroidSdk.LOLLIPOP_MR1.coordinates)
32*e6ba1607SAndroid Build Coastguard Worker   testRuntimeOnly(AndroidSdk.S.coordinates)
33*e6ba1607SAndroid Build Coastguard Worker }
34*e6ba1607SAndroid Build Coastguard Worker 
35*e6ba1607SAndroid Build Coastguard Worker // httpcore needs to come before android-all on runtime classpath; the gradle IntelliJ plugin
36*e6ba1607SAndroid Build Coastguard Worker //   needs the compileClasspath order patched too (bug?)
37*e6ba1607SAndroid Build Coastguard Worker val mainSourceSet = sourceSets.getByName("main")
38*e6ba1607SAndroid Build Coastguard Worker 
39*e6ba1607SAndroid Build Coastguard Worker mainSourceSet.compileClasspath = earlyRuntime + mainSourceSet.compileClasspath
40*e6ba1607SAndroid Build Coastguard Worker 
41*e6ba1607SAndroid Build Coastguard Worker mainSourceSet.runtimeClasspath = earlyRuntime + mainSourceSet.runtimeClasspath
42*e6ba1607SAndroid Build Coastguard Worker 
43*e6ba1607SAndroid Build Coastguard Worker val testSourceSet = sourceSets.getByName("test")
44*e6ba1607SAndroid Build Coastguard Worker 
45*e6ba1607SAndroid Build Coastguard Worker testSourceSet.compileClasspath = earlyRuntime + testSourceSet.compileClasspath
46*e6ba1607SAndroid Build Coastguard Worker 
47*e6ba1607SAndroid Build Coastguard Worker testSourceSet.runtimeClasspath = earlyRuntime + testSourceSet.runtimeClasspath
48