-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpublish.gradle
86 lines (74 loc) · 2.4 KB
/
publish.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
apply plugin: "maven-publish"
apply plugin: "signing"
apply plugin: "org.jetbrains.dokka"
tasks.register("androidSourcesJar", Jar) {
archiveClassifier.set("sources")
from(android.sourceSets.main.java.srcDirs)
}
tasks.register("androidJavadocJar", Jar) {
archiveClassifier.set("javadoc")
dependsOn(dokkaJavadoc)
from(dokkaJavadoc.outputDirectory)
}
android {
publishing {
singleVariant("affiseRelease") {
withSourcesJar()
withJavadocJar()
}
}
}
afterEvaluate {
publishing {
publications {
affiseRelease(MavenPublication) {
from components.release
groupId = "com.affise"
version = asSnapshot(affiseVersion, snapshot)
artifact androidJavadocJar
pom {
signing {
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
sign publishing.publications
}
name = artifactId
description = "affise"
url = "https://affise.com/"
licenses {
license {
name = "MIT license"
url = "https://github.com/affise/sdk-android/blob/main/LICENSE"
}
}
scm {
connection = "scm:git:git://github.com:affise/sdk-android.git"
developerConnection = "scm:git:ssh://github.com:affise/sdk-android.git"
url = "https://github.com/affise/sdk-android"
}
developers {
developer {
name = "Sergey Korney"
email = "s.korney@affise.com"
}
}
}
}
}
repositories {
maven {
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
}
static def asSnapshot(String version, boolean value) {
var result = version
if (value && !result.endsWith("SNAPSHOT")) {
result += "-SNAPSHOT"
}
return result
}