-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathbuild.gradle
195 lines (159 loc) · 6.52 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
description = 'SQL commenter integration'
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: "maven-publish"
apply plugin: "net.ltgt.errorprone"
apply plugin: "jacoco"
apply plugin: "signing"
group = "com.google.cloud"
version = "2.0.0" // CURRENT_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.16'
classpath "gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.7.1"
}
}
def opencensusVersion = '0.28.3'
def errorProneVersion = '2.3.2'
def findBugsJsr305Version = '3.0.2'
def opentelemetryVersion = '1.5.0'
dependencies {
compile "io.opencensus:opencensus-api:${opencensusVersion}"
runtime "io.opencensus:opencensus-impl:${opencensusVersion}"
compileOnly "com.google.code.findbugs:jsr305:${findBugsJsr305Version}"
compileOnly "com.google.errorprone:error_prone_annotations:${errorProneVersion}"
errorprone "com.google.errorprone:error_prone_core:${errorProneVersion}"
implementation "io.opentelemetry:opentelemetry-api:${opentelemetryVersion}"
implementation "io.opentelemetry:opentelemetry-sdk:${opentelemetryVersion}"
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web
compile (group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.1.5.RELEASE') {
exclude group: 'org.apache.logging.log4j', module: 'log4j-to-slf4j'
}
compile 'org.apache.logging.log4j:log4j-to-slf4j:2.16.0'
compile 'org.hibernate:hibernate-core:5.4.3.Final'
testCompile 'junit:junit:4.12'
testCompile 'com.google.truth:truth:0.44'
testCompile 'org.mockito:mockito-core:1.9.5'
testCompile 'org.springframework.boot:spring-boot-starter-data-jpa:2.1.5.RELEASE'
testCompile 'org.springframework.boot:spring-boot-starter-test:2.1.5.RELEASE'
testCompile 'org.hsqldb:hsqldb:2.4.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"]
// We currently don't 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 "sqlcommenter-hibernate"
packaging 'jar'
description project.description
url 'https://github.com/google/sqlcommenter'
scm {
connection 'scm:svn:https://github.com/google/sqlcommenter'
developerConnection 'scm:git:[email protected]/google/sqlcommenter'
url 'https://github.com/google/sqlcommenter'
}
licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'com.google.cloud'
name 'Google Developers'
email '[email protected]'
url 'cloud.google.com'
// https://issues.gradle.org/browse/GRADLE-2719
organization = 'SQLCommenter Authors'
organizationUrl 'https://google.com'
}
}
}
}
}
}