This repository has been archived by the owner on Mar 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
build.gradle
254 lines (222 loc) · 8.47 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
buildscript {
apply from: file('versions.gradle')
}
plugins {
id "scala"
id "com.github.maiflai.scalatest" version "0.25"
id "signing"
id "maven"
id "org.scoverage" version "4.0.1"
id "io.codearte.nexus-staging" version "0.21.1"
id "org.owasp.dependencycheck" version "5.3.2"
id "com.github.ben-manes.versions" version "0.27.0"
// id "com.jfrog.bintray" version "1.8.4"
id "maven-publish"
id "net.researchgate.release" version "2.8.1" apply false
}
group 'io.projectreactor'
description = 'A scala extension for Project Reactor Flux and Mono'
repositories {
mavenCentral()
}
configurations {
scalaAnt
}
dependencies {
scalaAnt 'com.sandinh:scala-ant_2.13:2.13.1'
zinc "com.typesafe.zinc:zinc:0.3.15"
implementation libraries.catsEffect
implementation libraries.scalaLibrary
implementation libraries.reactorCore
implementation libraries.scalaCollCompat
// test dependencies
testImplementation libraries.scalatest
testImplementation libraries.reactorTest
testImplementation libraries.micrometer
testImplementation libraries.mockitoInline
testImplementation libraries.mockitoScala
testImplementation libraries.scalaLogging
testRuntimeOnly libraries.logback
}
scaladoc {
scalaClasspath += baseScalaVersion == "2.13"? configurations.scalaAnt : layout.files()
}
dependencyCheck {
skipConfigurations = ["apiElements", "implementation", "runtimeElements", "runtimeOnly", "testImplementation", "testRuntimeOnly", "scoverageImplementation", "scoverageRuntimeOnly"]
}
targetCompatibility = "1.8"
if (!project.parent) {
apply plugin: 'net.researchgate.release'
final svs = ['2.13.2', '2.12.11']
svs.eachWithIndex { sv, i ->
String scalaVersionInDot = sv.replaceAll("_", ".")
tasks.create(name: "build_$sv", type: GradleBuild) {
buildName = "build_${sv}"
buildFile = './build.gradle'
tasks = ['build']
startParameter.projectProperties = [scalaVersion: "${scalaVersionInDot}"]
//don't run parallel build tasks
mustRunAfter svs.take(i).collect{"build_${it}"}
}
tasks.create(name: "uploadArchives_${sv}", type: GradleBuild) {
buildName = "uploadArchives_${sv}"
buildFile = './build.gradle'
tasks = ['uploadArchives']
startParameter.projectProperties = [scalaVersion: "${scalaVersionInDot}"]
//don't run parallel uploadArchives tasks
mustRunAfter svs.take(i).collect{"uploadArchives_${it}"}
}
}
tasks.create(name: "buildAll", dependsOn: svs.collect{"build_${it}"}) {}
tasks.create(name: "uploadArchivesAll", dependsOn: svs.collect{"uploadArchives_${it}"}) {}
project.task("releaseAll", description: 'Verify project, release and update version to next.', group: "Release", type: GradleBuild) {
startParameter = project.getGradle().startParameter.newInstance()
tasks = [
'createScmAdapter', 'checkCommitNeeded', 'checkUpdateNeeded', 'unSnapshotVersion',
'confirmReleaseVersion', 'checkSnapshotDependencies', 'buildAll',
'preTagCommit', 'createReleaseTag', 'updateVersion', 'commitNewVersion'
]
}
project.createReleaseTag.dependsOn {
project.uploadArchivesAll
}
project.updateVersion.dependsOn {
"uploadArchives_${svs.last()}"
}
}
archivesBaseName = "${rootProject.name}_$baseScalaVersion"
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task scaladocJar(type: Jar, dependsOn: scaladoc) {
classifier = 'javadoc'
from scaladoc.destinationDir
}
artifacts {
archives jar
archives sourcesJar
archives scaladocJar
}
ext.sonatypeUsername = hasProperty("ossrhUsername") ? ossrhUsername : System.getenv("ossrhUsername")
ext.sonatypePassword = hasProperty("ossrhPassword") ? ossrhPassword : System.getenv("ossrhPassword")
//ext.bintrayUsername = hasProperty("bintrayUser") ? bintrayUser : System.getenv("ossrhUsername")
//ext.bintrayKey = hasProperty("bintrayApiKey") ? bintrayApiKey : System.getenv("ossrhPassword")
/*
bintray {
user = "$bintrayUsername"
key = "$bintrayKey"
publications = ['MyPublication']
configurations = ['archives']
pkg {
repo = "${project.group}"
name = "${project.archivesBaseName}"
version {
name = "${project.version}"
released = new Date()
}
}
}
*/
publishing {
publications {
MyPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact scaladocJar
groupId "${project.group}"
artifactId "${project.archivesBaseName}"
version "${project.version}"
pom {
name = "reactor-scala-extensions"
description = "Reactor Scala Extensions"
url = "https://github.com/reactor/reactor-scala-extensions"
licenses {
license {
name = "Apache License"
url = "https://github.com/reactor/reactor-scala-extensions/blob/master/LICENSE"
}
}
developers {
developer {
id = "sinwe"
name = "Winarto Zhao"
email = "winarto@gmail.com"
}
}
scm {
connection = "scm:git:https://github.com/reactor/reactor-scala-extensions.git"
developerConnection = "scm:git:https://github.com/reactor/reactor-scala-extensions.git"
url = "https://github.com/reactor/reactor-scala-extensions.git"
}
}
}
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> isReleaseVersion ? signing.signPom(deployment): void}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots") {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name 'Scala Extensions for reactor-core'
packaging 'jar'
// optionally artifactId can be defined here
description 'A scala extensions for Project Reactor Flux and Mono so that the code can be fluently used in Scala'
url 'https://github.com/reactor/reactor-scala-extensions'
scm {
connection 'scm:git:git@github.com:reactor/reactor-scala-extensions.git'
developerConnection 'scm:git:git@github.com:reactor/reactor-scala-extensions.git'
url 'https://github.com/reactor/reactor-scala-extensions'
}
licenses {
license {
name 'Apache License, Version 2.0, January 2004'
url 'https://www.apache.org/licenses/LICENSE-2.0.html'
}
}
developers {
developer {
id 'sinwe'
name 'Winarto'
email 'winarto@gmail.com'
}
}
}
}
}
}
//bintrayUpload.onlyIf {isReleaseVersion}
afterReleaseBuild.dependsOn uploadArchives
//uploadArchives.dependsOn bintrayUpload
ScalaCompileOptions.metaClass.daemonServer = true
ScalaCompileOptions.metaClass.fork = true
ScalaCompileOptions.metaClass.useAnt = false
ScalaCompileOptions.metaClass.useCompileDaemon = false
project.tasks.scaladoc.scalaDocOptions.additionalParameters = ["-no-link-warnings"]
project.tasks.compileScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8", "-feature"]
project.tasks.compileTestScala.scalaCompileOptions.additionalParameters = ["-target:jvm-1.8"]
release {
git {
requireBranch = ''
}
}
test {
maxParallelForks = 1
reports.html.enabled = false
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
signing {
required { isReleaseVersion }
useGpgCmd()
sign configurations.archives
// sign publishing.publications.MyPublication
}