-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
100 lines (90 loc) · 3.1 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.rodnansol:spring-configuration-property-documenter-gradle-plugin:${springConfigurationPropertyDocumenterVersion}"
}
}
plugins {
id "org.springframework.boot" version "${springBootVersion}" apply false
id "io.spring.dependency-management" version "${springDependencyManagementVersion}" apply false
id "com.diffplug.spotless" version "${spotlessVersion}" apply false
id "com.github.spotbugs" version "${spotbugsVersion}" apply false
id "com.google.protobuf" version "${protobufGradlePluginVersion}" apply false
id "org.graalvm.buildtools.native" version "${graalvmBuildToolsVersion}" apply false
}
allprojects {
if (it.name == "grpc-starter-dependencies") {
// skip the bom project
return
}
apply plugin: "java"
apply plugin: "java-library"
sourceSets {
optionalSupport
}
java {
registerFeature("optionalSupport") {
usingSourceSet(sourceSets.optionalSupport)
}
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
compileJava {
options.encoding = "UTF-8"
options.compilerArgs << "-parameters"
}
compileTestJava {
options.encoding = "UTF-8"
options.compilerArgs << "-parameters"
}
test {
useJUnitPlatform()
}
// dependency management
apply plugin: "io.spring.dependency-management"
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${springBootVersion}"
mavenBom "com.google.protobuf:protobuf-bom:${protobufVersion}"
mavenBom "io.grpc:grpc-bom:${grpcVersion}"
}
}
dependencies {
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testCompileOnly("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")
compileOnly("com.github.spotbugs:spotbugs-annotations:${spotbugsAnnotationsVersion}")
}
// spotless
apply plugin: "com.diffplug.spotless"
spotless {
encoding "UTF-8"
java {
toggleOffOn()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
palantirJavaFormat()
targetExclude "**/generated/**"
custom("Refuse wildcard imports", {
if (it =~ /\nimport .*\*;/) {
throw new IllegalStateException("Do not use wildcard imports, 'spotlessApply' cannot resolve this issue, please fix it manually.")
}
} as Closure<String>)
}
}
// spotbugs
apply plugin: "com.github.spotbugs"
spotbugs {
spotbugsTest.enabled = false
omitVisitors.addAll "FindReturnRef", "DontReusePublicIdentifiers"
excludeFilter = file("${rootDir}/config/spotbugs/exclude.xml")
}
}
apply from: "${rootDir}/gradle/generate-configuration-properties-docs.gradle"