-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathpublish.gradle
More file actions
46 lines (40 loc) · 1.13 KB
/
publish.gradle
File metadata and controls
46 lines (40 loc) · 1.13 KB
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
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply from: project(':').file('javadoc.gradle')
apply from: project(':').file('pom.gradle')
java {
withSourcesJar()
withJavadocJar()
}
afterEvaluate { project ->
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
}
withType(MavenPublication).configureEach {
setPom(pom, '')
}
}
repositories {
mavenLocal()
}
}
configure(signing) {
def key = System.getenv("GPG_SECKEY")
useInMemoryPgpKeys(
System.getenv("GPG_KEY_ID"),
key == null ? null : new String(Base64.getDecoder().decode(key)),
System.getenv("GPG_PASSPHRASE"),
)
sign(publishing.publications)
}
}