-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
64 lines (58 loc) · 2.25 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
rootProject.name = "gradle-dependency-resolution-plugin"
pluginManagement {
repositories {
maven {
val MAVEN_DOWNLOAD_URL = "MAVEN_DOWNLOAD_URL"
val MAVEN_USER = "MAVEN_USER"
val MAVEN_PASSWORD = "MAVEN_PASSWORD"
val mavenDownloadURL = System.getenv(MAVEN_DOWNLOAD_URL)
if (mavenDownloadURL == null) {
throw GradleException("$MAVEN_DOWNLOAD_URL has to be set in environment")
}
var mavenUser = System.getenv(MAVEN_USER)
if (mavenUser.isNullOrBlank()) {
logger.info("$MAVEN_USER is not set in environment. Setting to \"x\"")
mavenUser = "x"
}
var mavenPassword = System.getenv(MAVEN_PASSWORD)
if (mavenPassword.isNullOrBlank()) {
logger.info("$MAVEN_PASSWORD is not set in environment. Setting to \"x\"")
mavenPassword = "x"
}
url = uri(mavenDownloadURL)
credentials {
username = mavenUser
password = mavenPassword
}
}
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
maven {
val MAVEN_DOWNLOAD_URL = "MAVEN_DOWNLOAD_URL"
val MAVEN_USER = "MAVEN_USER"
val MAVEN_PASSWORD = "MAVEN_PASSWORD"
val mavenDownloadURL = System.getenv(MAVEN_DOWNLOAD_URL)
if (mavenDownloadURL == null) {
throw GradleException("$MAVEN_DOWNLOAD_URL has to be set in environment")
}
var mavenUser = System.getenv(MAVEN_USER)
if (mavenUser.isNullOrBlank()) {
logger.info("$MAVEN_USER is not set in environment. Setting to \"x\"")
mavenUser = "x"
}
var mavenPassword = System.getenv(MAVEN_PASSWORD)
if (mavenPassword.isNullOrBlank()) {
logger.info("$MAVEN_PASSWORD is not set in environment. Setting to \"x\"")
mavenPassword = "x"
}
url = uri(mavenDownloadURL)
credentials {
username = mavenUser
password = mavenPassword
}
}
}
}