forked from resilience4j/resilience4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
publishing.gradle
94 lines (81 loc) · 2.93 KB
/
publishing.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
87
88
89
90
91
92
93
94
import java.text.SimpleDateFormat
Date buildTimeAndDate = new Date()
ext {
buildDate = new SimpleDateFormat('yyyy-MM-dd').format(buildTimeAndDate)
buildTime = new SimpleDateFormat('HH:mm:ss.SSSZ').format(buildTimeAndDate)
}
def projectArtifactId = 'resilience4j'
def url = "https://resilience4j.readme.io"
normalization {
runtimeClasspath {
metaInf {
ignoreAttribute("Build-Time")
ignoreAttribute("Build-Date")
}
}
}
jar {
manifest {
attributes(
'Built-By': 'Robert Winkler',
'Created-By': System.properties['java.version'] + " (" + System.properties['java.vendor'] + " " + System.properties['java.vm.version'] + ")",
'Build-Date': project.buildDate,
'Build-Time': project.buildTime,
'Specification-Title': projectArtifactId,
'Specification-Version': project.version,
'Implementation-Title': projectArtifactId,
'Implementation-Version': project.version,
)
}
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
tasks.withType(Sign) {
onlyIf { !version.endsWith("SNAPSHOT") }
}
signing {
sign publishing.publications
}
publishing {
publications {
resilience4j(MavenPublication) {
from components.java
pom.withXml {
def devs = ['RobWin': 'Robert Winkler',
'storozhukBM': 'Bogdan Storozhuk',
'Romeh': 'Mahmoud Romeh',
'dlsrb6342': 'Ingyu Hwhang',
'Hexmind': 'Tomasz Skowroński',
'drmaas': 'Dan Maas']
def root = asNode()
root.appendNode('name', "${projectArtifactId}")
root.appendNode('packaging', 'jar')
root.appendNode('url', "${url}")
root.appendNode('description', project.description)
def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'Apache-2.0')
license.appendNode('url', 'https://github.com/resilience4j/resilience4j/blob/master/LICENSE.txt')
license.appendNode('distribution', 'repo')
root.appendNode('scm').appendNode('url', 'https://github.com/resilience4j/resilience4j.git')
def developers = root.appendNode('developers')
devs.each {
def d = developers.appendNode('developer')
d.appendNode('id', it.key)
d.appendNode('name', it.value)
}
}
artifact sourcesJar
artifact javadocJar
}
}
}