Apache Lucene open-source search software
LUCENE-9375: cleaning up post-split conditional build logic and solr refs. (#22)
Dawid Weiss53bea546694c
diff --git a/build.gradle b/build.gradleindex 8f02892eef5..5c0bacac4e0 100644--- a/build.gradle+++ b/build.gradle@@ -54,9 +54,6 @@ allprojects {}ext {- skipSolr = (System.getProperty("skip.solr") as Boolean)- skipLucene = (System.getProperty("skip.lucene") as Boolean)-// "base" version is stripped of the qualifier. Compute it.baseVersion = {def m = (version =~ /^(\d+\.\d+\.\d+)(-(.+))?/)@@ -148,19 +145,15 @@ apply from: file('gradle/validation/ecj-lint.gradle')apply from: file('gradle/validation/gradlew-scripts-tweaked.gradle')apply from: file('gradle/validation/check-broken-links.gradle')-if (!skipLucene) {- apply from: file('gradle/validation/spotless.gradle')-}+apply from: file('gradle/validation/spotless.gradle')// Source or data regeneration tasks-if (!skipLucene) {- apply from: file('gradle/generation/jflex.gradle')- apply from: file('gradle/generation/util.gradle')- apply from: file('gradle/generation/snowball.gradle')- apply from: file('gradle/generation/kuromoji.gradle')- apply from: file('gradle/generation/nori.gradle')- apply from: file('gradle/generation/icu.gradle')-}+apply from: file('gradle/generation/jflex.gradle')+apply from: file('gradle/generation/util.gradle')+apply from: file('gradle/generation/snowball.gradle')+apply from: file('gradle/generation/kuromoji.gradle')+apply from: file('gradle/generation/nori.gradle')+apply from: file('gradle/generation/icu.gradle')apply from: file('gradle/generation/javacc.gradle')// Shared configuration of subprojects containing native code.@@ -179,10 +172,7 @@ apply from: file('gradle/help.gradle')// here so that we can coexist with current ant build but they are indicative// of potential problems with the build conventions, dependencies, etc.apply from: file('gradle/ant-compat/misc.gradle')--if (!skipLucene) {- apply from: file('gradle/ant-compat/test-classes-cross-deps.gradle')-}+apply from: file('gradle/ant-compat/test-classes-cross-deps.gradle')apply from: file('gradle/documentation/documentation.gradle')apply from: file('gradle/documentation/changes-to-html.gradle')@@ -192,7 +182,3 @@ apply from: file('gradle/documentation/render-javadoc.gradle')apply from: file('gradle/hacks/gradle-archives.gradle')apply from: file('gradle/hacks/gradle.gradle')apply from: file('gradle/hacks/hashmapAssertions.gradle')--if (skipLucene) {- apply from: file('gradle/solr-tlp-migration/inaccessible-test-sources.gradle')-}diff --git a/gradle/ant-compat/misc.gradle b/gradle/ant-compat/misc.gradleindex 95eb5df2d7b..b0494dd4bfa 100644--- a/gradle/ant-compat/misc.gradle+++ b/gradle/ant-compat/misc.gradle@@ -23,25 +23,23 @@ allprojects {}}-if (!skipLucene) {- // Exclude test classes that are not actually stand-alone tests (they're executed from other stuff).- configure(project(":lucene:replicator")) {- plugins.withType(JavaPlugin) {- test {- exclude "**/SimpleServer*"- }+// Exclude test classes that are not actually stand-alone tests (they're executed from other stuff).+configure(project(":lucene:replicator")) {+ plugins.withType(JavaPlugin) {+ test {+ exclude "**/SimpleServer*"}}+}- // Resources from top-level project folder are looked up via getClass(). Strange.- configure(project(":lucene:benchmark")) {- plugins.withType(JavaPlugin) {- task syncConf(type: Sync) {- from('conf')- into file("${sourceSets.test.java.outputDir}/conf")- }- processTestResources.dependsOn syncConf+// Resources from top-level project folder are looked up via getClass(). Strange.+configure(project(":lucene:benchmark")) {+ plugins.withType(JavaPlugin) {+ task syncConf(type: Sync) {+ from('conf')+ into file("${sourceSets.test.java.outputDir}/conf")}+ processTestResources.dependsOn syncConf}-}\ No newline at end of file+}diff --git a/gradle/documentation/changes-to-html.gradle b/gradle/documentation/changes-to-html.gradleindex f80a3ed7426..b11a0278c54 100644--- a/gradle/documentation/changes-to-html.gradle+++ b/gradle/documentation/changes-to-html.gradle@@ -17,7 +17,7 @@def resources = scriptResources(buildscript)-configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path == ':solr:documentation' }) {+configure(project(':lucene:documentation')) {task changesToHtml(type: ChangesToHtmlTask) {siteDir = resourcesscript = file("${resources}/changes2html.pl")diff --git a/gradle/documentation/documentation.gradle b/gradle/documentation/documentation.gradleindex 81531c02c1d..9849d874ca1 100644--- a/gradle/documentation/documentation.gradle+++ b/gradle/documentation/documentation.gradle@@ -34,17 +34,14 @@ configure(rootProject) {group = 'documentation'description = 'Generate all documentation'- if (!skipLucene) {- dependsOn ':lucene:documentation:assemble'- }+ dependsOn ':lucene:documentation:assemble'}assemble.dependsOn documentation}// docroot will point to Lucene and Solr relative directory for each sub-project.-configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path == ':solr:documentation' }) {-+configure(project(':lucene:documentation')) {ext {docroot = file("${buildDir}/site")docrootMinimal = file("${buildDir}/minimalSite")@@ -85,7 +82,7 @@ configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path ==}}-configure(subprojects.findAll { it.path == ':lucene' || it.path == ':solr' }) {+configure(project(":lucene")) {ext {docroot = project('documentation').docrootdocrootMinimal = project('documentation').docrootMinimaldiff --git a/gradle/documentation/markdown.gradle b/gradle/documentation/markdown.gradleindex 02a29407767..38a50ad1e85 100644--- a/gradle/documentation/markdown.gradle+++ b/gradle/documentation/markdown.gradle@@ -40,7 +40,7 @@ buildscript {}}-configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path == ':solr:documentation' }) {+configure(project(':lucene:documentation')) {task markdownToHtml(type: Copy) {dependsOn copyDocumentationAssets@@ -52,40 +52,38 @@ configure(subprojects.findAll { it.path == ':lucene:documentation' || it.path ==}}-if (!skipLucene) {- configure(project(':lucene:documentation')) {- markdownToHtml {- from(project.parent.projectDir) {- include 'MIGRATE.md'- include 'JRE_VERSION_MIGRATION.md'- include 'SYSTEM_REQUIREMENTS.md'- }+configure(project(':lucene:documentation')) {+ markdownToHtml {+ from(project.parent.projectDir) {+ include 'MIGRATE.md'+ include 'JRE_VERSION_MIGRATION.md'+ include 'SYSTEM_REQUIREMENTS.md'}+ }- task createDocumentationIndex(type: MarkdownTemplateTask) {- dependsOn markdownToHtml+ task createDocumentationIndex(type: MarkdownTemplateTask) {+ dependsOn markdownToHtml- outputFile = file("${project.docroot}/index.html")- templateFile = file("${project.markdownSrc}/index.template.md")+ outputFile = file("${project.docroot}/index.html")+ templateFile = file("${project.markdownSrc}/index.template.md")- def defaultCodecFile = project(':lucene:core').file('src/java/org/apache/lucene/codecs/Codec.java')- inputs.file(defaultCodecFile)+ def defaultCodecFile = project(':lucene:core').file('src/java/org/apache/lucene/codecs/Codec.java')+ inputs.file(defaultCodecFile)- // list all properties used by the template here to allow uptodate checks to be correct:- inputs.property('version', project.version)+ // list all properties used by the template here to allow uptodate checks to be correct:+ inputs.property('version', project.version)- binding.put('defaultCodecPackage', providers.provider {- // static Codec defaultCodec = LOADER . lookup ( "LuceneXXX" ) ;- def regex = ~/\bdefaultCodec\s*=\s*LOADER\s*\.\s*lookup\s*\(\s*"([^"]+)"\s*\)\s*;/- def matcher = regex.matcher(defaultCodecFile.getText('UTF-8'))- if (!matcher.find()) {- throw GradleException("Cannot determine default codec from file ${defaultCodecFile}")- }- return matcher.group(1).toLowerCase(Locale.ROOT)- })+ binding.put('defaultCodecPackage', providers.provider {+ // static Codec defaultCodec = LOADER . lookup ( "LuceneXXX" ) ;+ def regex = ~/\bdefaultCodec\s*=\s*LOADER\s*\.\s*lookup\s*\(\s*"([^"]+)"\s*\)\s*;/+ def matcher = regex.matcher(defaultCodecFile.getText('UTF-8'))+ if (!matcher.find()) {+ throw GradleException("Cannot determine default codec from file ${defaultCodecFile}")+ }+ return matcher.group(1).toLowerCase(Locale.ROOT)+ })- withProjectList()- }+ withProjectList()}}diff --git a/gradle/documentation/render-javadoc.gradle b/gradle/documentation/render-javadoc.gradleindex 5d5a2912b1d..eecbffb28c8 100644--- a/gradle/documentation/render-javadoc.gradle+++ b/gradle/documentation/render-javadoc.gradle@@ -401,7 +401,7 @@ class RenderJavadocTask extends DefaultTask {!project.file("$dir/element-list").exists()) {throw new GradleException("Expected pre-rendered package-list or element-list at ${dir}.")}- logger.lifecycle("Linking ${url} to ${dir}")+ logger.info("Linking ${url} to ${dir}")opts << [ '-linkoffline', url, dir ]}diff --git a/gradle/generation/javacc.gradle b/gradle/generation/javacc.gradleindex 088b328fd47..df1c7fa0ca8 100644--- a/gradle/generation/javacc.gradle+++ b/gradle/generation/javacc.gradle@@ -100,76 +100,75 @@ def commonCleanups = { FileTree generatedFiles ->}}-if (!skipLucene) {- configure(project(":lucene:queryparser")) {- task javaccParserClassic(type: JavaCCTask) {- description "Regenerate classic query parser from lucene/queryparser/classic/QueryParser.jj"- group "generation"-- javaccFile = file('src/java/org/apache/lucene/queryparser/classic/QueryParser.jj')-- afterGenerate << commonCleanups- afterGenerate << { FileTree generatedFiles ->- generatedFiles.matching { include "QueryParser.java" }.each { file ->- modifyFile(file, { text ->- text = text.replace(- "public QueryParser(CharStream ",- "protected QueryParser(CharStream ")- text = text.replace(- "public QueryParser(QueryParserTokenManager ",- "protected QueryParser(QueryParserTokenManager ")- text = text.replace(- "new java.util.ArrayList<int[]>",- "new java.util.ArrayList<>")- text = text.replace(- "final private LookaheadSuccess jj_ls =",- "static final private LookaheadSuccess jj_ls =")- return text- })- }+configure(project(":lucene:queryparser")) {+ task javaccParserClassic(type: JavaCCTask) {+ description "Regenerate classic query parser from lucene/queryparser/classic/QueryParser.jj"+ group "generation"++ javaccFile = file('src/java/org/apache/lucene/queryparser/classic/QueryParser.jj')++ afterGenerate << commonCleanups+ afterGenerate << { FileTree generatedFiles ->+ generatedFiles.matching { include "QueryParser.java" }.each { file ->+ modifyFile(file, { text ->+ text = text.replace(+ "public QueryParser(CharStream ",+ "protected QueryParser(CharStream ")+ text = text.replace(+ "public QueryParser(QueryParserTokenManager ",+ "protected QueryParser(QueryParserTokenManager ")+ text = text.replace(+ "new java.util.ArrayList<int[]>",+ "new java.util.ArrayList<>")+ text = text.replace(+ "final private LookaheadSuccess jj_ls =",+ "static final private LookaheadSuccess jj_ls =")+ return text+ })}}+ }++ task javaccParserSurround(type: JavaCCTask) {+ description "Regenerate surround query parser from lucene/queryparser/surround/parser/QueryParser.jj"+ group "generation"- task javaccParserSurround(type: JavaCCTask) {- description "Regenerate surround query parser from lucene/queryparser/surround/parser/QueryParser.jj"- group "generation"-- javaccFile = file('src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj')-- afterGenerate << commonCleanups- afterGenerate << { FileTree generatedFiles ->- generatedFiles.matching { include "QueryParser.java" }.each { file ->- modifyFile(file, { text ->- text = text.replace(- "import org.apache.lucene.analysis.TokenStream;",- "")- text = text.replace(- "new java.util.ArrayList<int[]>",- "new java.util.ArrayList<>")- return text- })- }+ javaccFile = file('src/java/org/apache/lucene/queryparser/surround/parser/QueryParser.jj')++ afterGenerate << commonCleanups+ afterGenerate << { FileTree generatedFiles ->+ generatedFiles.matching { include "QueryParser.java" }.each { file ->+ modifyFile(file, { text ->+ text = text.replace(+ "import org.apache.lucene.analysis.TokenStream;",+ "")+ text = text.replace(+ "new java.util.ArrayList<int[]>",+ "new java.util.ArrayList<>")+ return text+ })}}+ }- task javaccParserFlexible(type: JavaCCTask) {- description "Regenerate Flexible query parser from queryparser/flexible/standard/parser/StandardSyntaxParser.jj"- group "generation"+ task javaccParserFlexible(type: JavaCCTask) {+ description "Regenerate Flexible query parser from queryparser/flexible/standard/parser/StandardSyntaxParser.jj"+ group "generation"- javaccFile = file('src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj')+ javaccFile = file('src/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParser.jj')- afterGenerate << commonCleanups- afterGenerate << { FileTree generatedFiles ->- generatedFiles.matching { include "ParseException.java" }.each { file ->- modifyFile(file, { text ->- // Modify constructor.- text = text.replace(- "class ParseException extends Exception",- "class ParseException extends QueryNodeParseException")+ afterGenerate << commonCleanups+ afterGenerate << { FileTree generatedFiles ->+ generatedFiles.matching { include "ParseException.java" }.each { file ->+ modifyFile(file, { text ->+ // Modify constructor.+ text = text.replace(+ "class ParseException extends Exception",+ "class ParseException extends QueryNodeParseException")- // Modify imports.- text = text.replace(- "package org.apache.lucene.queryparser.flexible.standard.parser;", '''\+ // Modify imports.+ text = text.replace(+ "package org.apache.lucene.queryparser.flexible.standard.parser;", '''\package org.apache.lucene.queryparser.flexible.standard.parser;import org.apache.lucene.queryparser.flexible.messages.*;@@ -177,9 +176,9 @@ if (!skipLucene) {import org.apache.lucene.queryparser.flexible.core.messages.*;''')- // Modify constructors and code bits- text = text.replaceAll(- /(?s)[ ]*public ParseException\(Token currentTokenVal[^}]+[}]/, '''\+ // Modify constructors and code bits+ text = text.replaceAll(+ /(?s)[ ]*public ParseException\(Token currentTokenVal[^}]+[}]/, '''\public ParseException(Token currentTokenVal,int[][] expectedTokenSequencesVal, String[] tokenImageVal){@@ -191,67 +190,66 @@ if (!skipLucene) {}''')- text = text.replaceAll(- /(?s)[ ]*public ParseException\(String message\)[^}]+[}]/, '''\+ text = text.replaceAll(+ /(?s)[ ]*public ParseException\(String message\)[^}]+[}]/, '''\public ParseException(Message message){super(message);}''')- text = text.replaceAll(- /(?s)[ ]*public ParseException\(\)[^}]+[}]/, '''\+ text = text.replaceAll(+ /(?s)[ ]*public ParseException\(\)[^}]+[}]/, '''\public ParseException(){super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, "Error"));}''')- return text- })- }-- generatedFiles.matching { include "StandardSyntaxParser.java" }.each { file ->- modifyFile(file, { text ->- // Remove redundant cast- text = text.replace(- "new java.util.ArrayList<int[]>",- "new java.util.ArrayList<>")- text = text.replace(- "new ArrayList<QueryNode>()",- "new ArrayList<>()")- text = text.replace(- "Collections.<QueryNode> singletonList",- "Collections.singletonList")- return text- })- }+ return text+ })+ }++ generatedFiles.matching { include "StandardSyntaxParser.java" }.each { file ->+ modifyFile(file, { text ->+ // Remove redundant cast+ text = text.replace(+ "new java.util.ArrayList<int[]>",+ "new java.util.ArrayList<>")+ text = text.replace(+ "new ArrayList<QueryNode>()",+ "new ArrayList<>()")+ text = text.replace(+ "Collections.<QueryNode> singletonList",+ "Collections.singletonList")+ return text+ })}}+ }- task regenerate() {- description "Regenerate any generated sources"- group "generation"+ task regenerate() {+ description "Regenerate any generated sources"+ group "generation"- // Run regeneration tasks.- dependsOn javaccParserClassic, javaccParserSurround, javaccParserFlexible+ // Run regeneration tasks.+ dependsOn javaccParserClassic, javaccParserSurround, javaccParserFlexible- // Clean up and reformat the generated sources after generation.- dependsOn "tidy"- }+ // Clean up and reformat the generated sources after generation.+ dependsOn "tidy"+ }- // Make sure tidy runs after generation, if they're defined.- tasks.matching { it.name == "tidy" }.configureEach {- mustRunAfter javaccParserClassic, javaccParserSurround, javaccParserFlexible- }+ // Make sure tidy runs after generation, if they're defined.+ tasks.matching { it.name == "tidy" }.configureEach {+ mustRunAfter javaccParserClassic, javaccParserSurround, javaccParserFlexible+ }- task javacc() {- description "Regenerate query parsers (javacc syntax definitions)."- group "generation"+ task javacc() {+ description "Regenerate query parsers (javacc syntax definitions)."+ group "generation"- dependsOn javaccParserClassic- dependsOn javaccParserSurround- dependsOn javaccParserFlexible- }+ dependsOn javaccParserClassic+ dependsOn javaccParserSurround+ dependsOn javaccParserFlexible}}diff --git a/gradle/ide/eclipse.gradle b/gradle/ide/eclipse.gradleindex 12e1bdc95a6..7de2b79e491 100644--- a/gradle/ide/eclipse.gradle+++ b/gradle/ide/eclipse.gradle@@ -27,7 +27,7 @@ configure(rootProject) {eclipse {project {- name = "Apache Lucene Solr ${version}"+ name = "Apache Lucene ${version}"}classpath {@@ -38,8 +38,7 @@ configure(rootProject) {whenMerged { classpath ->def projects = allprojects.findAll { prj ->- return prj.plugins.hasPlugin(JavaPlugin) &&- prj.path != ":solr:solr-ref-guide"+ return prj.plugins.hasPlugin(JavaPlugin)}Set<String> sources = []diff --git a/gradle/jar-manifest.gradle b/gradle/jar-manifest.gradleindex a2a4be3b34c..5915a8c7817 100644--- a/gradle/jar-manifest.gradle+++ b/gradle/jar-manifest.gradle@@ -20,70 +20,61 @@subprojects {// Declare these inline for now. Don't know if it makes sense to declare them// per-project.- def title;- def implementationTitle;- def legaleseDir;- if (project.path.startsWith(":lucene")) {- implementationTitle = "org.apache.lucene"- title = "Lucene Search Engine: ${project.name}"- legaleseDir = project(":lucene").projectDir- } else {- implementationTitle = "org.apache.solr"- title = "Apache Solr Search Server: ${project.name}"- legaleseDir = project(":solr").projectDir- }+ def title = "Lucene Search Engine: ${project.name}"+ def implementationTitle = "org.apache.lucene"+ def legaleseDir = project(":lucene").projectDir// Apply the manifest to any JAR or WAR file created by any project,// excluding those explicitly listed.tasks.withType(Jar)- .matching { t -> !["sourcesJar", "javadocJar"].contains(t.name) }- .configureEach { task ->- // Compute git status once on the root project prior to assembling manifest.- dependsOn ":gitStatus"+ .matching { t -> !["sourcesJar", "javadocJar"].contains(t.name) }+ .configureEach { task ->+ // Compute git status once on the root project prior to assembling manifest.+ dependsOn ":gitStatus"- // Because git status is a task we must defer computing this- // until status has been computed. We do this with a provider.- def implementationVersion = provider {- // LUCENE-9310: gitRev should always be there but IntelliJ does something- // awkward on import and resolves provider properties even though task dependencies- // have not been run yet?- def gitRev = rootProject.hasProperty("gitRev") ? rootProject.gitRev : ""+ // Because git status is a task we must defer computing this+ // until status has been computed. We do this with a provider.+ def implementationVersion = provider {+ // LUCENE-9310: gitRev should always be there but IntelliJ does something+ // awkward on import and resolves provider properties even though task dependencies+ // have not been run yet?+ def gitRev = rootProject.hasProperty("gitRev") ? rootProject.gitRev : ""- // For snapshot builds just include the project version and gitRev so that- // JARs don't need to be recompiled just because the manifest has changed.- if (snapshotBuild) {- return "${project.version} ${gitRev} [snapshot build, details omitted]"- } else {- return "${project.version} ${gitRev} - ${System.properties['user.name']} - ${buildDate} ${buildTime}"- }- }+ // For snapshot builds just include the project version and gitRev so that+ // JARs don't need to be recompiled just because the manifest has changed.+ if (snapshotBuild) {+ return "${project.version} ${gitRev} [snapshot build, details omitted]"+ } else {+ return "${project.version} ${gitRev} - ${System.properties['user.name']} - ${buildDate} ${buildTime}"+ }+ }- manifest {- attributes([- "Extension-Name" : implementationTitle,+ manifest {+ attributes([+ "Extension-Name" : implementationTitle,- "Implementation-Vendor" : "The Apache Software Foundation",- "Implementation-Title" : implementationTitle,- "Implementation-Version": implementationVersion,+ "Implementation-Vendor" : "The Apache Software Foundation",+ "Implementation-Title" : implementationTitle,+ "Implementation-Version": implementationVersion,- "Specification-Vendor" : "The Apache Software Foundation",- "Specification-Version" : project.baseVersion,- "Specification-Title" : title,+ "Specification-Vendor" : "The Apache Software Foundation",+ "Specification-Version" : project.baseVersion,+ "Specification-Title" : title,- "X-Compile-Source-JDK" : "${project.sourceCompatibility}",- "X-Compile-Target-JDK" : "${project.targetCompatibility}",+ "X-Compile-Source-JDK" : "${project.sourceCompatibility}",+ "X-Compile-Target-JDK" : "${project.targetCompatibility}",- "X-Build-JDK" : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",- "X-Build-OS" : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"- ])- }+ "X-Build-JDK" : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",+ "X-Build-OS" : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"+ ])+ }- // Copy legalese into META-INF.- metaInf {- from(legaleseDir, {- include "LICENSE.txt"- include "NOTICE.txt"- })- }- }+ // Copy legalese into META-INF.+ metaInf {+ from(legaleseDir, {+ include "LICENSE.txt"+ include "NOTICE.txt"+ })+ }+ }}\ No newline at end of filediff --git a/gradle/testing/defaults-tests.gradle b/gradle/testing/defaults-tests.gradleindex fcebf55714b..ac6716360e1 100644--- a/gradle/testing/defaults-tests.gradle+++ b/gradle/testing/defaults-tests.gradle@@ -63,9 +63,7 @@ allprojects {testsCwd = file("${buildDir}/tmp/tests-cwd")testsTmpDir = file(resolvedTestOption("tests.workDir"))- if (!skipLucene) {- commonDir = project(":lucene").projectDir- }+ commonDir = project(":lucene").projectDir}def verboseMode = resolvedTestOption("tests.verbose").toBoolean()diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradleindex 9aabb1be3b0..370b6920dad 100644--- a/gradle/testing/randomization.gradle+++ b/gradle/testing/randomization.gradle@@ -106,25 +106,6 @@ allprojects {}}-// Add Solr-specific test configs settings.-configure(allprojects.findAll {project -> project.path.startsWith(":solr") }) {- plugins.withType(JavaPlugin) {- ext {- testOptions += [- [propName: 'tests.luceneMatchVersion', value: baseVersion, description: "Base Lucene version."],- [propName: 'common-solr.dir',- value: project(":solr").projectDir,- description: "Solr base dir.",- includeInReproLine: false- ],- [propName: 'solr.directoryFactory', value: "org.apache.solr.core.MockDirectoryFactory", description: "Solr directory factory."],- [propName: 'tests.src.home', value: null, description: "See SOLR-14023."],- [propName: 'solr.tests.use.numeric.points', value: null, description: "Point implementation to use (true=numerics, false=trie)."],- ]- }- }-}-// Resolve test option values after all evaluation is complete.allprojects {plugins.withType(JavaPlugin) {diff --git a/gradle/validation/check-broken-links.gradle b/gradle/validation/check-broken-links.gradleindex a30999178ec..aef8ce7a83b 100644--- a/gradle/validation/check-broken-links.gradle+++ b/gradle/validation/check-broken-links.gradle@@ -21,11 +21,10 @@ configure(rootProject) {description 'Check broken links in the entire documentation'dependsOn ':lucene:documentation:checkBrokenLinks'- dependsOn ':solr:documentation:checkBrokenLinks'}}-configure(subprojects.findAll { it.path in [':lucene:documentation', ':solr:documentation'] }) {+configure(project(':lucene:documentation')) {task checkBrokenLinks(type: CheckBrokenLinksTask, 'dependsOn': 'documentation')check.dependsOn checkBrokenLinks}diff --git a/gradle/validation/ecj-lint.gradle b/gradle/validation/ecj-lint.gradleindex 0dc1540b00d..09c4ebef094 100644--- a/gradle/validation/ecj-lint.gradle+++ b/gradle/validation/ecj-lint.gradle@@ -74,10 +74,8 @@ allprojects {args += [ "-enableJavadoc" ]args += [ "-properties", file("${resources}/ecj.javadocs.prefs").absolutePath ]- if (skipLucene) {- // disable for now because individual file excludes cannot be applied to ecj.- enabled = false- }+ // disable for now because individual file excludes cannot be applied to ecj.+ // enabled = falsedoFirst {tmpDst.mkdirs()diff --git a/gradle/validation/forbidden-apis.gradle b/gradle/validation/forbidden-apis.gradleindex c23002ae88f..3a06e2651b8 100644--- a/gradle/validation/forbidden-apis.gradle+++ b/gradle/validation/forbidden-apis.gradle@@ -110,36 +110,19 @@ allprojects { prj ->if (prj.path in [":lucene:demo",":lucene:benchmark",- ":lucene:test-framework",- ":solr:solr-ref-guide",- ":solr:test-framework"+ ":lucene:test-framework"]) {forbiddenApisMain.bundledSignatures -= ['jdk-system-out']}- // Configure lucene-specific rules.- if (prj.path.startsWith(":lucene")) {- forbiddenApisMain {- doFirst dynamicSignatures.curry(configurations.compileClasspath, "lucene")- }-- forbiddenApisTest {- doFirst dynamicSignatures.curry(configurations.testCompileClasspath, "lucene")- }+ forbiddenApisMain {+ doFirst dynamicSignatures.curry(configurations.compileClasspath, "lucene")}- // Configure solr-specific rules.- if (prj.path.startsWith(":solr")) {- forbiddenApisMain {- doFirst dynamicSignatures.curry(configurations.compileClasspath, "solr")- signaturesFiles += files(file("${resources}/java.solr.txt"))- }-- forbiddenApisTest {- doFirst dynamicSignatures.curry(configurations.testCompileClasspath, "solr")- }+ forbiddenApisTest {+ doFirst dynamicSignatures.curry(configurations.testCompileClasspath, "lucene")}// We rely on resolved configurations to compute the relevant set of rulediff --git a/gradle/validation/jar-checks.gradle b/gradle/validation/jar-checks.gradleindex cb75981ec89..b7c8603ffdb 100644--- a/gradle/validation/jar-checks.gradle+++ b/gradle/validation/jar-checks.gradle@@ -39,10 +39,8 @@ buildscript {// Configure license checksum folder for top-level projects.// (The file("licenses") inside the configure scope resolves// relative to the current project so they're not the same).-if (!skipLucene) {- configure(project(":lucene")) {- ext.licensesDir = file("licenses")- }+configure(project(":lucene")) {+ ext.licensesDir = file("licenses")}// All known license types. If 'noticeOptional' is true then@@ -99,8 +97,6 @@ subprojects {dependsOn configurations.jarValidationdoFirst {- def isSolr = project.path.startsWith(":solr")-// When gradle resolves a configuration it applies exclude rules from inherited configurations// globally (this seems like a bug to me). So we process each inherited configuration independently// but make sure there are no other dependencies on jarValidation itself.@@ -129,18 +125,8 @@ subprojects {while (!queue.isEmpty()) {def dep = queue.removeFirst()- // Skip any artifacts from other Solr modules (they will be resolved there).- if (dep.moduleGroup == "org.apache.solr") {- continue- }-// Skip any artifacts from Lucene modules.- if (dep.moduleGroup.startsWith("org.apache.lucene")) {- // ... but process their transitive dependencies for Solr compatibility.- if (isSolr) {- queue.addAll(dep.children)- }- } else {+ if (!dep.moduleGroup.startsWith("org.apache.lucene")) {queue.addAll(dep.children)dep.moduleArtifacts.each { resolvedArtifact ->def file = resolvedArtifact.file@@ -272,12 +258,8 @@ subprojects {// Add top-project level tasks validating dangling files// and regenerating dependency checksums.-def plist = []-if (!skipLucene) {- plist.add(project(":lucene"))-}-configure(plist) {+configure(project(":lucene")) {def validationTasks = subprojects.collectMany { it.tasks.matching { it.name == "licenses" } }def jarInfoTasks = subprojects.collectMany { it.tasks.matching { it.name == "collectJarInfos" } }@@ -366,14 +348,12 @@ configure(plist) {// Exclude files that are not a result of direct dependencies but have to be there.// It would be probably better to move non-dependency licenses into the actual project// where they're used and only assemble them for the distribution package.-if (!skipLucene) {- configure(project(":lucene")) {- checkDanglingLicenseFiles {- exclude += [- "elegant-icon-font-*",- "ant-*",- "ivy-*",- ]- }+configure(project(":lucene")) {+ checkDanglingLicenseFiles {+ exclude += [+ "elegant-icon-font-*",+ "ant-*",+ "ivy-*",+ ]}}diff --git a/gradle/validation/owasp-dependency-check.gradle b/gradle/validation/owasp-dependency-check.gradleindex d58fd8bfd10..030509a6509 100644--- a/gradle/validation/owasp-dependency-check.gradle+++ b/gradle/validation/owasp-dependency-check.gradle@@ -26,7 +26,7 @@ configure(rootProject) {dependencyCheck {failBuildOnCVSS = propertyOrDefault("validation.owasp.threshold", 7) as Integerformats = ['HTML', 'JSON']- skipProjects = [':solr:solr-ref-guide']+ skipProjects = []skipConfigurations = ['unifiedClasspath']suppressionFile = file("${resources}/exclusions.xml")}diff --git a/gradle/validation/rat-sources.gradle b/gradle/validation/rat-sources.gradleindex 72c2162ea95..29bebda37fc 100644--- a/gradle/validation/rat-sources.gradle+++ b/gradle/validation/rat-sources.gradle@@ -49,53 +49,51 @@ configure(rootProject) {}}-if (!skipLucene) {- configure(project(":lucene:analysis:common")) {- rat {- srcExcludes += [- "**/*.aff",- "**/*.dic",- "**/*.wrong",- "**/*.good",- "**/*.sug",- "**/charfilter/*.htm*",- "**/*LuceneResourcesWikiPage.html"- ]- }+configure(project(":lucene:analysis:common")) {+ rat {+ srcExcludes += [+ "**/*.aff",+ "**/*.dic",+ "**/*.wrong",+ "**/*.good",+ "**/*.sug",+ "**/charfilter/*.htm*",+ "**/*LuceneResourcesWikiPage.html"+ ]}+}- configure(project(":lucene:analysis:kuromoji")) {- rat {- srcExcludes += [- // whether rat detects this as binary or not is platform dependent?!- "**/bocchan.utf-8"- ]- }+configure(project(":lucene:analysis:kuromoji")) {+ rat {+ srcExcludes += [+ // whether rat detects this as binary or not is platform dependent?!+ "**/bocchan.utf-8"+ ]}+}- configure(project(":lucene:analysis:opennlp")) {- rat {- excludes += [- "src/tools/test-model-data/*.txt",- ]- }+configure(project(":lucene:analysis:opennlp")) {+ rat {+ excludes += [+ "src/tools/test-model-data/*.txt",+ ]}+}- configure(project(":lucene:highlighter")) {- rat {- srcExcludes += [- "**/CambridgeMA.utf8"- ]- }+configure(project(":lucene:highlighter")) {+ rat {+ srcExcludes += [+ "**/CambridgeMA.utf8"+ ]}+}- configure(project(":lucene:suggest")) {- rat {- srcExcludes += [- "**/Top50KWiki.utf8",- "**/stop-snowball.txt"- ]- }+configure(project(":lucene:suggest")) {+ rat {+ srcExcludes += [+ "**/Top50KWiki.utf8",+ "**/stop-snowball.txt"+ ]}}diff --git a/gradle/validation/validate-source-patterns.gradle b/gradle/validation/validate-source-patterns.gradleindex 71eb887cbd8..d82f8b349b7 100644--- a/gradle/validation/validate-source-patterns.gradle+++ b/gradle/validation/validate-source-patterns.gradle@@ -88,12 +88,10 @@ subprojects {check.dependsOn validateSourcePatterns}-if (!skipLucene) {- configure(project(':lucene:benchmark')) {- project.tasks.withType(ValidateSourcePatternsTask) {- sourceFiles.exclude 'temp/**'- sourceFiles.exclude 'work/**'- }+configure(project(':lucene:benchmark')) {+ project.tasks.withType(ValidateSourcePatternsTask) {+ sourceFiles.exclude 'temp/**'+ sourceFiles.exclude 'work/**'}}@@ -119,10 +117,6 @@ configure(rootProject) {exclude "${it}/**"}- if (skipLucene) {- exclude "lucene/**"- }-// default excludes.exclude '**/build/**'exclude 'dev-tools/missing-doclet/src/**/*.java' // <-- TODO: remove once we allow "var" on master@@ -296,13 +290,6 @@ class ValidateSourcePatternsTask extends DefaultTask {checkMockitoAssume(f, text);}- if (project.path.startsWith(':solr:')- && f.name.equals("SolrTestCase.java") == false- && f.name.equals("TestXmlQParser.java") == false) {- if (extendsLuceneTestCasePattern.matcher(text).find()) {- reportViolation(f, "Solr test cases should extend SolrTestCase rather than LuceneTestCase");- }- }invalidJavaOnlyPatterns.each { pattern,name ->if (pattern.matcher(text).find()) {reportViolation(f, name);