forked from reactive-streams/reactive-streams-jvm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
136 lines (117 loc) · 4.61 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
subprojects {
apply plugin: "java"
apply plugin: "osgi"
group = "org.reactivestreams"
version = "1.0.0"
sourceCompatibility = 1.6
targetCompatibility = 1.6
tasks.withType(JavaCompile) {
configure(options) {
compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
encoding = "UTF-8"
}
}
tasks.withType(Javadoc) {
configure(options) {
encoding "UTF-8"
docEncoding "UTF-8"
charSet "UTF-8"
linkSource true
noTimestamp true
}
}
tasks.withType(Test) {
testLogging {
exceptionFormat "full"
events "failed", "started", "standard_out", "standard_error"
}
}
repositories {
mavenCentral()
}
jar {
manifest {
instructionReplace "Bundle-Vendor", "Reactive Streams SIG"
instructionReplace "Bundle-Description", "Reactive Streams API"
instructionReplace "Bundle-DocURL", "http://reactive-streams.org"
instructionReplace "Bundle-Version", "1.0.0.release"
}
}
if (name in ["reactive-streams", "reactive-streams-tck", "reactive-streams-examples"]) {
apply plugin: "maven"
apply plugin: "signing"
signing {
sign configurations.archives
required { gradle.taskGraph.hasTask(uploadArchives) }
}
task sourcesJar(type: Jar) {
classifier "sources"
from sourceSets.main.allSource
}
task javadocJar(type: Jar) {
classifier "javadoc"
from javadoc
}
artifacts {
archives sourcesJar, javadocJar
}
uploadArchives {
repositories {
mavenDeployer {
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(uploadArchives)) {
def userProp = "sonatypeOssUsername"
def passwordProp = "sonatypeOssPassword"
def user = project.properties[userProp]
def password = project.properties[passwordProp]
if (user == null || password == null) {
throw new InvalidUserDataException(
"Cannot perform $uploadArchives.path due to missing credentials.\n" +
"Run with command line args `-P$userProp=«username» -P$passwordProp=«password»` or add these properties to $gradle.gradleUserHomeDir/gradle.properties.\n")
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: user, password: password)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: user, password: password)
}
}
}
}
}
}
tasks.withType(Upload) {
repositories.withType(MavenResolver) {
it.beforeDeployment { signing.signPom(it) }
it.pom.whenConfigured { pom ->
pom.project {
url "http://www.reactive-streams.org/"
name "reactive-streams"
description "A Protocol for Asynchronous Non-Blocking Data Sequence"
inceptionYear "2014"
scm {
url "[email protected]:reactive-streams/reactive-streams.git"
connection "scm:git:[email protected]:reactive-streams/reactive-streams.git"
}
licenses {
license {
name "CC0"
url "http://creativecommons.org/publicdomain/zero/1.0/"
distribution "repo"
}
}
developers {
developer {
id "reactive-streams-sig"
name "Reactive Streams SIG"
url "http://www.reactive-streams.org/"
}
}
}
}
}
}
} else {
uploadArchives.enabled = false
}
}