-
Notifications
You must be signed in to change notification settings - Fork 8
/
release.gradle
96 lines (86 loc) · 3.21 KB
/
release.gradle
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
apply plugin: "maven-publish"
apply plugin: "signing"
// load credentials from local properties if present
def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localProperties.load(new FileInputStream(localPropertiesFile))
}
// create component with single publication variant
// https://developer.android.com/studio/publish-library/configure-pub-variants#single-pub-var
android {
publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}
// https://developer.android.com/studio/publish-library/upload-library
publishing {
publications {
// create a single release publication
release(MavenPublication) {
groupId = "io.embrace"
artifactId = project.name
version = project.version
afterEvaluate {
from components.release
}
// append some license metadata to the POM.
pom {
name = project.name
description = "Embrace Android SDK"
url = "https://github.com/embrace-io/embrace-android-sdk"
licenses {
license {
name = "Embrace License"
url = "https://embrace.io/docs/terms-of-service/"
}
}
developers {
developer {
id = "dev1"
name = "Embrace"
email = "[email protected]"
}
}
scm {
connection = "scm:git:github.com/embrace-io/embrace-android-sdk.git"
developerConnection = "scm:git:ssh:https://github.com/embrace-io/embrace-android-sdk.git"
url = "https://github.com/embrace-io/embrace-android-sdk/tree/main"
}
}
}
}
// configure repositories where the publication can be hosted
repositories {
// beta releases
maven {
credentials {
username System.getenv("MAVEN_QA_USER")
password System.getenv("MAVEN_QA_PASSWORD")
}
name = "Qa"
url = "https://repo.embrace.io/repository/beta"
}
// the android-testing maven repository is used for publishing snapshots
maven {
credentials {
username System.getenv("MAVEN_QA_USER")
password System.getenv("MAVEN_QA_PASSWORD")
}
name = "Snapshot"
url = "https://repo.embrace.io/repository/android-testing"
}
}
}
allprojects {
ext."signing.keyId" = System.getenv("mavenSigningKeyId") ?: localProperties.getProperty("signing.keyId")
ext."signing.secretKeyRingFile" = System.getenv("mavenSigningKeyRingFile") ?: localProperties.getProperty("signing.secretKeyRingFile")
ext."signing.password" = System.getenv("mavenSigningKeyPassword") ?: localProperties.getProperty("signing.password")
}
signing {
sign publishing.publications.release
}
project.tasks.withType(Sign)*.enabled = !project.version.endsWith("-SNAPSHOT")