-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
120 lines (101 loc) · 3.25 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
120 lines (101 loc) · 3.25 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
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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
import java.util.Properties
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.jlleitschuh.ktlint) apply false
id("com.gradleup.nmcp") version "1.5.0" apply false
}
buildscript {
repositories {
mavenLocal()
google()
mavenCentral()
}
}
val localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
val localProperties = Properties().apply {
localPropertiesFile.inputStream().use { load(it) }
}
localProperties.forEach { key, value ->
val keyString = key as String
if (!extra.has(keyString)) {
extra[keyString] = value
}
}
subprojects {
localProperties.forEach { key, value ->
val keyString = key as String
if (!extra.has(keyString)) {
extra[keyString] = value
}
}
}
}
val modules: List<String> =
rootDir
.resolve("projects.properties")
.readLines()
.dropWhile { !it.startsWith("modules=") }
.takeWhile { it.startsWith("modules=") || it.trim().endsWith(",\\") || it.trim().matches(Regex("^[a-zA-Z0-9-]+$")) }
.joinToString("")
.removePrefix("modules=")
.replace("\\", "")
.split(",")
.map { it.trim() }
.filter { it.isNotEmpty() }
tasks.register("allLintChecks") {
group = "verification"
description = "Run ktlintFormat and lint for all modules"
val lintTasks =
modules
.filter { it != "mapconductor-bom" }
.flatMap { module ->
listOf(":$module:ktlintFormat", ":$module:lint")
}
dependsOn(lintTasks)
}
// Publishing tasks for all modules
val publishableModules = listOf(
"mapconductor-bom",
"android-sdk-core",
"android-sdk-compose",
"android-icons",
"android-marker-clustering",
"android-heatmap",
"android-geojson-layer",
"android-for-arcgis",
"android-for-googlemaps",
"android-for-here",
"android-for-mapbox",
"android-for-maplibre",
"android-for-tomtom"
)
tasks.register("publishAllLocal") {
group = "publishing"
description = "Publish all MapConductor modules to local repository"
val publishTasks = publishableModules.map { module ->
":$module:publishToMavenLocal"
}
dependsOn(publishTasks)
}
tasks.register("publishAllToGitHub") {
group = "publishing"
description = "Publish all MapConductor modules to GitHub Packages"
val publishTasks = publishableModules.map { module ->
":$module:publishReleasePublicationToGitHubPackagesRepository"
}
dependsOn(publishTasks)
}
tasks.register("publishAllToMavenCentral") {
group = "publishing"
description = "Publish all MapConductor modules to Maven Central via Central Portal"
val publishTasks = publishableModules.map { module ->
":$module:publishAllPublicationsToNmcpReleaseRepository"
}
dependsOn(publishTasks)
}