Skip to content

Commit e143667

Browse files
committed
consolidate lint warning suppressions to the module plugin
1 parent 8aedc3b commit e143667

File tree

17 files changed

+2
-64
lines changed

17 files changed

+2
-64
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/ElasticsearchJavaModulePlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ static void configureCompileModulePath(Project project) {
9292
}).getFiles();
9393

9494
project.getTasks().named("compileJava", JavaCompile.class).configure(task -> {
95+
task.getOptions().getCompilerArgs().add("-Xlint:-module,-exports,-requires-automatic,-requires-transitive-automatic");
96+
9597
var argumentProvider = new CompileModulePathArgumentProvider(isModuleProject, moduleCompileClasspath);
9698
task.getOptions().getCompilerArgumentProviders().add(argumentProvider);
9799
FileCollection classpath = task.getClasspath();

libs/cli/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,3 @@ tasks.named("jarHell").configure { enabled = false }
2020
tasks.named('forbiddenApisMain').configure {
2121
replaceSignatureFiles 'jdk-signatures'
2222
}
23-
24-
tasks.named("compileJava").configure {
25-
options.compilerArgs.add("-Xlint:-exports,-requires-automatic,-requires-transitive-automatic")
26-
}

libs/core/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,3 @@ tasks.named("thirdPartyAudit").configure {
4141
'org/osgi/framework/wiring/BundleWiring'
4242
)
4343
}
44-
45-
tasks.named("compileJava").configure {
46-
options.compilerArgs.add("-Xlint:-module,-exports,-requires-automatic,-requires-transitive-automatic")
47-
}

libs/lz4/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,3 @@ tasks.named("thirdPartyAudit").configure {
3131
'net.jpountz.util.UnsafeUtils'
3232
)
3333
}
34-
35-
tasks.named("compileJava").configure {
36-
options.compilerArgs.add("-Xlint:-module,-exports,-requires-automatic,-requires-transitive-automatic")
37-
}

libs/ssl-config/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ dependencies {
1919
testImplementation "org.hamcrest:hamcrest:${versions.hamcrest}"
2020
}
2121

22-
tasks.named("compileJava").configure {
23-
options.compilerArgs.add("-Xlint:-exports,-missing-explicit-ctor")
24-
}
25-
2622
tasks.named('forbiddenApisMain').configure {
2723
replaceSignatureFiles 'jdk-signatures'
2824
}

libs/x-content/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ tasks.named("dependencyLicenses").configure {
6666
mapping from: /jackson-.*/, to: 'jackson'
6767
}
6868

69-
tasks.named("compileJava").configure {
70-
options.compilerArgs.add("-Xlint:-exports")
71-
}
72-
7369
File generatedResourcesDir = new File(buildDir, 'generated-resources')
7470
def generateProviderManifest = tasks.register("generateProviderManifest") {
7571
File manifestFile = new File(generatedResourcesDir, "LISTING.TXT")

modules/aggs-matrix-stats/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,3 @@ restResources {
1818
include '_common', 'indices', 'cluster', 'index', 'search', 'nodes'
1919
}
2020
}
21-
22-
tasks.named("compileJava").configure {
23-
options.compilerArgs.add("-Xlint:-exports,-missing-explicit-ctor")
24-
}

modules/lang-painless/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,6 @@ restResources {
5454
}
5555
}
5656

57-
tasks.named("compileJava").configure {
58-
options.compilerArgs.add("-Xlint:-exports,-requires-automatic,-missing-explicit-ctor")
59-
}
60-
6157
tasks.named("test").configure {
6258
// in WhenThingsGoWrongTests we intentionally generate an out of memory error, this prevents the heap from being dumped to disk
6359
jvmArgs '-XX:-OmitStackTraceInFastThrow', '-XX:-HeapDumpOnOutOfMemoryError'

modules/lang-painless/spi/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,3 @@ dependencies {
1616
compileOnly project(":server")
1717
testImplementation project(":test:framework")
1818
}
19-
20-
tasks.named("compileJava").configure {
21-
options.compilerArgs.add("-Xlint:-exports")
22-
}

modules/percolator/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ restResources {
2424
}
2525
}
2626

27-
tasks.named("compileJava").configure {
28-
options.compilerArgs.add("-Xlint:-exports,-missing-explicit-ctor")
29-
}
30-
3127
tasks.named("yamlRestTestV7CompatTransform").configure{ task ->
3228
task.addAllowedWarningRegex("\\[types removal\\].*")
3329
}

0 commit comments

Comments
 (0)