-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
50 lines (46 loc) · 1.85 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
import java.io.FileInputStream
import java.util.*
buildscript {
val composeUiVersion by extra("1.7.7")
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.8.0" apply false
id("com.android.library") version "8.8.0" apply false
id("org.jetbrains.kotlin.android") version "1.9.25" apply false
id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
}
ext["ossrhUsername"] = ""
ext["ossrhPassword"] = ""
ext["sonatypeStagingProfileId"] = ""
ext["signing.secretKeyRingFile"] = ""
ext["signing.keyId"] = ""
ext["signing.password"] = ""
val secretPropsFile = project.rootProject.file("local.properties")
if (secretPropsFile.exists()) {
// Use local.properties if exists
Properties().apply {
load(FileInputStream(secretPropsFile))
}.forEach { name, value ->
ext[name.toString()] = value
}
} else {
// Use system environment variables otherwise
ext["ossrhUsername"] = System.getenv("OSSRH_USERNAME")
ext["ossrhPassword"] = System.getenv("OSSRH_PASSWORD")
ext["sonatypeStagingProfileId"] = System.getenv("SONATYPE_STAGING_PROFILE_ID")
ext["signing.secretKeyRingFile"] = System.getenv("SECRET_KEY_RING_FILE")
ext["signing.keyId"] = System.getenv("SIGNING_KEY_ID")
ext["signing.password"] = System.getenv("SIGNING_PASSWORD")
}
nexusPublishing {
repositories {
sonatype {
stagingProfileId.set(rootProject.ext["sonatypeStagingProfileId"].toString())
username.set(rootProject.ext["ossrhUsername"].toString())
password.set(rootProject.ext["ossrhPassword"].toString())
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}