diff --git a/build.xml b/build.xml
index 2346d540587..a5f09e48711 100755
--- a/build.xml
+++ b/build.xml
@@ -125,177 +125,7 @@
-
-
-
- task.log(name + ': ' + f.toString().substring(baseDirLen).replace(File.separatorChar, (char)'/'), Project.MSG_ERR);
- violations.add(name);
- found++;
- }
-
- def javadocsPattern = ~$/(?sm)^\Q/**\E(.*?)\Q*/\E/$;
- def javaCommentPattern = ~$/(?sm)^\Q/*\E(.*?)\Q*/\E/$;
- def xmlCommentPattern = ~$/(?sm)\Q\E/$;
- def lineSplitter = ~$/[\r\n]+/$;
- def singleLineSplitter = ~$/\n\r?/$;
- def licenseMatcher = Defaults.createDefaultMatcher();
- def validLoggerPattern = ~$/(?s)\b(private\s|static\s|final\s){3}+\s*Logger\s+\p{javaJavaIdentifierStart}+\s+=\s+\QLoggerFactory.getLogger(MethodHandles.lookup().lookupClass());\E/$;
- def packagePattern = ~$/(?m)^\s*package\s+org\.apache.*;/$;
- def xmlTagPattern = ~$/(?m)\s*<[a-zA-Z].*/$;
- def sourceHeaderPattern = ~$/\[source\b.*/$;
- def blockBoundaryPattern = ~$/----\s*/$;
- def blockTitlePattern = ~$/\..*/$;
- def unescapedSymbolPattern = ~$/(?<=[^\\]|^)([-=]>|<[-=])/$; // SOLR-10883
-
- def isLicense = { matcher, ratDocument ->
- licenseMatcher.reset();
- return lineSplitter.split(matcher.group(1)).any{ licenseMatcher.match(ratDocument, it) };
- }
-
- def checkLicenseHeaderPrecedes = { f, description, contentPattern, commentPattern, text, ratDocument ->
- def contentMatcher = contentPattern.matcher(text);
- if (contentMatcher.find()) {
- def contentStartPos = contentMatcher.start();
- def commentMatcher = commentPattern.matcher(text);
- while (commentMatcher.find()) {
- if (isLicense(commentMatcher, ratDocument)) {
- if (commentMatcher.start() < contentStartPos) {
- break; // This file is all good, so break loop: license header precedes 'description' definition
- } else {
- reportViolation(f, description+' declaration precedes license header');
- }
- }
- }
- }
- }
-
- def checkMockitoAssume = { f, text ->
- if (text.contains("mockito") && !text.contains("assumeWorkingMockito()")) {
- reportViolation(f, 'File uses Mockito but has no assumeWorkingMockito() call');
- }
- }
-
- def checkForUnescapedSymbolSubstitutions = { f, text ->
- def inCodeBlock = false;
- def underSourceHeader = false;
- def lineNumber = 0;
- singleLineSplitter.split(text).each {
- ++lineNumber;
- if (underSourceHeader) { // This line is either a single source line, or the boundary of a code block
- inCodeBlock = blockBoundaryPattern.matcher(it).matches();
- if ( ! blockTitlePattern.matcher(it).matches()) {
- underSourceHeader = false;
- }
- } else {
- if (inCodeBlock) {
- inCodeBlock = ! blockBoundaryPattern.matcher(it).matches();
- } else {
- underSourceHeader = sourceHeaderPattern.matcher(it).lookingAt();
- if ( ! underSourceHeader) {
- def unescapedSymbolMatcher = unescapedSymbolPattern.matcher(it);
- if (unescapedSymbolMatcher.find()) {
- reportViolation(f, 'Unescaped symbol "' + unescapedSymbolMatcher.group(1) + '" on line #' + lineNumber);
- }
- }
- }
- }
- }
- }
-
- ant.fileScanner{
- fileset(dir: baseDir){
- extensions.each{
- include(name: 'lucene/**/*.' + it)
- include(name: 'solr/**/*.' + it)
- include(name: 'dev-tools/**/*.' + it)
- include(name: '*.' + it)
- }
- // TODO: For now we don't scan txt files, so we
- // check licenses in top-level folders separately:
- include(name: '*.txt')
- include(name: '*/*.txt')
- // excludes:
- exclude(name: '**/build/**')
- exclude(name: '**/dist/**')
- exclude(name: 'lucene/benchmark/work/**')
- exclude(name: 'lucene/benchmark/temp/**')
- exclude(name: '**/CheckLoggingConfiguration.java')
- exclude(name: 'build.xml') // ourselves :-)
- }
- }.each{ f ->
- task.log('Scanning file: ' + f, Project.MSG_VERBOSE);
- def text = f.getText('UTF-8');
- invalidPatterns.each{ pattern,name ->
- if (pattern.matcher(text).find()) {
- reportViolation(f, name);
- }
- }
- def javadocsMatcher = javadocsPattern.matcher(text);
- def ratDocument = new FileDocument(f);
- while (javadocsMatcher.find()) {
- if (isLicense(javadocsMatcher, ratDocument)) {
- reportViolation(f, String.format(Locale.ENGLISH, 'javadoc-style license header [%s]',
- ratDocument.getMetaData().value(MetaData.RAT_URL_LICENSE_FAMILY_NAME)));
- }
- }
- if (f.name.endsWith('.java')) {
- if (text.contains('org.slf4j.LoggerFactory')) {
- if (!validLoggerPattern.matcher(text).find()) {
- reportViolation(f, 'invalid logging pattern [not private static final, uses static class name]');
- }
- }
- checkLicenseHeaderPrecedes(f, 'package', packagePattern, javaCommentPattern, text, ratDocument);
- if (f.name.contains("Test")) {
- checkMockitoAssume(f, text);
- }
- }
- if (f.name.endsWith('.xml') || f.name.endsWith('.xml.template')) {
- checkLicenseHeaderPrecedes(f, '', xmlTagPattern, xmlCommentPattern, text, ratDocument);
- }
- if (f.name.endsWith('.adoc')) {
- checkForUnescapedSymbolSubstitutions(f, text);
- }
- };
-
- if (found) {
- throw new BuildException(String.format(Locale.ENGLISH, 'Found %d violations in source files (%s).',
- found, violations.join(', ')));
- }
- ]]>
+
@@ -410,31 +240,7 @@
- k.startsWith(propPrefix) }
- .collectEntries{ k, v -> [k.substring(propPrefixLen), v] };
- cmdlineProps << project.userProperties.findAll{ k, v -> !k.startsWith('ant.') };
- def artifact = NamespaceBuilder.newInstance(ant, 'antlib:org.apache.maven.artifact.ant');
- task.log('Running Maven with props: ' + cmdlineProps.toString(), Project.MSG_INFO);
- artifact.mvn(pom: properties['maven-build-dir']+'/pom.xml', mavenVersion: properties['maven-version'], failonerror: true, fork: true) {
- cmdlineProps.each{ k, v -> arg(value: '-D' + k + '=' + v) };
- arg(value: '-fae');
- arg(value: 'install');
- };
- ]]>
+
@@ -667,48 +473,7 @@ File | Project Structure | Platform Settings | SDKs):
-
- if (val instanceof Set) {
- if (prop in ['untracked', 'untrackedFolders', 'missing']) {
- unversioned.addAll(val);
- } else if (prop != 'ignoredNotInIndex') {
- modified.addAll(val);
- }
- }
- };
- setProjectPropertyFromSet('wc.unversioned.files', unversioned);
- setProjectPropertyFromSet('wc.modified.files', modified);
- }
- } catch (RepositoryNotFoundException | NoWorkTreeException | NotSupportedException e) {
- task.log('WARNING: Development directory is not a valid GIT checkout! Disabling checks...', Project.MSG_WARN);
- }
- ]]>
+
@@ -726,7 +491,7 @@ File | Project Structure | Platform Settings | SDKs):
-
+
@@ -759,14 +524,21 @@ File | Project Structure | Platform Settings | SDKs):
+
+
+
+
+
+
+
You can find the merged Lucene/Solr Clover report in '${clover.report.dir}'.
diff --git a/dev-tools/maven/README.maven b/dev-tools/maven/README.maven
index 390177172cd..2a741c136e2 100644
--- a/dev-tools/maven/README.maven
+++ b/dev-tools/maven/README.maven
@@ -116,6 +116,13 @@ D. How to use Maven to build Lucene/Solr
ant clean-maven-build
+ 5. Please keep in mind that this is just a minimal Maven build. The resulting
+ artifacts are not the same as those created by the native Ant-based build.
+ It should be fine to enable Lucene builds in several Maven-based IDEs,
+ but should never be used for Lucene/Solr production usage, as they may lack
+ optimized class files (e.g., Java 9 MR-JAR support). To install Lucene/Solr
+ in your local repository, see instructions above.
+
Some example Maven commands you can use after you perform the above
preparatory steps:
@@ -127,6 +134,11 @@ D. How to use Maven to build Lucene/Solr
After compiling and packaging, but before installing each module's
artifact, the above command will also run all the module's tests.
+
+ The resulting artifacts are not the same as those created by the native
+ Ant-based build. They should never be used for Lucene/Solr production
+ usage, as they may lack optimized class files (e.g., Java 9 MR-JAR
+ support).
- Compile, package, and install all binary artifacts to your local
repository, without running any tests:
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index c35d692ceca..7e0033a1e32 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -141,6 +141,15 @@ Improvements
classes to use the optimized variants through the MR-JAR mechanism.
(Uwe Schindler, Robert Muir, Adrien Grand, Mike McCandless)
+* LUCENE-8127: Speed up rewriteNoScoring when there are no MUST clauses.
+ (Michael Braun via Adrien Grand)
+
+* LUCENE-8152: Improve consumption of doc-value iterators. (Horatiu Lazu via
+ Adrien Grand)
+
+* LUCENE-8033: FieldInfos now always use a dense encoding. (Mayya Sharipova
+ via Adrien Grand)
+
Bug Fixes
* LUCENE-8077: Fixed bug in how CheckIndex verifies doc-value iterators.
@@ -189,6 +198,17 @@ Other
* LUCENE-8155: Add back support in smoke tester to run against later Java versions.
(Uwe Schindler)
+* LUCENE-8169: Migrated build to use OpenClover 4.2.1 for checking code coverage.
+ (Uwe Schindler)
+
+* LUCENE-8170: Improve OpenClover reports (separate test from production code);
+ enable coverage reports inside test-frameworks. (Uwe Schindler)
+
+Build
+
+* LUCENE-8168: Moved Groovy scripts in build files to separate files.
+ Update Groovy to 2.4.13. (Uwe Schindler)
+
======================= Lucene 7.2.1 =======================
Bug Fixes
diff --git a/lucene/benchmark/src/test/conf/ConfLoader.java b/lucene/benchmark/src/test/conf/ConfLoader.java
deleted file mode 100644
index 97c02ac5a59..00000000000
--- a/lucene/benchmark/src/test/conf/ConfLoader.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package conf;
-
-public class ConfLoader {
- // don't mind me, I load .alg files
-}
diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
index 90158dae68f..04e15cab760 100644
--- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
+++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksParse.java
@@ -38,8 +38,6 @@ import org.apache.lucene.store.RAMDirectory;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.LuceneTestCase.SuppressSysoutChecks;
-import conf.ConfLoader;
-
/** Test very simply that perf tasks are parses as expected. */
@SuppressSysoutChecks(bugUrl = "very noisy")
public class TestPerfTasksParse extends LuceneTestCase {
@@ -114,7 +112,7 @@ public class TestPerfTasksParse extends LuceneTestCase {
public void testParseExamples() throws Exception {
// hackedy-hack-hack
boolean foundFiles = false;
- final Path examplesDir = Paths.get(ConfLoader.class.getResource(".").toURI());
+ final Path examplesDir = Paths.get(getClass().getResource("/conf").toURI());
try (DirectoryStream stream = Files.newDirectoryStream(examplesDir, "*.alg")) {
for (Path path : stream) {
Config config = new Config(Files.newBufferedReader(path, StandardCharsets.UTF_8));
diff --git a/lucene/build.xml b/lucene/build.xml
index f2ce68dae2c..0061d29cb81 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -353,8 +353,6 @@
-
-
diff --git a/lucene/common-build.xml b/lucene/common-build.xml
index e63b116cabc..4fa59ac9364 100644
--- a/lucene/common-build.xml
+++ b/lucene/common-build.xml
@@ -139,11 +139,11 @@
-
+
-
+
@@ -234,7 +234,6 @@
-
@@ -266,7 +265,7 @@
@@ -568,12 +567,12 @@
-
+
-
+
@@ -1568,58 +1567,7 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
- 1.");
- }
-
- def antcall = project.createTask('antcall');
- antcall.with {
- target = '-test';
- inheritAll = true;
- inheritRefs = true;
- createParam().with {
- name = "tests.isbeasting";
- value = "true";
- };
- };
-
- (1..iters).each { i ->
- task.log('Beast round: ' + i, Project.MSG_INFO);
- try {
- // disable verbose build logging:
- project.buildListeners.each { listener ->
- if (listener instanceof BuildLogger) {
- listener.messageOutputLevel = Project.MSG_WARN;
- }
- };
-
- antcall.execute();
-
- } catch (BuildException be) {
- def logFile = new File(properties["junit.output.dir"], "tests-failures.txt");
- if (logFile.exists()) {
- logFile.eachLine("UTF-8", { line ->
- task.log(line, Project.MSG_ERR);
- });
- }
- throw be;
- } finally {
- // restore build logging (unfortunately there is no way to get the original logging level (write-only property):
- project.buildListeners.each { listener ->
- if (listener instanceof BuildLogger) {
- listener.messageOutputLevel = Project.MSG_INFO;
- }
- };
- }
- };
- task.log('Beasting finished.', Project.MSG_INFO);
- ]]>
+
@@ -1663,27 +1611,8 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
-
-
- Code coverage with Atlassian Clover enabled.
- Code coverage with OpenClover enabled.
+
@@ -1700,11 +1629,9 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
-
-
-
+
-
+
@@ -2484,7 +2411,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
-
- \n\n');
- CharSequence title = parsed.getFirstChildAny(Heading.class)?.getText();
- if (title != null) {
- html.append('').append(Escaping.escapeHtml(title, false)).append('\n');
- }
- html.append('\n')
- .append('\n\n');
- HtmlRenderer.builder(options).build().render(parsed, html);
- html.append('\n