-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
64 lines (54 loc) · 1.81 KB
/
build.gradle
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
buildscript {
apply from: file("$rootDir/projectConfig.gradle")
ext.versionCatalog = extensions.getByType(VersionCatalogsExtension).named("dep")
repositories {
google()
mavenCentral()
maven {
name = "r8"
url = "https://storage.googleapis.com/r8-releases/raw"
content { includeGroup("com.android.tools") }
}
}
dependencies {
classpath dep.plugins.r8.get().toString()
classpath dep.plugins.android.get().toString()
classpath dep.plugins.kotlin.get().toString()
classpath dep.plugins.ksp.get().toString()
classpath dep.plugins.compose.get().toString()
}
def plugins = versionCatalog
.getPluginAliases()
.collect { versionCatalog.findPlugin(it).get().get() }
.collect { "${it.pluginId}:${it.version}" }
configurations.configureEach { resolutionStrategy.forcedModules = plugins }
}
def libsResolved = [:]
versionCatalog.getLibraryAliases().collect { versionCatalog.findLibrary(it).get().get() }.forEach {
if (it.group != null && it.name != null && it.version != null) {
def artifact = it.group + ":" + it.name
if (libsResolved.containsKey(artifact)) libsResolved.remove(artifact)
else libsResolved.put(artifact, it.version)
}
}
def libs = libsResolved.collect { "${it.key}:${it.value}" }
subprojects {
repositories {
google()
mavenCentral()
}
configurations.configureEach { config ->
resolutionStrategy.forcedModules = libs
config.exclude(group: "androidx.cardview")
config.exclude(group: "androidx.cursoradapter")
config.exclude(group: "androidx.legacy")
config.exclude(group: "androidx.viewpager")
config.exclude(group: "androidx.viewpager2")
}
}
apply from: file("$rootDir/gradle/plugins/configureSubprojects.gradle")
configureSubprojects()
if (hasProperty("buildScan")) buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}