forked from infobip/mobile-messaging-sdk-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish-mavencentral.gradle
85 lines (77 loc) · 3.58 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
73
74
75
76
77
78
79
80
81
82
83
84
85
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')
publishing {
publications {
release(MavenPublication) {
groupId group
artifactId PUBLISH_ARTIFACT_ID
if (System.getenv('RELEASE_VERSION') != null) {
version System.getenv('RELEASE_VERSION')
} else {
version version
}
if (project.plugins.findPlugin("com.android.library")) {
artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
} else {
artifact("$buildDir/libs/${project.getName()}-${version}.jar")
}
artifact sourcesJar
artifact javadocJar
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'
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}
}
}
}
}
// repositories {
// maven {
// name = "SonatypeReleases"
// url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
//
// credentials {
// username ossrhUsername
// password ossrhPassword
// }
// }
// }
}
signing {
sign publishing.publications
}