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

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit d6ebef6dd435b0f21d1e09860a162ee964039f79
Author: Martin Desruisseaux <martin.desruisse...@geomatys.com>
AuthorDate: Wed Feb 28 15:03:21 2024 +0100

    Publish the `sis-coveragejson` to Maven local repository.
    Remove the `sis-shapefile` exclusion from resources compiler.
---
 .../java/org/apache/sis/buildtools/gradle/Dependency.java  |  1 +
 .../apache/sis/buildtools/gradle/ModularCompilation.java   | 13 -------------
 .../sis/buildtools/resources/IndexedResourceCompiler.java  | 14 +-------------
 incubator/build.gradle.kts                                 | 12 ++++++++++++
 4 files changed, 14 insertions(+), 26 deletions(-)

diff --git 
a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java 
b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java
index 8a055ff750..5abc18adbc 100644
--- a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java
+++ b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/Dependency.java
@@ -70,6 +70,7 @@ public final class Dependency {
         Map.entry("gui",                      "application:sis-javafx"),       
     // Optional.
         Map.entry("cql",                      "core:sis-cql"),                 
     // Incubator.
         Map.entry("storage.shapefile",        "core:sis-shapefile"),
+        Map.entry("storage.coveragejson",     "core:sis-coveragejson"),
         Map.entry("portrayal.map",            "core:sis-portrayal-map"),
         Map.entry("webapp",                   "application:sis-webapp")
     );
diff --git 
a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/ModularCompilation.java
 
b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/ModularCompilation.java
index 92b39907f4..3f6486cdf3 100644
--- 
a/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/ModularCompilation.java
+++ 
b/buildSrc/src/main/java/org/apache/sis/buildtools/gradle/ModularCompilation.java
@@ -160,12 +160,6 @@ final class ModularCompilation extends Conventions {
      * └───────────────────────────────────────────────────────────────────┘
      */
 
-    /**
-     * Modules to exclude. This is a temporary workaround for a SIS module
-     * not yet well integrated with other SIS modules.
-     */
-    private static final Set<String> EXCLUDE_MODULES = 
Set.of("org.apache.sis.storage.shapefile");
-
     /**
      * File extensions of resources to not copy.
      * In addition, everything in {@code doc-files} sub-directories will be 
excluded.
@@ -210,13 +204,6 @@ final class ModularCompilation extends Conventions {
                         results.put(target, source);
                     }
                 }
-                @Override protected boolean acceptCompilableResource(File 
source) {
-                    while (source != null) {
-                        if (EXCLUDE_MODULES.contains(source.getName())) return 
false;
-                        source = source.getParentFile();
-                    }
-                    return true;
-                }
             };
             try {
                 errors += compiler.onJavaSourceDirectory();
diff --git 
a/buildSrc/src/main/java/org/apache/sis/buildtools/resources/IndexedResourceCompiler.java
 
b/buildSrc/src/main/java/org/apache/sis/buildtools/resources/IndexedResourceCompiler.java
index 3e4cfa64f5..ac991b2504 100644
--- 
a/buildSrc/src/main/java/org/apache/sis/buildtools/resources/IndexedResourceCompiler.java
+++ 
b/buildSrc/src/main/java/org/apache/sis/buildtools/resources/IndexedResourceCompiler.java
@@ -266,7 +266,7 @@ public class IndexedResourceCompiler {
         filterLanguages(resourcesToProcess, true);
         for (final Map.Entry<File,Boolean> entry : 
resourcesToProcess.entrySet()) {
             final File source = entry.getKey();
-            if (entry.getValue() && acceptCompilableResource(source)) {
+            if (entry.getValue()) {
                 onJavaSource(new File(source.getParentFile(), 
getBaseName(source) + JAVA_EXT));
             } else {
                 otherResource(source, sourceToTarget(source));
@@ -709,18 +709,6 @@ search: for (int i=0; i<buffer.length(); i++) {            
     // Length of `bu
         }
     }
 
-    /**
-     * Invoked for each resource file that {@code IndexedResourceCompiler} 
thinks is compilable.
-     * Subclasses can override this method for excluding some false positives.
-     * The default implementation always returns {@code true}.
-     *
-     * @param  source  the {@code .properties} file that may be compiled.
-     * @return whether to compile the specified file.
-     */
-    protected boolean acceptCompilableResource(final File source) {
-        return true;
-    }
-
     /**
      * Invoked when a file is not a Java source file, a properties file being 
compiled or a directory.
      * The default implementation does nothing.
diff --git a/incubator/build.gradle.kts b/incubator/build.gradle.kts
index 214aeeaf21..c10f193705 100644
--- a/incubator/build.gradle.kts
+++ b/incubator/build.gradle.kts
@@ -175,6 +175,18 @@ publishing {
                 description = "Read and write files in the Shapefile format."
             }
         }
+        create<MavenPublication>("storage.coveragejson") {
+            var module = "org.apache.sis.storage.coveragejson"
+            groupId    = "org.apache.sis.storage"
+            artifactId = "sis-coveragejson"
+            artifact(layout.buildDirectory.file("libs/${module}.jar"))
+            artifact(layout.buildDirectory.file("docs/${module}-sources.jar")) 
{classifier = "sources"}
+            artifact(layout.buildDirectory.file("docs/${module}-javadoc.jar")) 
{classifier = "javadoc"}
+            pom {
+                name        = "Apache SIS JSON Coverage storage"
+                description = "Read and write files in the JSON Coverage 
format."
+            }
+        }
         create<MavenPublication>("portrayal.map") {
             var module = "org.apache.sis.portrayal.map"
             groupId    = "org.apache.sis.core"

Reply via email to