-
Notifications
You must be signed in to change notification settings - Fork 46
/
build.gradle.kts
57 lines (51 loc) · 1.43 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:_")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:_")
}
}
plugins {
id("io.codearte.nexus-staging")
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
group = Publish.group
version = Publish.version
}
val local = project.rootProject.file("local.properties")
.takeIf(File::exists)
?.toProperties()
?: java.util.Properties() // Optional with CI
// Inject config
mapOf(
// Signing
"signing.keyId" to "SIGNING_KEY_ID",
"signing.password" to "SIGNING_PASSWORD",
"signing.secretKeyRingFile" to "SIGNING_SECRET_KEY_RING_FILE",
"ossrh.username" to "OSSRH_USERNAME",
"ossrh.password" to "OSSRH_PASSWORD"
).forEach { (key, envName) ->
val value = local.propOrEnv(key, envName)
?.let {
if (key.contains("File")) {
rootProject.file(it).absolutePath
} else it
}
rootProject.ext.set(key, value)
}
// https://github.com/Codearte/gradle-nexus-staging-plugin
nexusStaging {
packageGroup = Publish.group
stagingProfileId = local.propOrEnv("sonatype.staging.profile.id", "SONATYPE_STAGING_PROFILE_ID")
username = "${rootProject.ext.get("ossrh.username")}"
password = "${rootProject.ext.get("ossrh.password")}"
}