Skip to content

Commit

Permalink
new idea
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxikle committed Jun 14, 2024
1 parent c8983eb commit 0e9a2b1
Showing 1 changed file with 24 additions and 23 deletions.
47 changes: 24 additions & 23 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -81,31 +81,32 @@ publishing {
maven {
name = "FoxikleCytonicRepository"
url = uri("https://repo.foxikle.dev/cytonic")
credentials(PasswordCredentials::class)
// credentials(PasswordCredentials::class)
// Use providers to get the properties or fallback to environment variables
var u = System.getenv("REPO_USERNAME")
var p = System.getenv("REPO_PASSWORD")

if (u == null || u.isEmpty()) {
u = "no-value-provided"
}
if (p == null || p.isEmpty()) {
p = "no-value-provided"
}

println("pass: $p | user: $u")


val user = providers.gradleProperty("usernames").orElse(u).get()
val pass = providers.gradleProperty("passwords").orElse(p).get()
println("pass: $pass | user: $user")
println("pass: ${pass.length} | user: ${user.length}")
credentials {
username = user.toString()
password = pass.toString()
}
authentication {
create<BasicAuthentication>("basic") {
// Use providers to get the properties or fallback to environment variables
var u = System.getenv("REPO_USERNAME")
var p = System.getenv("REPO_PASSWORD")

if (u == null || u.isEmpty()) {
u = "no-value-provided"
}
if (p == null || p.isEmpty()) {
p = "no-value-provided"
}

println("pass: $p | user: $u")


val user = providers.gradleProperty("username").orElse(u).get()
val pass = providers.gradleProperty("password").orElse(p).get()
println("pass: $pass | user: $user")
println("pass: ${pass.length} | user: ${user.length}")
credentials {
username = user
password = pass
}

}
}
}
Expand Down

0 comments on commit 0e9a2b1

Please sign in to comment.