Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
67 lines (62 loc) · 3.07 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
67 lines (62 loc) · 3.07 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.aboutlibraries) apply false
alias(libs.plugins.aboutlibraries.multiplatform) apply false
alias(libs.plugins.room) apply false
alias(libs.plugins.sentry.gradle) apply false
alias(libs.plugins.android.lint) apply false
alias(libs.plugins.compose.multiplatform) apply false
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.jetbrains.kotlin.jvm) apply false
alias(libs.plugins.build.config) apply false
alias(libs.plugins.osdetector) apply false
alias(libs.plugins.conveyor) apply false
alias(libs.plugins.compose.hotReload) apply false
}
tasks.register<Delete>("Clean") {
delete(rootProject.layout.buildDirectory)
}
subprojects {
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
if (project.findProperty("enableComposeCompilerReports") == "true") {
arrayOf("reports", "metrics").forEach {
freeCompilerArgs.addAll(
listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:${it}Destination=${layout.buildDirectory.asFile.get().absolutePath}/compose_metrics",
),
)
}
}
}
}
// PipePipe and Brave both depend on com.github.TeamNewPipe:nanojson with different commit
// hashes. Gradle's default resolver picks PipePipe's older 1d9e1aea... commit which lacks
// JsonArray.streamAsJsonObjects(), causing NoSuchMethodError when Brave's fallback runs at
// runtime. Force the latest upstream commit (newer than both libs ship) across every module
// so the merged APK/JAR carries a nanojson with the API both extractors expect.
configurations.all {
resolutionStrategy {
force("com.github.TeamNewPipe:nanojson:c7a6c1c08d16b6d5ecded34758e6415e07be2166")
// Kotaml retains Kaml's com.charleskorn.kaml package. Different Maven coordinates
// otherwise let both copies reach DEX. Align root and platform-specific modules.
eachDependency {
if (requested.group == "com.charleskorn.kaml" &&
(requested.name == "kaml" || requested.name.startsWith("kaml-"))
) {
useTarget("io.heapy.kotaml:${requested.name.replaceFirst("kaml", "kotaml")}:${libs.versions.kotaml.get()}")
because("Kotaml and Kaml provide the same classes; use one YAML implementation")
}
}
}
}
}