-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
75 lines (67 loc) · 3.17 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
75 lines (67 loc) · 3.17 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
68
69
70
71
72
73
74
75
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
maven(url = "https://jitpack.io")
maven(url = "https://repo.gradle.org/gradle/libs-releases")
}
dependencies {
// plugins that lack standard plugin markers
classpath("com.ahasbini.tools:android-opencv-gradle-plugin:0.1.3-dev")
// needed at configuration time by :libs:emojis build script
classpath(libs.kotlinx.serialization.json)
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.firebase.perf) apply false
alias(libs.plugins.bugsnag.gradle) apply false
alias(libs.plugins.secrets) apply false
alias(libs.plugins.navigation.safeargs) apply false
alias(libs.plugins.protobuf) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.screenshot) apply false
alias(libs.plugins.kover)
}
// NOTE: The per-project `allprojects { }` configuration that used to live here
// (kotlin-stdlib-jdk7 exclusion, serialization/metadata version forcing, and
// disabling stray kapt tasks) has moved to `settings.gradle.kts` as a
// `gradle.lifecycle.beforeProject { }` hook. Isolated Projects forbids the root
// project from configuring other projects, and that hook is its isolated
// replacement.
tasks.register("clean", Delete::class) {
delete(rootProject.layout.buildDirectory)
}
// ---- Coverage aggregation (Kover) ----
// The set of modules whose coverage is merged is computed in `settings.gradle.kts`
// (from the actual included projects) and handed over via this extra property,
// because Isolated Projects forbids the root from discovering them by iterating
// `subprojects`. `kover(project(path))` is just a dependency edge, which IP allows.
@Suppress("UNCHECKED_CAST")
val koverModules = rootProject.extra["flipcash.koverModules"] as List<String>
dependencies {
koverModules.forEach { kover(project(it)) }
}
// ---- Aggregate unit-test task ----
// Replaces a `subprojects { afterEvaluate { rootProject.tasks... } }` wiring that
// Isolated Projects forbids. The module lists come from `settings.gradle.kts`; the
// task depends on each module's test task by *path* — a lazy, cross-project-safe
// dependency that never configures the other project at configuration time.
// Android modules expose `testDebugUnitTest`; pure-JVM modules expose `test`.
@Suppress("UNCHECKED_CAST")
val androidUnitTestModules = rootProject.extra["flipcash.androidUnitTestModules"] as List<String>
@Suppress("UNCHECKED_CAST")
val jvmUnitTestModules = rootProject.extra["flipcash.jvmUnitTestModules"] as List<String>
tasks.register("flipcashTestDebug") {
description = "Run testDebug for all Flipcash modules"
dependsOn(androidUnitTestModules.map { "$it:testDebugUnitTest" })
dependsOn(jvmUnitTestModules.map { "$it:test" })
}