You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2023/10/05 23:30:05 UTC
[sis] 01/02: Fixes to the build plugin based on release experience.
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 7e10eef9d532c0ea8b9b08858ea6aff30acca36a
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Thu Oct 5 21:17:07 2023 +0200
Fixes to the build plugin based on release experience.
---
.../main/org/apache/sis/buildtools/gradle/BuildHelper.java | 1 +
.../main/org/apache/sis/buildtools/gradle/Conventions.java | 5 +++++
.../main/org/apache/sis/buildtools/gradle/ModularJavadoc.java | 1 +
.../main/org/apache/sis/buildtools/gradle/ModularSources.java | 7 +------
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/BuildHelper.java b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/BuildHelper.java
index 0408b27a8f..7dd86924e3 100644
--- a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/BuildHelper.java
+++ b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/BuildHelper.java
@@ -162,6 +162,7 @@ public final class BuildHelper implements Plugin<Project> {
tasks.withType(Jar.class).forEach((task) -> {
task.getInputs().dir(Conventions.SOURCE_DIRECTORY);
task.getOutputs().dir(Conventions.fileRelativeToBuild(project, Conventions.LIBS_DIRECTORY));
+ task.getOutputs().dir(Conventions.fileRelativeToBuild(project, Conventions.DOCS_DIRECTORY));
task.setActions(List.of((t) -> { // Replace the default action by our own.
ModularJAR.execute(BuildHelper.this, (Jar) t);
}));
diff --git a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/Conventions.java b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/Conventions.java
index c50dbefa95..471f16d67c 100644
--- a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/Conventions.java
+++ b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/Conventions.java
@@ -80,6 +80,11 @@ abstract class Conventions {
*/
static final String LIBS_DIRECTORY = "libs";
+ /**
+ * The sub-directory inside "{@value #BUILD_DIRECTORY}" for the Javadoc and sources ZIP files.
+ */
+ static final String DOCS_DIRECTORY = "docs";
+
/**
* The sub-directory inside "{@value #BUILD_DIRECTORY}" for the ZIP or OXT files (assemblies).
* Also the sibling directory of "{@value #MAIN_DIRECTORY}" and "{@value #TEST_DIRECTORY}"
diff --git a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularJavadoc.java b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularJavadoc.java
index 63e917813a..1e89ccf257 100644
--- a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularJavadoc.java
+++ b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularJavadoc.java
@@ -70,6 +70,7 @@ final class ModularJavadoc extends Conventions {
options.links(
"https://docs.oracle.com/en/java/javase/11/docs/api",
"http://www.geoapi.org/snapshot/javadoc",
+ "https://openjfx.io/javadoc/21/",
"http://unitsofmeasurement.github.io/unit-api/site/apidocs");
/*
* Taglet defined in this `buildSrc` sub-project.
diff --git a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularSources.java b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularSources.java
index 9525b4f796..d330d6a9e5 100644
--- a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularSources.java
+++ b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/gradle/ModularSources.java
@@ -31,11 +31,6 @@ import org.gradle.api.Task;
* @author Martin Desruisseaux (Geomatys)
*/
final class ModularSources extends ZipWriter.JDK {
- /**
- * The directory where the ZIP files will be written.
- */
- private static final String OUTPUT_DIRECTORY = "docs";
-
/**
* The Java system property to set to {@code true} for enabling Javadoc generation.
*/
@@ -136,7 +131,7 @@ final class ModularSources extends ZipWriter.JDK {
} else {
sources = sourcesDir(project, module);
}
- final var target = Conventions.fileRelativeToBuild(project, OUTPUT_DIRECTORY);
+ final var target = Conventions.fileRelativeToBuild(project, Conventions.DOCS_DIRECTORY);
target.mkdir();
final File file = new File(target, module + '-' + (javadoc ? "javadoc" : "sources") + ".jar");
try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(file))) {