You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2021/12/23 14:14:28 UTC

[lucene] branch branch_9x updated: LUCENE-10301: Place test-framework into separated modules folder. (#566)

This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_9x by this push:
     new cc894d9  LUCENE-10301: Place test-framework into separated modules folder. (#566)
cc894d9 is described below

commit cc894d90d87da3a068cb8959abbf0fd78fe89aa2
Author: Tomoko Uchida <to...@gmail.com>
AuthorDate: Thu Dec 23 21:14:16 2021 +0900

    LUCENE-10301: Place test-framework into separated modules folder. (#566)
---
 .../org/apache/lucene/distribution/TestModularLayer.java   | 10 +++++++++-
 lucene/distribution/binary-release.gradle                  | 14 +++++++++++++-
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java
index 182960f..3fb92c3 100644
--- a/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java
+++ b/lucene/distribution.tests/src/test/org/apache/lucene/distribution/TestModularLayer.java
@@ -93,6 +93,14 @@ public class TestModularLayer {
               + modulesPath.toAbsolutePath());
     }
 
+    Path testModulesPath = Paths.get(modulesPropertyValue).resolve("modules-test-framework");
+    if (!Files.isDirectory(testModulesPath)) {
+      throw new AssertionError(
+          DISTRIBUTION_PROPERTY
+              + " property does not point to a directory where this path is present: "
+              + modulesPath.toAbsolutePath());
+    }
+
     Path thirdPartyModulesPath = Paths.get(modulesPropertyValue).resolve("modules-thirdparty");
     if (!Files.isDirectory(thirdPartyModulesPath)) {
       throw new AssertionError(
@@ -101,7 +109,7 @@ public class TestModularLayer {
               + thirdPartyModulesPath.toAbsolutePath());
     }
 
-    coreModulesFinder = ModuleFinder.of(modulesPath);
+    coreModulesFinder = ModuleFinder.of(modulesPath, testModulesPath);
     allCoreModules = coreModulesFinder.findAll();
   }
 
diff --git a/lucene/distribution/binary-release.gradle b/lucene/distribution/binary-release.gradle
index 1a18838..04c868e 100644
--- a/lucene/distribution/binary-release.gradle
+++ b/lucene/distribution/binary-release.gradle
@@ -26,6 +26,7 @@ configure(project(":lucene:distribution")) {
     docs
 
     jars
+    jarsTestFramework
     jarsThirdParty
 
     binaryDirForTests
@@ -36,13 +37,21 @@ configure(project(":lucene:distribution")) {
 
     // Maven-published submodule JARs are part of the binary distribution.
     // We don't copy their transitive dependencies.
-    def binaryModules = rootProject.ext.mavenProjects
+    def binaryModules = rootProject.ext.mavenProjects.findAll { p -> !(p in [
+      // Placed in a separate folder (module layer conflicts).
+      project(":lucene:test-framework"),
+    ]) }
     for (Project module : binaryModules) {
       jars(module, {
         transitive = false
       })
     }
 
+    // It's placed in a separate modules folder since it has service providers that are consumed by lucene-core for tests.
+    // We won't resolve it when running the Luke app.
+    jarsTestFramework(project(":lucene:test-framework"), {
+      transitive = false
+    })
 
     // The third-party JARs consist of all the transitive dependencies from these modules.
     // Not sure whether we have to include all the thirdparty JARs from across all the modules.
@@ -98,6 +107,9 @@ configure(project(":lucene:distribution")) {
     from(configurations.jars, {
       into 'modules'
     })
+    from(configurations.jarsTestFramework, {
+      into 'modules-test-framework'
+    })
 
     // Binary modules (with dependencies). Don't duplicate project artifacts.
     from((configurations.jarsThirdParty - configurations.jars), {