-
Notifications
You must be signed in to change notification settings - Fork 531
/
build.gradle
154 lines (135 loc) · 4.87 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
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1"
}
}
subprojects {
apply plugin: "java-library"
apply plugin: 'biz.aQute.bnd.builder'
group = "org.reactivestreams"
version = "1.0.4"
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()
}
if (name in ["reactive-streams",
"reactive-streams-tck",
"reactive-streams-tck-flow",
"reactive-streams-examples"]) {
apply plugin: "maven"
apply plugin: "signing"
apply plugin: "maven-publish"
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
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
mavenLocal()
}
}
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 "MIT-0"
url "https://spdx.org/licenses/MIT-0.html"
distribution "repo"
}
}
developers {
developer {
id "reactive-streams-sig"
name "Reactive Streams SIG"
url "http://www.reactive-streams.org/"
}
}
}
}
}
}
} else {
uploadArchives.enabled = false
}
}