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.
master
Graham 5 years ago
parent 9cbe8b5b28
commit 09bdf640f4
  1. 4
      Jenkinsfile
  2. 14
      build.gradle.kts

4
Jenkinsfile vendored

@ -6,8 +6,8 @@ pipeline {
steps { steps {
withCredentials([usernamePassword( withCredentials([usernamePassword(
credentialsId: 'archiva', credentialsId: 'archiva',
usernameVariable: 'ORG_GRADLE_PROJECT_repoUsername', usernameVariable: 'ORG_GRADLE_PROJECT_openrs2RepoUsername',
passwordVariable: 'ORG_GRADLE_PROJECT_repoPassword' passwordVariable: 'ORG_GRADLE_PROJECT_openrs2RepoPassword'
)]) { )]) {
withGradle { withGradle {
sh './gradlew --no-daemon clean build publish' sh './gradlew --no-daemon clean build publish'

@ -20,17 +20,17 @@ allprojects {
repositories { repositories {
mavenCentral() mavenCentral()
if (hasProperty("repoUsername")) { if (hasProperty("openrs2RepoUsername")) {
maven(url = "https://repo.openrs2.dev/repository/openrs2") { maven(url = "https://repo.openrs2.dev/repository/openrs2") {
credentials { credentials {
username = findProperty("repoUsername")?.toString() username = findProperty("openrs2RepoUsername")?.toString()
password = findProperty("repoPassword")?.toString() password = findProperty("openrs2RepoPassword")?.toString()
} }
} }
maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") { maven(url = "https://repo.openrs2.dev/repository/openrs2-snapshots") {
credentials { credentials {
username = findProperty("repoUsername")?.toString() username = findProperty("openrs2RepoUsername")?.toString()
password = findProperty("repoPassword")?.toString() password = findProperty("openrs2RepoPassword")?.toString()
} }
} }
} }
@ -144,8 +144,8 @@ configure(subprojects.filter { it.free }) {
} }
credentials { credentials {
username = findProperty("repoUsername")?.toString() username = findProperty("openrs2RepoUsername")?.toString()
password = findProperty("repoPassword")?.toString() password = findProperty("openrs2RepoPassword")?.toString()
} }
} }
} }

Loading…
Cancel
Save