-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathbuild.gradle
More file actions
152 lines (130 loc) · 4.64 KB
/
build.gradle
File metadata and controls
152 lines (130 loc) · 4.64 KB
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
buildscript {
dependencies {
classpath 'com.palantir.javaformat:gradle-palantir-java-format:2.83.0'
}
}
plugins {
id 'com.netflix.nebula.netflixoss' version '13.0.0'
id "com.google.osdetector" version '1.7.3'
id 'me.champeau.jmh' version '0.7.2'
id 'org.openrewrite.rewrite' version '7.12.1'
id 'net.ltgt.errorprone' version '4.1.0'
id 'com.diffplug.spotless' version "8.1.0"
id 'idea'
}
ext.githubProjectName = rootProject.name
idea {
project {
languageLevel = '21'
}
}
configurations.all {
exclude group: 'asm', module: 'asm'
exclude group: 'asm', module: 'asm-all'
}
allprojects {
repositories {
mavenCentral()
}
apply plugin: 'com.diffplug.spotless'
spotless {
enforceCheck false
java {
rootProject.hasProperty('spotlessJavaTarget') ? target(rootProject.getProperty('spotlessJavaTarget').split(",")) : target('src/*/java/**/*.java')
removeUnusedImports('cleanthat-javaparser-unnecessaryimport')
palantirJavaFormat()
}
}
}
subprojects {
apply plugin: 'com.netflix.nebula.netflixoss'
apply plugin: 'java'
apply plugin: 'com.netflix.nebula.javadoc-jar'
apply plugin: 'com.netflix.nebula.dependency-lock'
apply plugin: 'me.champeau.jmh'
apply plugin: 'org.openrewrite.rewrite'
apply plugin: 'net.ltgt.errorprone'
license {
ignoreFailures = false
excludes([
"**/META-INF/services/javax.annotation.processing.Processor",
"**/META-INF/gradle/incremental.annotation.processors",
"**/*.cert",
"**/*.jks",
"**/*.key",
])
}
group = "com.netflix.${githubProjectName}"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
tasks.withType(JavaCompile).configureEach {
dependencies {
errorprone "com.uber.nullaway:nullaway:0.12.4"
errorprone "com.google.errorprone:error_prone_core:2.45.0"
}
options.compilerArgs << "-Werror"
options.errorprone {
check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.OFF)
option("NullAway:AnnotatedPackages", "com.netflix.zuul")
errorproneArgs.addAll(
// Uncomment and remove -Werror javac flag to automatically apply fixes for a check.
// N.B: disables all other checks while enabled.
// "-XepPatchChecks:UnnecessaryParentheses",
// "-XepPatchLocation:IN_PLACE",
"-Xep:ClassCanBeStatic:OFF",
"-Xep:EmptyBlockTag:OFF",
"-Xep:FutureReturnValueIgnored:OFF",
"-Xep:InlineMeSuggester:OFF",
"-Xep:MissingSummary:OFF",
)
}
}
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}
}
tasks.withType(Javadoc).each {
it.classpath = sourceSets.main.compileClasspath
// Ignore Javadoc warnings for now, re-enable after Zuul 3.
it.options.addStringOption('Xdoclint:none', '-quiet')
}
ext {
libraries = [
guava: "com.google.guava:guava:33.3.0-jre",
okhttp: 'com.squareup.okhttp3:okhttp:4.12.0',
jupiterApi: 'org.junit.jupiter:junit-jupiter-api:5.13.+',
jupiterParams: 'org.junit.jupiter:junit-jupiter-params:5.13.+',
jupiterEngine: 'org.junit.jupiter:junit-jupiter-engine:5.13.+',
junitPlatformLauncher: 'org.junit.platform:junit-platform-launcher:1.13.+',
jupiterMockito: 'org.mockito:mockito-junit-jupiter:5.13.+',
mockito: 'org.mockito:mockito-core:5.+',
slf4j: "org.slf4j:slf4j-api:2.0.16",
assertj: 'org.assertj:assertj-core:3.26.3',
awaitility: 'org.awaitility:awaitility:4.2.2',
lombok: 'org.projectlombok:lombok:1.18.42'
]
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
maxParallelForks = Runtime.runtime.availableProcessors();
}
}
dependencies {
rewrite(platform("org.openrewrite.recipe:rewrite-recipe-bom:3.12.1"))
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks")
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks")
rewrite("org.openrewrite.recipe:rewrite-static-analysis")
}
rewrite {
failOnDryRunResults = true
activeRecipe("org.openrewrite.java.testing.junit5.JUnit5BestPractices")
activeRecipe("org.openrewrite.java.logging.slf4j.Slf4jBestPractices")
}