-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
181 lines (148 loc) · 6.03 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
description = 'OpenCensus instrumented SpyMemcached wrapper'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "net.ltgt.errorprone"
apply plugin: "signing"
group = "io.orijtech.integrations"
version = "0.0.2" // CURRENT_OCSPYMEMCACHED_VERSION
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
jar.manifest {
attributes('Implementation-Title': name,
'Implementation-Version': version,
'Built-By': System.getProperty('user.name'),
'Built-JDK': System.getProperty('java.version'),
'Source-Compatibility': sourceCompatibility,
'Target-Compatibility': targetCompatibility)
}
buildscript {
repositories {
mavenCentral()
mavenLocal()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.0.13'
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.7.1"
}
}
def errorProneVersion = '2.3.1'
def findBugsJsr305Version = '3.0.2'
dependencies {
// https://mvnrepository.com/artifact/io.opencensus/opencensus-api
compile group: 'io.opencensus', name: 'opencensus-api', version: '0.18.0'
runtime group: 'io.opencensus', name: 'opencensus-impl', version: '0.18.0'
// https://mvnrepository.com/artifact/net.spy/spymemcached
compile group: 'net.spy', name: 'spymemcached', version: '2.12.3'
compileOnly "com.google.code.findbugs:jsr305:${findBugsJsr305Version}"
compileOnly "com.google.errorprone:error_prone_annotations:${errorProneVersion}"
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.30'
testCompile 'org.mockito:mockito-core:1.9.5'
// https://mvnrepository.com/artifact/io.opencensus/opencensus-impl
testCompile group: 'io.opencensus', name: 'opencensus-impl', version: '0.18.0'
}
compileJava {
// We suppress the "try" warning because it disallows managing an auto-closeable with
// try-with-resources without referencing the auto-closeable within the try block.
// We suppress the "processing" warning as suggested in
// https://groups.google.com/forum/#!topic/bazel-discuss/_R3A9TJSoPM
it.options.compilerArgs += ["-Xlint:all", "-Xlint:-try", "-Xlint:-processing"]
it.options.compilerArgs += ["-XepAllDisabledChecksAsWarnings", "-XepDisableWarningsInGeneratedCode"]
// MutableMethodReturnType can suggest returning Guava types from
// API methods (https://github.com/google/error-prone/issues/982).
it.options.compilerArgs += ["-Xep:MutableMethodReturnType:OFF"]
// ReturnMissingNullable conflicts with Checker Framework null analysis.
it.options.compilerArgs += ["-Xep:ReturnMissingNullable:OFF"]
// OpenCensus doesn't currently use Var annotations.
it.options.compilerArgs += ["-Xep:Var:OFF"]
it.options.encoding = "UTF-8"
it.options.compilerArgs += ["-Xlint:-cast"]
it.options.compilerArgs += ["-Werror"]
}
// Google formatter works only on java8.
if (JavaVersion.current().isJava8Compatible()) {
googleJavaFormat {
toolVersion '1.6'
}
afterEvaluate { // Allow subproject to add more source sets.
tasks.googleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
}
tasks.verifyGoogleJavaFormat {
source = sourceSets*.allJava
include '**/*.java'
}
}
}
compileJava {
options.compilerArgs += ["-Xlint:none"]
options.encoding = "UTF-8"
}
signing {
required false
sign configurations.archives
}
javadoc.options {
encoding = 'UTF-8'
links 'https://docs.oracle.com/javase/8/docs/api/'
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives javadocJar, sourcesJar
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
def configureAuth = {
if (rootProject.hasProperty('ossrhUsername') && rootProject.hasProperty('ossrhPassword')) {
authentication(userName:rootProject.ossrhUsername, password: rootProject.ossrhPassword)
}
}
repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/", configureAuth)
snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/", configureAuth)
pom.project {
name "opencensus-spymemcached"
packaging 'jar'
description project.description
url 'https://github.com/orijtech/ocspymemcached'
scm {
connection 'scm:svn:https://github.com/orijtech/ocspymemcached'
developerConnection 'scm:git:[email protected]/orijtech/ocspymemcached'
url 'https://github.com/orijtech/ocspymemcached'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'io.opencensus'
name 'OpenCensus Contributors'
email '[email protected]'
url 'opencensus.io'
// https://issues.gradle.org/browse/GRADLE-2719
organization = 'OpenCensus Authors'
organizationUrl 'https://www.opencensus.io'
}
}
}
}
}
}