forked from rsocket/rsocket-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
175 lines (150 loc) · 5.9 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
/*
* Copyright 2016 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
NOTE: plugins block cannot be used in script plugins
TODO: future versions of Gradle will remove this restriction
*/
// TODO: https://github.com/gradle/gradle/issues/1037
buildscript {
repositories {
maven { url ArtifactRepositoryContainer.MAVEN_CENTRAL_URL }
}
dependencies {
classpath("org.junit.platform:junit-platform-gradle-plugin:1.0.1")
}
}
plugins {
id 'com.gradle.build-scan' version '1.9' // declare before any other plugin
id 'com.github.sherter.google-java-format' version '0.6' apply false
id 'com.github.johnrengelman.shadow' version '2.0.1' apply false
id 'me.champeau.gradle.jmh' version '0.4.4' apply false
id 'io.morethan.jmhreport' version '0.6.2.1' apply false
id 'com.jfrog.artifactory' version '4.5.2'
id 'com.jfrog.bintray' version '1.7.3'
}
apply from: "$rootDir/gradle/configuration.gradle"
apply from: "$rootDir/gradle/versions.gradle"
apply from: "$rootDir/gradle/scan.gradle"
description = 'RSocket: stream oriented messaging passing with Reactive Stream semantics.'
subprojects {
apply from: "$rootDir/gradle/java.gradle"
apply from: "$rootDir/gradle/test.gradle"
apply from: "$rootDir/gradle/codestyle.gradle"
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.jfrog.artifactory'
group = 'io.rsocket'
version = mavenversion
// custom tasks for creating source/javadoc jars
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
tasks.bintrayUpload.dependsOn tasks.jar, tasks.sourcesJar, tasks.javadocJar
// add javadoc/source jar tasks as artifacts
artifacts {
archives sourcesJar, javadocJar, jar
}
dependencies {
compile "io.projectreactor:reactor-core:$reactorVersion"
compile "io.netty:netty-buffer:$nettyVersion"
compile "org.reactivestreams:reactive-streams:$reactiveStreamsVersion"
compile "org.slf4j:slf4j-api:$slf4jVersion"
compile "com.google.code.findbugs:jsr305:$jsr305Version"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.slf4j:slf4j-log4j12:$slf4jVersion"
testCompile "io.projectreactor:reactor-test:$reactorVersion"
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar {
classifier "sources"
}
artifact javadocJar {
classifier "javadoc"
}
}
}
}
artifactory {
publish {
contextUrl = 'https://oss.jfrog.org'
repository {
repoKey = 'oss-snapshot-local' //The Artifactory repository key to publish to
//when using oss.jfrog.org the credentials are from Bintray. For local build we expect them to be found in
//~/.gradle/gradle.properties, otherwise to be set in the build server
// Conditionalize for the users who don't have bintray credentials setup
if (project.hasProperty('bintrayUser')) {
username = project.property('bintrayUser')
password = project.property('bintrayKey')
}
}
publications('mavenJava')
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
}
}
}
artifactoryPublish {
dependsOn jar
}
bintray {
if (project.hasProperty('bintrayUser')) {
user = project.property('bintrayUser')
key = project.property('bintrayKey')
}
publications = ['mavenJava']
dryRun = false
publish = true
override = false
pkg {
repo = 'RSocket'
name = 'rsocket-java'
desc = 'RSocket'
websiteUrl = 'https://github.com/rsocket/rsocket-java'
issueTrackerUrl = 'https://github.com/rsocket/rsocket-java'
vcsUrl = 'https://github.com/rsocket/rsocket-java.git'
licenses = ['Apache-2.0']
githubRepo = 'rsocket/rsocket-java' //Optional Github repository
githubReleaseNotesFile = 'README.md' //Optional Github readme file
if (project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword')) {
def sonatypeUsername = project.property('sonatypeUsername')
def sonatypePassword = project.property('sonatypePassword')
version {
name = "v${project.version}"
vcsTag = "${project.version}"
mavenCentralSync {
sync = false
user = sonatypeUsername
password = sonatypePassword
}
}
}
}
}
}