-
Notifications
You must be signed in to change notification settings - Fork 61
/
build.gradle.kts
141 lines (130 loc) · 4.51 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
import com.android.Version
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
buildscript {
repositories {
google()
mavenCentral()
maven(url = "https://jitpack.io")
}
dependencies {
classpath(libs.plugin.android)
classpath(libs.plugin.kotlin)
}
}
plugins {
id("appyx-collect-sarif")
id("com.autonomousapps.dependency-analysis") version libs.versions.dependencyAnalysis.get()
id("release-dependencies-diff-compare")
id("release-dependencies-diff-create") apply false
alias(libs.plugins.compose.compiler) apply false
}
dependencyAnalysis {
issues {
all {
onIncorrectConfiguration {
severity("fail")
}
onUnusedDependencies {
severity("fail")
exclude(
// Needed for compose '@Preview'. The annotation is actually within
// androidx.compose.ui:ui-tooling-preview, hence the need to exclude.
"androidx.compose.ui:ui-tooling",
"androidx.test.ext:junit",
// This is used to add the testing activity to the debug manifest
// However since not code is referenced, it is raised as unused.
":libraries:testing-ui-activity",
":libraries:testing-ui"
)
}
onRuntimeOnly {
exclude("org.jetbrains.kotlinx:kotlinx-coroutines-android")
}
}
project(":libraries:interop-ribs") {
onAny {
severity("ignore")
}
}
project(":samples:app") {
onAny {
severity("ignore")
}
}
project(":samples:navigation-compose") {
onAny {
severity("ignore")
}
}
project(":samples:sandbox") {
onAny {
severity("ignore")
}
}
project(":libraries:testing-junit4") {
onUnusedDependencies {
severity("fail")
// Not used by the module, but exposed via api to avoid adding two dependencies.
exclude(":libraries:testing-unit-common")
}
}
project(":libraries:testing-junit5") {
onUnusedDependencies {
severity("fail")
// Not used by the module, but exposed via api to avoid adding two dependencies.
exclude(":libraries:testing-unit-common")
}
}
}
}
tasks.register("clean", Delete::class) {
delete(rootProject.buildDir)
}
// TODO: Enable K2 in a later PR
tasks.withType(KotlinJvmCompile::class.java).configureEach {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
apiVersion.set(KotlinVersion.KOTLIN_1_9)
languageVersion.set(KotlinVersion.KOTLIN_1_9)
}
}
allprojects {
configurations.all {
resolutionStrategy {
failOnNonReproducibleResolution()
dependencySubstitution {
substitute(module("com.bumble.appyx:customisations"))
.using(project(":libraries:customisations"))
.because("RIBs uses Appyx customisations as external dependency")
}
eachDependency {
when (requested.group) {
// Version 1.0 and 1.1 are included which cause ':libraries:core' espresso tests to fail
"androidx.tracing" -> useVersion(libs.versions.androidx.tracing.get())
}
}
}
}
}
subprojects {
plugins.apply("release-dependencies-diff-create")
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
if (project.findProperty("enableComposeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
File(project.buildDir, "compose_metrics").absolutePath
)
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
File(project.buildDir, "compose_metrics").absolutePath
)
}
}
}
}