forked from realm/realm-android-adapters
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mavencentral-properties.gradle
21 lines (19 loc) · 1.12 KB
/
mavencentral-properties.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Find property in either System environment or Gradle properties.
// If set in both places, Gradle properties win.
def getPropertyValue(String propertyName) {
return project.findProperty(propertyName) ?: System.getenv(propertyName) ?: ""
}
// Default values
def rootExt = rootProject.ext
rootExt["signing.keyId"] = 'BD9104E9'
rootExt["sonatypeStagingProfileId"] = '78c19333e4450f'
// Set properties either from a global properties file or environment parameters
rootExt["signBuild"] = getPropertyValue('signBuild')
rootExt["signing.password"] = getPropertyValue('signPassword')
// Apparently Gradle treats properties define through a gradle.properties file differently
// than those defined through the commandline using `-P`. This is a problem with new
// line characters as found in an ascii-armoured PGP file. To ensure work around this, all newlines
// have been replaced with `#` and thus needs to be reverted here.
rootExt["signing.secretKeyRingFile"] = getPropertyValue('signSecretRingFile').replaceAll('#','\n')
rootExt["ossrhUsername"] = getPropertyValue('ossrhUsername')
rootExt["ossrhPassword"] = getPropertyValue('ossrhPassword')