-
Notifications
You must be signed in to change notification settings - Fork 17
/
publish-mavencentral.gradle
72 lines (65 loc) · 2.99 KB
/
publish-mavencentral.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
apply plugin: 'maven-publish'
apply plugin: 'signing'
//for signing artifacts
ext["signing.keyId"] = project.hasProperty('signing.keyId') ? project.property('signing.keyId') : System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = project.hasProperty('signing.password') ? project.property('signing.password') : System.getenv('SIGNING_PASSWORD')
ext["signing.secretKeyRingFile"] = project.hasProperty('signing.secretKeyRingFile') ? project.property('signing.secretKeyRingFile') : System.getenv('SIGNING_SECRET_KEY_RING_FILE')
//for connecting to https://oss.sonatype.org/
ext["ossrhUsername"] = project.hasProperty('ossrhUsername') ? project.property('ossrhUsername') : System.getenv('OSSRH_USERNAME')
ext["ossrhPassword"] = project.hasProperty('ossrhPassword') ? project.property('ossrhPassword') : System.getenv('OSSRH_PASSWORD')
//for auto close and release staging repository
ext["sonatypeStagingProfileId"] = project.hasProperty('sonatypeStagingProfileId') ? project.property('sonatypeStagingProfileId') : System.getenv('SONATYPE_STAGING_PROFILE_ID')
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
from components.findByName('release')
groupId group
artifactId PUBLISH_ARTIFACT_ID
if (System.getenv('RELEASE_VERSION') != null) {
version System.getenv('RELEASE_VERSION')
} else {
version version
}
pom {
name = PUBLISH_ARTIFACT_ID
description = 'Mobile Messaging SDK for Android'
url = 'https://github.com/infobip/mobile-messaging-sdk-android'
licenses {
license {
name = 'Apache License 2.0'
url = 'https://github.com/infobip/mobile-messaging-sdk-android/blob/master/LICENSE'
}
}
developers {
developer {
id = 'infobip'
name = 'Infobip'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:github.com/infobip/mobile-messaging-sdk-android.git'
developerConnection = 'scm:git:ssh://github.com/infobip/mobile-messaging-sdk-android.git'
url = 'https://github.com/infobip/mobile-messaging-sdk-android'
}
}
}
}
// repositories {
// maven {
// name = "SonatypeReleases"
// url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
//
// credentials {
// username ossrhUsername
// password ossrhPassword
// }
// }
// }
}
}
//Comment out for making local version
signing {
sign publishing.publications
}