-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
59 lines (53 loc) · 2.35 KB
/
settings.gradle.kts
File metadata and controls
59 lines (53 loc) · 2.35 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
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
* For more detailed information on multi-project builds, please refer to https://docs.gradle.org/8.9/userguide/multi_project_builds.html in the Gradle documentation.
*/
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}
plugins {
// Apply the foojay-resolver plugin to allow automatic download of JDKs
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
// Nmcp plugin for publishing to Maven Central via Central Portal
id("com.gradleup.nmcp.settings") version "1.4.4"
}
rootProject.name = "libraries"
include(
"codehead-test", "database-test",
"metrics", "metrics-declarative", "metrics-declarative-test",
"metrics-micrometer","metrics-test",
"local-queue", "smr", "smr-yml", "smr-metrics",
"oop-mock","oop-mock-client","oop-mock-common","oop-mock-dynamodb","oop-mock-tests",
"feature-flag", "feature-flag-metrics", "feature-flag-test", "feature-flag-etcd", "feature-flag-ddb", "feature-flag-ddb-test", "feature-flag-sql", "feature-flag-integ"
)
// Configure Central Portal publishing credentials
nmcpSettings {
centralPortal {
username = System.getenv("CENTRAL_PORTAL_USERNAME") ?: providers.gradleProperty("centralPortalUsername").orNull
password = System.getenv("CENTRAL_PORTAL_PASSWORD") ?: providers.gradleProperty("centralPortalPassword").orNull
}
}
// Extract version from Git tag or use gradle.properties default
gradle.beforeProject {
val gitVersion = providers.exec {
commandLine("git", "describe", "--tags", "--exact-match", "HEAD")
isIgnoreExitValue = true
}.standardOutput.asText.get().trim()
if (gitVersion.isNotEmpty() && gitVersion.startsWith("v")) {
// Remove 'v' prefix from tag (v1.0.0 -> 1.0.0)
// Validate semantic versioning format
val versionPattern = Regex("^v(\\d+\\.\\d+\\.\\d+(-[a-zA-Z0-9.]+)?)$")
val matchResult = versionPattern.matchEntire(gitVersion)
if (matchResult != null) {
version = matchResult.groupValues[1]
logger.lifecycle("Using version from Git tag: $version")
} else {
logger.warn("Git tag '$gitVersion' does not match semantic versioning format (vX.Y.Z)")
}
}
}