-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings.gradle.kts
34 lines (31 loc) · 1.33 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
rootProject.name = "zap-commons"
pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
maven {
url = uri("https://maven.pkg.github.com/zapzombies/gradle-convention-plugins")
credentials {
val patFile = file("${rootProject.projectDir}/.pat")
val credential = if(patFile.exists()) {
val parts = patFile.readText().split("\n")
logger.lifecycle("zgpr: Credential found! Username: ${parts[0].trim()}, PAT: ${parts[1].trim().substring(0..10)}*** ")
parts[0].trim() to parts[1].trim()
} else {
// Regular old project props & system env combo
val username = System.getenv("USERNAME")
val pat = System.getenv("TOKEN")
if(username == null || pat == null) {
logger.error("zgpr: Credential not found!")
"" to ""
} else {
logger.lifecycle("zgpr: Credential found! Username: $username, PAT: ${pat.substring(0..10)}*** ")
username to pat
}
}
username = credential.first
password = credential.second
}
}
}
}