-
Notifications
You must be signed in to change notification settings - Fork 10
/
publishing.build.gradle
79 lines (72 loc) · 2.47 KB
/
publishing.build.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
apply plugin: "maven"
apply plugin: "maven-publish"
apply from: "$rootDir/utils.build.gradle"
task sourceJar(type: Jar) {
from sourceSets.main.allSource
classifier "sources"
}
tasks.register('javadocJar', Jar) {
def dokkaTask = rootProject.tasks.named('dokka').get()
dependsOn dokkaTask
archiveClassifier.set 'javadoc'
from dokkaTask.outputDirectory
}
publishing {
// https://docs.gradle.org/5.0/dsl/org.gradle.api.publish.maven.MavenPublication.html
// https://dev.to/madhead/no-bullshit-guide-on-publishing-your-gradle-projects-to-maven-central-3ok4
publications {
MVFlow(MavenPublication) {
from components.java
artifact sourceJar
artifact javadocJar
pom {
name = "MVFlow"
description = "Simple MVI architecture using Kotlin Flows"
url = "https://github.com/pedroql/mvflow"
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
distribution = 'repo'
}
}
developers {
developer {
name = "Pedro Loureiro"
id = "pedroql"
url = "https://pedroloureiro.net"
}
}
scm {
connection = "scm:git:https://github.com/pedroql/mvflow.git"
developerConnection = "scm:git:git@github.com/pedroql/mvflow.git"
url = "https://github.com/pedroql/mvflow"
}
}
}
}
repositories {
maven {
url = uri("$buildDir/local-maven-repository")
name = "local"
}
maven {
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = readProperty("OSSRH_USER")
password = readProperty("OSSRH_PASSWORD")
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
// // https://docs.gradle.org/current/userguide/signing_plugin.html#sec:signing_pom_files
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
}
}
}
// need to do this after specifying the publications
apply from: "$rootDir/signing.build.gradle"