-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
build.gradle.kts
79 lines (67 loc) · 2.29 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
import com.android.build.gradle.internal.lint.AndroidLintAnalysisTask
import com.android.build.gradle.internal.lint.AndroidLintTask
plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
}
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
google()
}
}
val isIDE = properties.containsKey("android.injected.invoked.from.ide") ||
(System.getenv("XPC_SERVICE_NAME") ?: "").contains("intellij") ||
System.getenv("IDEA_INITIAL_DIRECTORY") != null
android {
namespace = "com.squareup.okio"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
isCoreLibraryDesugaringEnabled = true
}
kotlinOptions {
freeCompilerArgs += "-Xmulti-platform"
}
compileSdkVersion(33)
defaultConfig {
minSdkVersion(15)
targetSdkVersion(33)
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
// AndroidJUnitRunner wasn't finding tests in multidex artifacts when running on Android 4.0.3.
// Work around by adding all Okio classes to the keep list. That way they'll be in the main
// .dx file where TestRequestBuilder will find them.
multiDexEnabled = true
multiDexKeepProguard = file("multidex-config.pro")
}
if (!isIDE) {
sourceSets {
named("androidTest") {
java.srcDirs(
project.file("../okio-fakefilesystem/src/commonMain/kotlin"),
project.file("../okio/src/commonMain/kotlin"),
project.file("../okio/src/commonTest/java"),
project.file("../okio/src/commonTest/kotlin"),
project.file("../okio/src/hashFunctions/kotlin"),
project.file("../okio/src/jvmMain/kotlin"),
project.file("../okio/src/jvmTest/java"),
project.file("../okio/src/jvmTest/kotlin")
)
}
}
}
}
// https://issuetracker.google.com/issues/325146674
tasks.withType<AndroidLintAnalysisTask> {
onlyIf { false }
}
dependencies {
coreLibraryDesugaring(libs.android.desugar.jdk.libs)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.test.runner)
androidTestImplementation(libs.kotlin.test)
androidTestImplementation(libs.kotlin.time)
androidTestImplementation(libs.test.assertj)
androidTestImplementation(libs.test.junit)
}