-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsettings.gradle.kts
More file actions
105 lines (87 loc) · 3.12 KB
/
settings.gradle.kts
File metadata and controls
105 lines (87 loc) · 3.12 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
@file:Suppress("UnstableApiUsage")
import org.gradle.internal.extensions.stdlib.toDefaultLowerCase
// define project name and version
rootProject.name = "dua3-utility"
val projectVersion = "22.0.7"
// define subprojects
include("utility")
include("utility-bom")
include("utility-db")
include("utility-swing")
include("utility-fx")
include("utility-fx-icons")
include("utility-fx-icons-ikonli")
include("utility-fx-controls")
include("utility-fx-db")
include("utility-fx-web")
include("utility-samples")
include("utility-samples:utility-samples-graphics")
include("utility-samples:utility-samples-fx")
// define dependency versions and repositories
dependencyResolutionManagement {
val isSnapshot = projectVersion.toDefaultLowerCase().contains("-snapshot")
val isReleaseCandidate = !isSnapshot && projectVersion.toDefaultLowerCase().contains("-rc")
if (isSnapshot && !projectVersion.endsWith("-SNAPSHOT")) {
throw GradleException("inconsistent version definition: $projectVersion does not end with SNAPSHOT")
}
versionCatalogs {
create("libs") {
from(files("gradle/libs.toml"))
version("projectVersion", projectVersion)
version("utility-bom", projectVersion)
library("utility-bom", "com.dua3.utility", "utility-bom").versionRef("utility-bom")
}
}
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// Maven Central Repository
mavenCentral()
// Sonatype Releases
maven {
name = "central.sonatype.com-releases"
url = java.net.URI("https://oss.sonatype.org/content/repositories/releases/")
mavenContent {
releasesOnly()
}
}
// Apache releases
maven {
name = "apache-releases"
url = java.net.URI("https://repository.apache.org/content/repositories/releases/")
mavenContent {
releasesOnly()
}
}
if (isSnapshot) {
println("snapshot version detected, adding Maven snapshot repositories")
mavenLocal()
// Sonatype Snapshots
maven {
name = "Central Portal Snapshots"
url = java.net.URI("https://central.sonatype.com/repository/maven-snapshots/")
mavenContent {
snapshotsOnly()
}
}
// Apache snapshots
maven {
name = "apache-snapshots"
url = java.net.URI("https://repository.apache.org/content/repositories/snapshots/")
mavenContent {
snapshotsOnly()
}
}
}
if (isReleaseCandidate) {
println("release candidate version detected, adding Maven staging repositories")
// Apache staging
maven {
name = "apache-staging"
url = java.net.URI("https://repository.apache.org/content/repositories/staging/")
mavenContent {
releasesOnly()
}
}
}
}
}