-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
settings.gradle.kts
78 lines (67 loc) · 2.38 KB
/
settings.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
import com.javiersc.gradle.properties.extensions.getBooleanProperty
pluginManagement {
fun prop(name: String): String? =
providers.gradleProperty(name).orNull?.takeIf(String::isNotBlank)
val itselfVersionFromProp: String? = prop("itselfVersion")?.dropWhile { it.isLetter() }
val itselfVersion: String =
itselfVersionFromProp
?: file("$rootDir/gradle/hubdle.libs.versions.toml")
.readLines()
.first { it.startsWith("javiersc-hubdle") }
.split("\"")[1]
val kotlinVersionFromProp: String? = prop("kotlinVersion")
val kotlinVersion: String? = kotlinVersionFromProp
repositories {
google {
mavenContent {
includeGroupByRegex("androidx.*")
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
}
}
mavenCentral()
gradlePluginPortal()
maven(url = "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap")
if (itselfVersionFromProp != null) {
mavenLocal()
}
}
plugins { //
id("com.javiersc.hubdle") version itselfVersion
if (kotlinVersion != null) id("org.jetbrains.kotlin.jvm") version kotlinVersion apply false
}
}
plugins { //
id("com.javiersc.hubdle")
}
hubdleSettings {
autoInclude {
val sandboxEnabled = getBooleanProperty("sandbox.enabled").orNull == true
if (!sandboxEnabled) excludedBuilds("sandbox")
}
catalog.isEnabled.set(false)
}
fun prop(name: String): String? = providers.gradleProperty(name).orNull?.takeIf(String::isNotBlank)
val itselfVersion: String? = prop("itselfVersion")?.dropWhile { it.isLetter() }
val kotlinVersion: String? = prop("kotlinVersion")
dependencyResolutionManagement {
repositories {
if (itselfVersion != null) {
mavenLocal()
}
}
gradle.settingsEvaluated {
versionCatalogs {
removeIf { it.name == "hubdle" }
create("hubdle") {
if (itselfVersion != null) {
version("javiersc-hubdle", itselfVersion)
}
if (kotlinVersion != null) {
version("jetbrains-kotlin", kotlinVersion)
}
from(files(rootDir.resolve("gradle/hubdle.libs.versions.toml")))
}
}
}
}