-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
publish-pom.gradle
77 lines (71 loc) · 2.67 KB
/
publish-pom.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
android {
publishing {
multipleVariants {
allVariants()
withJavadocJar()
withSourcesJar()
}
}
}
afterEvaluate {
tasks.register('sourceJar', Jar) {
from android.sourceSets.main.java.srcDirs
from android.sourceSets.main.kotlin.srcDirs
archiveClassifier.set('sources')
}
publishing {
repositories {
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = System.getenv("OSSRH_USERNAME")
password = System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
release(MavenPublication) {
version = android.defaultConfig.versionName
from components.release
}
configureEach {
// https://github.com/gradle/gradle/issues/26091#issuecomment-1681343496
var dokkaJar = project.tasks.register("${name}DokkaJar", Jar) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka into a Javadoc jar"
archiveClassifier.set("javadoc")
from(tasks.named("dokkaHtml"))
// Each archive name should be distinct, to avoid implicit dependency issues.
// We use the same format as the sources Jar tasks.
// https://youtrack.jetbrains.com/issue/KT-46466
archiveBaseName.set("${archiveBaseName.get()}-${name}")
}
artifact(dokkaJar)
pom {
name.set(project.name)
description.set(android.ext.description)
url.set("https://github.com/atsushieno/aap-core")
scm {
url.set("https://github.com/atsushieno/aap-core")
}
licenses {
license {
name.set("the MIT License")
url.set("https://github.com/atsushieno/aap-core/blob/main/LICENSE")
}
}
developers {
developer {
id.set("atsushieno")
name.set("Atsushi Eno")
email.set("atsushieno@gmail.com")
}
}
}
}
}
}
// keep it as is. It is replaced by CI release builds
signing {}
}