-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
168 lines (142 loc) · 4.62 KB
/
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
import groovy.swing.SwingBuilder
plugins {
id 'java-library'
id 'maven'
id 'maven-publish'
id 'signing'
id 'jacoco'
id 'checkstyle'
}
group 'org.zalando'
version '1.0.2'
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
api group: 'io.opentracing', name: 'opentracing-api', version: '0.33.0'
implementation group: 'com.amazonaws', name: 'aws-java-sdk-sqs', version: '1.11.464'
implementation group: 'software.amazon.awssdk', name: 'sqs', version: '2.1.3'
testImplementation group: 'io.opentracing', name: 'opentracing-mock', version: '0.33.0'
testImplementation group: 'junit', name: 'junit', version: '4.12'
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
checkstyle {
configFile = new File(rootDir, "checkstyle.xml")
}
jacoco {
toolVersion = "0.8.6"
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
csv.enabled false
}
}
check.dependsOn jacocoTestReport
signing {
useGpgCmd()
sign configurations.archives
}
tasks.withType(Sign) {
onlyIf { project.hasProperty('signing.gnupg.keyName') }
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.allTasks.any { it instanceof Sign }) {
allprojects {
if (gradle.taskGraph.hasTask("uploadArchives")) {
def pass = ''
new SwingBuilder().edt {
dialog(modal: true,
title: 'Enter password',
alwaysOnTop: true,
resizable: false,
locationRelativeTo: null, // Place dialog in center of the screen
pack: true,
show: true
) {
vbox {
label(text: "Please enter key passphrase:")
input = passwordField()
button(defaultButton: true, text: 'OK', actionPerformed: {
pass = input.password
dispose()
})
}
}
}
ext."signing.password" = new String(pass)
}
}
}
}
publishing { // for local publishing
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
if (project.hasProperty("sonatypeUsername")) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
}
pom.project {
name 'opentracing-sqs'
packaging 'jar'
description 'opentracing-sqs is a utility library for transmitting the OpenTracing span context over SQS.'
url 'http://github.com/zalando-incubator/opentracing-sqs-java/'
inceptionYear 2018
organization {
name 'Zalando SE'
url 'https://tech.zalando.com/'
}
scm {
url 'scm:git@github.com:zalando-incubator/opentracing-sqs-java.git'
connection 'scm:git@github.com:zalando-incubator/opentracing-sqs-java.git'
developerConnection 'scm:git@github.com:zalando-incubator/opentracing-sqs-java.git'
}
licenses {
license {
name 'MIT License'
url 'https://opensource.org/licenses/MIT'
distribution 'repo'
}
}
developers {
developer {
id 'jmhofer'
name 'Joachim Hofer'
email 'joachim.hofer@zalando.de'
organization 'Zalando SE'
organizationUrl 'https://tech.zalando.com/'
}
}
}
}
}
}