From 09bdf640f416d668138b9bf07c1955320ed895af Mon Sep 17 00:00:00 2001 From: Graham Date: Mon, 2 Mar 2020 18:37:49 +0000 Subject: [PATCH] Add openrs2 prefix to repo{Username,Password} properties These might be added to the user's ~/gradle.properties file, at which point having a per-project prefix is useful. Ideally I'd have preferred to use openrs2.repo.{username,password}. However, Gradle properties with dots in them can't be configured with the ORG_GRADLE_PROJECT_* environment variables, which we use in the Jenkinsfile. --- Jenkinsfile | 4 ++-- build.gradle.kts | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b30ad0b5..cf99903d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,8 +6,8 @@ pipeline { steps { withCredentials([usernamePassword( credentialsId: 'archiva', - usernameVariable: 'ORG_GRADLE_PROJECT_repoUsername', - passwordVariable: 'ORG_GRADLE_PROJECT_repoPassword' + usernameVariable: 'ORG_GRADLE_PROJECT_openrs2RepoUsername', + passwordVariable: 'ORG_GRADLE_PROJECT_openrs2RepoPassword' )]) { withGradle { sh './gradlew --no-daemon clean build publish' diff --git a/build.gradle.kts b/build.gradle.kts index 17096541..351ebbee 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -20,17 +20,17 @@ allprojects { repositories { mavenCentral() - if (hasProperty("repoUsername")) { + if (hasProperty("openrs2RepoUsername")) { maven(url = "https://repo.openrs2.dev/repository/openrs2") { credentials { - username = findProperty("repoUsername")?.toString() - password = findProperty("repoPassword")?.toString() + username = findProperty("openrs2RepoUsername")?.toString() + password = findProperty("openrs2RepoPassword")?.toString() } } maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") { credentials { - username = findProperty("repoUsername")?.toString() - password = findProperty("repoPassword")?.toString() + username = findProperty("openrs2RepoUsername")?.toString() + password = findProperty("openrs2RepoPassword")?.toString() } } } @@ -144,8 +144,8 @@ configure(subprojects.filter { it.free }) { } credentials { - username = findProperty("repoUsername")?.toString() - password = findProperty("repoPassword")?.toString() + username = findProperty("openrs2RepoUsername")?.toString() + password = findProperty("openrs2RepoPassword")?.toString() } } }