Skip to content

Commit

Permalink
KC-1802: Workaround for init script issue affecting Gradle 7.1 and newer
Browse files Browse the repository at this point in the history
  • Loading branch information
omkreddy committed Feb 9, 2022
1 parent ce6e4dc commit 7c7282f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build.gradle
Expand Up @@ -106,9 +106,9 @@ ext {
skipSigning = project.hasProperty('skipSigning') && skipSigning.toBoolean()
shouldSign = !skipSigning && !version.endsWith("SNAPSHOT") && !version.contains("-alpha") && !version.matches("[0-9]*\\.[0-9]*\\.[0-9]*-[0-9]*-(ccs|ce)")

mavenUrl = project.hasProperty('mavenUrl') ? project.mavenUrl : ''
mavenUsername = project.hasProperty('mavenUsername') ? project.mavenUsername : ''
mavenPassword = project.hasProperty('mavenPassword') ? project.mavenPassword : ''
mavenUrl = propertyOrElse(project, 'mavenUrl', '')
mavenUsername = propertyOrElse(project, 'mavenUsername', '')
mavenPassword = propertyOrElse(project, 'mavenPassword', '')

userShowStandardStreams = project.hasProperty("showStandardStreams") ? showStandardStreams : null

Expand Down Expand Up @@ -190,6 +190,16 @@ def determineCommitId() {
}
}

def propertyOrElse(project, propertyName, defaultValue) {
if (project.hasProperty(propertyName))
project.property(propertyName)
// Workaround for KC-1802, system properties set by init scripts are not included
// in project properties since Gradle 7.1. This can be removed once we update the
// packaging code to set credentials via a gradle.properties file instead.
else
System.getProperty("org.gradle.project.$propertyName", defaultValue)
}

apply from: file('wrapper.gradle')

if (file('.git').exists()) {
Expand Down

0 comments on commit 7c7282f

Please sign in to comment.