forked from mulesoft-labs/raml-java-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.gradle.kts
58 lines (47 loc) · 1.52 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
pluginManagement {
fun requireNonBlankGitHubCred(key: String, env: String) : String {
// First try and load the gradle.properties entry.
if (extra.has(key)) {
val cred = extra[key] as String?
// Well, they defined it, but they did it wrong, so throw an error here.
if (cred.isNullOrBlank()) {
println("Gradle property \"$key\" has been set to a null or blank value.")
throw RuntimeException("Gradle property \"$key\" has been set to a null or blank value.")
}
return cred
}
// They don't have a gradle.properties entry. Check the environment.
val cred = System.getenv(env)
if (cred.isNullOrBlank()) {
println("Environment variable \"$env\" is missing or blank.")
throw RuntimeException("Environment variable \"$env\" is missing or blank.")
}
return cred
}
fun requireGitHubUsername() = requireNonBlankGitHubCred("gpr.user", "GITHUB_USERNAME")
fun requireGitHubToken() = requireNonBlankGitHubCred("gpr.key", "GITHUB_TOKEN")
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/veupathdb/maven-packages")
credentials {
username = requireGitHubUsername()
password = requireGitHubToken()
}
}
}
}
rootProject.name = "raml-java-tools"
include(
":platform",
":pojo-to-raml",
":raml-builder",
":raml-parser-query",
":raml-parser-tools",
":raml-simple-emitter",
":raml-to-pojo",
":test-utils",
)