From 61a42c629ae4d5d75447e951f515b5ac03adf0fa Mon Sep 17 00:00:00 2001 From: foxikle Date: Thu, 13 Jun 2024 15:39:23 -0400 Subject: [PATCH] workie ??????!?s --- build.gradle.kts | 54 ++++++++++++++---------------------------------- 1 file changed, 16 insertions(+), 38 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0ea78575..c1e4dae4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -78,52 +78,30 @@ val sourcesJar = tasks.register("sourcesJar") { publishing { repositories { -// maven { -// name = "FoxikleCytonicRepository" -// url = uri("https://repo.foxikle.dev/cytonic") -// credentials(PasswordCredentials::class) -// authentication { -// create("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" -// } -// -// val user = providers.gradleProperty("username").orElse(u).get() -// val pass = providers.gradleProperty("password").orElse(p).get() -// -// println("pass: ${pass.length} | user: ${user.length}") -// credentials { -// username = user -// password = pass -// } -// } -// } maven { name = "FoxikleCytonicRepository" url = uri("https://repo.foxikle.dev/cytonic") credentials(PasswordCredentials::class) authentication { create("basic") { - val u = providers.gradleProperty("username") - .orElse(System.getenv("REPO_USERNAME")) - .orElse("no-value-provided") - .get() - val p = providers.gradleProperty("password") - .orElse(System.getenv("REPO_PASSWORD")) - .orElse("no-value-provided") - .get() + // Use providers to get the properties or fallback to environment variables + var u = System.getenv("REPO_USERNAME") + var p = System.getenv("REPO_PASSWORD") - println("pass: ${p.length} | user: ${u.length}") + if (u == null || u.isEmpty()) { + u = "no-value-provided" + } + if (p == null || p.isEmpty()) { + p = "no-value-provided" + } + + val user = providers.gradleProperty("username").orElse(u).get() + val pass = providers.gradleProperty("password").orElse(p).get() + + println("pass: ${pass.length} | user: ${user.length}") credentials { - username = u - password = p + username = user + password = pass } } }