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.
bzip2
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 {
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'

@ -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()
}
}
}

Loading…
Cancel
Save