Repository navigation
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
93 lines (85 loc) · 4.22 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
93 lines (85 loc) · 4.22 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
buildscript {
repositories {
google()
mavenCentral()
gradlePluginPortal()
// JitPack only ever serves its own coordinate namespaces. Without this filter it
// is queried for every artifact, and because it sits ahead of repo.gradle.org a
// transient JitPack timeout fails the build before the tooling API is ever looked
// for where it actually lives.
maven(url = "https://jitpack.io") {
content {
includeGroupByRegex("com\\.github\\..*")
includeGroupByRegex("com\\.gitlab\\..*")
includeGroupByRegex("com\\.bitbucket\\..*")
}
}
maven(url = "https://repo.gradle.org/gradle/libs-releases")
}
dependencies {
// 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.androidx.room) apply false
alias(libs.plugins.screenshot) apply false
alias(libs.plugins.kover)
// KMP modules: shared-core umbrella + libs/* pilots
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
alias(libs.plugins.kmmbridge) apply false
}
// 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`; KMP modules expose `testAndroidHostTest`;
// 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>
@Suppress("UNCHECKED_CAST")
val kmpUnitTestModules = rootProject.extra["flipcash.kmpUnitTestModules"] as List<String>
tasks.register("flipcashTestDebug") {
description = "Run testDebug for all Flipcash modules"
dependsOn(androidUnitTestModules.map { "$it:testDebugUnitTest" })
dependsOn(jvmUnitTestModules.map { "$it:test" })
dependsOn(kmpUnitTestModules.map { "$it:testAndroidHostTest" })
// build-logic's own tests, which cover the analytics catalogue generator.
dependsOn(gradle.includedBuild("build-logic").task(":convention:test"))
// EVENTS.md is generated from events.toml but checked in; fail when someone edits one alone.
dependsOn(":libs:analytics-events:checkAnalyticsEventsPage")
}