• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 import com.android.build.gradle.internal.lint.AndroidLintAnalysisTask
2 import com.android.build.gradle.internal.lint.AndroidLintTask
3 
<lambda>null4 plugins {
5   id("com.android.library")
6   id("org.jetbrains.kotlin.android")
7 }
8 
<lambda>null9 buildscript {
10   repositories {
11     mavenCentral()
12     gradlePluginPortal()
13     google()
14   }
15 }
16 
17 val isIDE = properties.containsKey("android.injected.invoked.from.ide") ||
18   (System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij") ||
19   System.getenv("IDEA_INITIAL_DIRECTORY") != null
20 
<lambda>null21 android {
22   namespace = "com.squareup.okio"
23 
24   compileOptions {
25     sourceCompatibility = JavaVersion.VERSION_1_8
26     targetCompatibility = JavaVersion.VERSION_1_8
27     isCoreLibraryDesugaringEnabled = true
28   }
29 
30   kotlinOptions {
31     freeCompilerArgs += "-Xmulti-platform"
32   }
33 
34   compileSdkVersion(33)
35 
36   defaultConfig {
37     minSdkVersion(15)
38     targetSdkVersion(33)
39     testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
40 
41     // AndroidJUnitRunner wasn't finding tests in multidex artifacts when running on Android 4.0.3.
42     // Work around by adding all Okio classes to the keep list. That way they'll be in the main
43     // .dx file where TestRequestBuilder will find them.
44     multiDexEnabled = true
45     multiDexKeepProguard = file("multidex-config.pro")
46   }
47 
48   if (!isIDE) {
49     sourceSets {
50       named("androidTest") {
51         java.srcDirs(
52           project.file("../okio-fakefilesystem/src/commonMain/kotlin"),
53           project.file("../okio/src/commonMain/kotlin"),
54           project.file("../okio/src/commonTest/java"),
55           project.file("../okio/src/commonTest/kotlin"),
56           project.file("../okio/src/hashFunctions/kotlin"),
57           project.file("../okio/src/jvmMain/kotlin"),
58           project.file("../okio/src/jvmTest/java"),
59           project.file("../okio/src/jvmTest/kotlin")
60         )
61       }
62     }
63   }
64 }
65 
66 // https://issuetracker.google.com/issues/325146674
<lambda>null67 tasks.withType<AndroidLintAnalysisTask> {
68   onlyIf { false }
69 }
70 
<lambda>null71 dependencies {
72   coreLibraryDesugaring(libs.android.desugar.jdk.libs)
73   androidTestImplementation(libs.androidx.test.ext.junit)
74   androidTestImplementation(libs.androidx.test.runner)
75   androidTestImplementation(libs.kotlin.test)
76   androidTestImplementation(libs.kotlin.time)
77   androidTestImplementation(libs.test.assertj)
78   androidTestImplementation(libs.test.junit)
79 }
80