mirror of https://github.com/apache/lucene.git
Clean up MR-JAR build, so we do not have hardcoded "19" everywhere in validation tasks (#11835)
As long as soureSets are named "mainXX", with XX a feature version, we check everything automatically: - ECJ is disabled (we can't do a check without forking ECJ as a separate process using toolkit, we may support this later) - forbiddenapis (we disable checks for missing classes) - errorprone is disabled (errorprone does not work correctly at moment with forked compiler)
This commit is contained in:
parent
e5a226ec7c
commit
df94e6c005
|
@ -34,9 +34,7 @@ allprojects {
|
||||||
// Create a [sourceSetName]EcjLint task for each source set
|
// Create a [sourceSetName]EcjLint task for each source set
|
||||||
// with a non-empty java.srcDirs. These tasks are then
|
// with a non-empty java.srcDirs. These tasks are then
|
||||||
// attached to project's "ecjLint" task.
|
// attached to project's "ecjLint" task.
|
||||||
|
def lintTasks = sourceSets.collect { sourceSet ->
|
||||||
// TODO: Better way to disable on our MR-JAR
|
|
||||||
def lintTasks = sourceSets.findAll { it.name != 'main19' }.collect { sourceSet ->
|
|
||||||
def srcDirs = sourceSet.java.sourceDirectories
|
def srcDirs = sourceSet.java.sourceDirectories
|
||||||
.filter { dir -> dir.exists() }
|
.filter { dir -> dir.exists() }
|
||||||
|
|
||||||
|
@ -54,6 +52,11 @@ allprojects {
|
||||||
// that don't have any Java source directories.
|
// that don't have any Java source directories.
|
||||||
enabled = !srcDirs.isEmpty()
|
enabled = !srcDirs.isEmpty()
|
||||||
|
|
||||||
|
// Ignore MR-JAR sourceSets.
|
||||||
|
if (sourceSet.name ==~ /main\d+/) {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
classpath = rootProject.configurations.ecjDeps
|
classpath = rootProject.configurations.ecjDeps
|
||||||
mainClass = "org.eclipse.jdt.internal.compiler.batch.Main"
|
mainClass = "org.eclipse.jdt.internal.compiler.batch.Main"
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@ allprojects { prj ->
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) { task ->
|
tasks.withType(JavaCompile) { task ->
|
||||||
// TODO: Better way to disable on our MR-JAR
|
// Disable errorprone on the MR-JAR tasks
|
||||||
if (task.name == 'compileMain19Java') {
|
if (task.name ==~ /compileMain\d+Java/) {
|
||||||
options.errorprone.enabled = false
|
options.errorprone.enabled = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ allprojects { prj ->
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure defaults for sourceSets.main
|
// Configure defaults for sourceSets.main
|
||||||
tasks.matching { it.name in ["forbiddenApisMain", "forbiddenApisMain19"] }.all {
|
tasks.matching { it.name ==~ /forbiddenApisMain\d*/ }.all {
|
||||||
bundledSignatures += [
|
bundledSignatures += [
|
||||||
'jdk-unsafe',
|
'jdk-unsafe',
|
||||||
'jdk-deprecated',
|
'jdk-deprecated',
|
||||||
|
@ -76,10 +76,8 @@ allprojects { prj ->
|
||||||
// Configure defaults for the MR-JAR feature sourceSets by setting java version and ignore missing classes
|
// Configure defaults for the MR-JAR feature sourceSets by setting java version and ignore missing classes
|
||||||
// TODO:
|
// TODO:
|
||||||
// - Get hold of warning messages, see https://github.com/policeman-tools/forbidden-apis/issues/207
|
// - Get hold of warning messages, see https://github.com/policeman-tools/forbidden-apis/issues/207
|
||||||
// - Allow using newer bundled signatures, see: https://github.com/policeman-tools/forbidden-apis/issues/207
|
tasks.matching { it.name ==~ /forbiddenApisMain\d+/ }.all {
|
||||||
tasks.matching { it.name == "forbiddenApisMain19" }.all {
|
|
||||||
failOnMissingClasses = false
|
failOnMissingClasses = false
|
||||||
targetCompatibility = rootProject.minJavaVersion
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Configure defaults for sourceSets.test
|
// Configure defaults for sourceSets.test
|
||||||
|
|
Loading…
Reference in New Issue