xref: /aosp_15_r20/external/okio/android-test/build.gradle.kts (revision f9742813c14b702d71392179818a9e591da8620c)

<lambda>null1 plugins {
2   id("com.android.library")
3   id("org.jetbrains.kotlin.android")
4 }
5 
<lambda>null6 buildscript {
7   repositories {
8     mavenCentral()
9     gradlePluginPortal()
10     google()
11   }
12 }
13 
14 val isIDE = properties.containsKey("android.injected.invoked.from.ide") ||
15   (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij") ||
16   System.getenv("IDEA_INITIAL_DIRECTORY") != null
17 
<lambda>null18 android {
19   compileOptions {
20     sourceCompatibility = JavaVersion.VERSION_1_8
21     targetCompatibility = JavaVersion.VERSION_1_8
22     isCoreLibraryDesugaringEnabled = true
23   }
24 
25   kotlinOptions {
26     freeCompilerArgs += "-Xmulti-platform"
27   }
28 
29   compileSdkVersion(33)
30 
31   defaultConfig {
32     minSdkVersion(15)
33     targetSdkVersion(33)
34     testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
35 
36     // AndroidJUnitRunner wasn't finding tests in multidex artifacts when running on Android 4.0.3.
37     // Work around by adding all Okio classes to the keep list. That way they'll be in the main
38     // .dx file where TestRequestBuilder will find them.
39     multiDexEnabled = true
40     multiDexKeepProguard = file("multidex-config.pro")
41   }
42 
43   if (!isIDE) {
44     sourceSets {
45       named("androidTest") {
46         java.srcDirs(
47           project.file("../okio-fakefilesystem/src/commonMain/kotlin"),
48           project.file("../okio/src/commonMain/kotlin"),
49           project.file("../okio/src/commonTest/java"),
50           project.file("../okio/src/commonTest/kotlin"),
51           project.file("../okio/src/hashFunctions/kotlin"),
52           project.file("../okio/src/jvmMain/kotlin"),
53           project.file("../okio/src/jvmTest/java"),
54           project.file("../okio/src/jvmTest/kotlin")
55         )
56       }
57     }
58   }
59 }
60 
<lambda>null61 dependencies {
62   coreLibraryDesugaring(libs.android.desugar.jdk.libs)
63   androidTestImplementation(libs.androidx.test.ext.junit)
64   androidTestImplementation(libs.androidx.test.runner)
65   androidTestImplementation(libs.kotlin.test)
66   androidTestImplementation(libs.kotlin.time)
67   androidTestImplementation(libs.test.assertj)
68   androidTestImplementation(libs.test.junit)
69 }
70