-
Notifications
You must be signed in to change notification settings - Fork 33
/
build.gradle
149 lines (128 loc) · 3.98 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
buildscript {
repositories {
mavenCentral()
mavenLocal()
}
}
plugins {
id "java"
id "java-library"
id "signing"
id "maven-publish"
id "de.marcphilipp.nexus-publish" version "0.4.0"
id "io.codearte.nexus-staging" version "0.21.2"
id "idea"
}
repositories {
mavenLocal()
// Before LaunchDarkly release artifacts get synced to Maven Central they are here along with snapshots:
maven { url "https://oss.sonatype.org/content/groups/public/" }
mavenCentral()
}
allprojects {
group = 'com.launchdarkly'
version = "${version}"
archivesBaseName = 'okhttp-eventsource'
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
ext.versions = [
"okhttp": "3.12.10",
"slf4j": "1.7.22"
]
dependencies {
api "com.squareup.okhttp3:okhttp:${versions.okhttp}"
api "org.slf4j:slf4j-api:${versions.slf4j}"
testImplementation "ch.qos.logback:logback-classic:1.1.9"
testImplementation "org.mockito:mockito-core:1.10.19"
testCompile "org.eclipse.jetty:jetty-server:9.4.27.v20200227"
testImplementation "junit:junit:4.11"
}
jar {
manifest {
attributes("Implementation-Version": project.version)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
// Force the Javadoc build to fail if there are any Javadoc warnings. See: https://discuss.gradle.org/t/javadoc-fail-on-warning/18141/3
// The '-quiet' as second argument is actually a hack,
// since the one parameter addStringOption doesn't seem to
// work, we extra add '-quiet', which is added anyway by
// gradle. See https://github.com/gradle/gradle/issues/2354
// See JDK-8200363 (https://bugs.openjdk.java.net/browse/JDK-8200363)
// for information about the -Xwerror option.
options.addStringOption('Xwerror', '-quiet')
}
test {
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
showStandardStreams = true
exceptionFormat = 'full'
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
nexusStaging {
packageGroup = "com.launchdarkly"
numberOfRetries = 40 // we've seen extremely long delays in closing repositories
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = 'com.launchdarkly'
artifactId = 'okhttp-eventsource'
artifact sourcesJar
artifact javadocJar
pom {
name = 'okhttp-eventsource'
description = 'EventSource Implementation built on OkHttp'
url = 'https://github.com/launchdarkly/okhttp-eventsource'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
name = 'LaunchDarkly'
email = 'team@launchdarkly.com'
}
}
scm {
connection = 'scm:git:git://github.com/launchdarkly/okhttp-eventsource.git'
developerConnection = 'scm:git:ssh:git@github.com:launchdarkly/okhttp-eventsource.git'
url = 'https://github.com/launchdarkly/okhttp-eventsource'
}
}
}
}
repositories {
mavenLocal()
}
}
nexusPublishing {
clientTimeout = java.time.Duration.ofMinutes(2) // we've seen extremely long delays in creating repositories
repositories {
sonatype {
username = ossrhUsername
password = ossrhPassword
}
}
}
signing {
sign publishing.publications.mavenJava
}