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 84cb229fe7cdc8352db898c121ce63000063a32f Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Sun Aug 27 15:28:51 2023 +0200 Simplify a little bit the NetBeans project configuration: - Remove the NetBeans-specific "uncommitted" module. - Use symbolic link for geoapi-pending dependency. - Add missing entries in `project.properties`. --- .../sis/buildtools/coding/ReorganizeImports.java | 3 +- netbeans-project/README.md | 3 +- netbeans-project/build.xml | 6 +++- netbeans-project/nbproject/build-impl.xml | 38 ++------------------- netbeans-project/nbproject/genfiles.properties | 4 +-- netbeans-project/nbproject/project.properties | 39 +++++++++++++--------- netbeans-project/nbproject/project.xml | 1 - netbeans-project/src-local/.gitignore | 5 --- .../test/module-info.java | 32 ------------------ .../apache/sis/test/uncommitted/package-info.java | 6 ---- 10 files changed, 35 insertions(+), 102 deletions(-) diff --git a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/coding/ReorganizeImports.java b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/coding/ReorganizeImports.java index 1ec2140229..3bdc57fedd 100644 --- a/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/coding/ReorganizeImports.java +++ b/buildSrc/src/org.apache.sis.buildtools/main/org/apache/sis/buildtools/coding/ReorganizeImports.java @@ -114,8 +114,7 @@ public final class ReorganizeImports extends SimpleFileVisitor<Path> { * Directories to exclude. */ private static final Set<String> EXCLUDES = Set.of( - "snapshot", // geoapi/snapshot - "org.apache.sis.test.uncommitted"); + "snapshot"); // geoapi/snapshot /** * Java keyword to search for, in order and with a trailing space. diff --git a/netbeans-project/README.md b/netbeans-project/README.md index 31afc1b268..d6f9ff40dc 100644 --- a/netbeans-project/README.md +++ b/netbeans-project/README.md @@ -41,8 +41,7 @@ snapshot. This step is not necessary if developing on the `main` branch. ## Known limitations We did not found yet how to get the tests running. -For running some tests in NetBeans, create Java files -in the `src-local/org.apache.sis.test.uncommitted` module +For running some tests in NetBeans, create a separated NetBeans project with a `main` method invoking the actual method to test. This is not convenient, but we hope that it will become simpler in the future if Gradle and NetBeans support of _Module Source Hierarchy_ is gradually improved. diff --git a/netbeans-project/build.xml b/netbeans-project/build.xml index 4ce2b57b9e..af190283ca 100644 --- a/netbeans-project/build.xml +++ b/netbeans-project/build.xml @@ -28,9 +28,13 @@ <target name="-pre-compile"> <ivy:settings file="ivy-settings.xml"/> <ivy:retrieve pattern="build/dependencies/[artifact].[ext]" symlink="true" sync="true"/> + <symlink link="${basedir}/build/dependencies/geoapi-pending.jar" + resource="../../../geoapi/snapshot/geoapi-pending/target/geoapi-pending-4.0-SNAPSHOT.jar"/> + <symlink link="${basedir}/build/dependencies/geoapi-conformance.jar" + resource="../../../geoapi/snapshot/geoapi-conformance/target/geoapi-conformance-4.0-SNAPSHOT.jar"/> </target> <!-- - Called after compilation. Copies the "*.utf" resources files created by GRadle. + Called after compilation. Copies the "*.utf" resources files created by Gradle. Note that the Apache SIS project must have been build by Gradle at least once before it can be built by the NetBeans IDE. --> diff --git a/netbeans-project/nbproject/build-impl.xml b/netbeans-project/nbproject/build-impl.xml index 3086eda037..c3ef739c6d 100644 --- a/netbeans-project/nbproject/build-impl.xml +++ b/netbeans-project/nbproject/build-impl.xml @@ -309,15 +309,10 @@ public class ModuleInfoSelector extends BaseExtendSelector { <dirset dir="${basedir}/${incubator.test.dir}" id="have.tests.incubator.test.dir.set" includes="*/*"> <filename regex="${have.tests.incubator.test.dir.regexp}"/> </dirset> - <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${local.test.dir.path}" property="have.tests.local.test.dir.regexp"/> - <dirset dir="${basedir}/${local.test.dir}" id="have.tests.local.test.dir.set" includes="*/*"> - <filename regex="${have.tests.local.test.dir.regexp}"/> - </dirset> <union id="have.tests.set"> <dirset refid="have.tests.test.src.dir.set"/> <dirset refid="have.tests.optional.test.dir.set"/> <dirset refid="have.tests.incubator.test.dir.set"/> - <dirset refid="have.tests.local.test.dir.set"/> </union> <condition property="have.tests"> <or> @@ -330,9 +325,6 @@ public class ModuleInfoSelector extends BaseExtendSelector { <resourcecount count="0" when="greater"> <union refid="have.tests.set"/> </resourcecount> - <resourcecount count="0" when="greater"> - <union refid="have.tests.set"/> - </resourcecount> </or> </condition> <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${test.src.dir.path}" property="have.tests.test.src.dir.regexp"/> @@ -347,15 +339,10 @@ public class ModuleInfoSelector extends BaseExtendSelector { <dirset dir="${basedir}/${incubator.test.dir}" id="have.tests.incubator.test.dir.patchset" includes="*/*"> <filename regex="${have.tests.incubator.test.dir.regexp}"/> </dirset> - <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${local.test.dir.path}" property="have.tests.local.test.dir.regexp"/> - <dirset dir="${basedir}/${local.test.dir}" id="have.tests.local.test.dir.patchset" includes="*/*"> - <filename regex="${have.tests.local.test.dir.regexp}"/> - </dirset> <union id="have.tests.patchset"> <dirset refid="have.tests.test.src.dir.patchset"/> <dirset refid="have.tests.optional.test.dir.patchset"/> <dirset refid="have.tests.incubator.test.dir.patchset"/> - <dirset refid="have.tests.local.test.dir.patchset"/> </union> <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" modsource="${src.dir.path}" property="have.sources.src.dir.regexp"/> <dirset dir="${basedir}/${src.dir}" id="have.sources.src.dir.set" includes="*/*"> @@ -547,7 +534,6 @@ public class ModuleInfoSelector extends BaseExtendSelector { <fail unless="test.src.dir">Must set test.src.dir</fail> <fail unless="optional.test.dir">Must set optional.test.dir</fail> <fail unless="incubator.test.dir">Must set incubator.test.dir</fail> - <fail unless="local.test.dir">Must set local.test.dir</fail> <fail unless="build.dir">Must set build.dir</fail> <fail unless="dist.dir">Must set dist.dir</fail> <fail unless="build.modules.dir">Must set build.modules.dir</fail> @@ -753,15 +739,10 @@ public class ModuleInfoSelector extends BaseExtendSelector { <filename name="**/@{testincludes}"/> <filename regex="${have.tests.incubator.test.dir.regexp}"/> </fileset> - <fileset dir="${local.test.dir}" excludes="@{excludes},${excludes}" includes="**/@{includes}"> - <filename name="**/@{testincludes}"/> - <filename regex="${have.tests.local.test.dir.regexp}"/> - </fileset> </union> <regexpmapper from="${have.tests.test.src.dir.regexp}\Q${file.separator}\E(.*)$" to="\3"/> <regexpmapper from="${have.tests.optional.test.dir.regexp}\Q${file.separator}\E(.*)$" to="\3"/> <regexpmapper from="${have.tests.incubator.test.dir.regexp}\Q${file.separator}\E(.*)$" to="\3"/> - <regexpmapper from="${have.tests.local.test.dir.regexp}\Q${file.separator}\E(.*)$" to="\3"/> </mappedresources> <fileset dir="${build.test.modules.dir}" excludes="@{excludes},${excludes},${test.binaryexcludes}" includes="${test.binaryincludes}"> <filename name="${test.binarytestincludes}"/> @@ -795,9 +776,6 @@ public class ModuleInfoSelector extends BaseExtendSelector { <fileset dir="${incubator.test.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> <filename name="@{testincludes}"/> </fileset> - <fileset dir="${local.test.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}"> - <filename name="@{testincludes}"/> - </fileset> </union> <taskdef classname="org.testng.TestNGAntTask" classpath="${run.test.classpath}" name="testng"/> <testng classfilesetref="test.set" failureProperty="tests.failed" listeners="org.testng.reporters.VerboseReporter" methods="${testng.methods.arg}" mode="${testng.mode}" outputdir="${build.test.results.dir}" suitename="Apache_SIS_on_GeoAPI_4.0" testname="TestNG tests" workingDir="${work.dir}"> @@ -1760,7 +1738,7 @@ public class ModuleInfoSelector extends BaseExtendSelector { </target> <target depends="-init-test-javac-module-properties" name="-init-test-module-properties"> <property location="${build.modules.dir}" name="test.module.build.location"/> - <property name="test.source.modulepath" value="${test.src.dir}/*/${test.src.dir.path}:${optional.test.dir}/*/${optional.test.dir.path}:${incubator.test.dir}/*/${incubator.test.dir.path}:${local.test.dir}/*/${local.test.dir.path}"/> + <property name="test.source.modulepath" value="${test.src.dir}/*/${test.src.dir.path}:${optional.test.dir}/*/${optional.test.dir.path}:${incubator.test.dir}/*/${incubator.test.dir.path}"/> <property name="test.compile.modulepath" value="${javac.test.modulepath}:${build.modules.dir}"/> <macrodef name="test-javac" uri="http://www.netbeans.org/ns/j2se-modular-project/1"> <attribute default="${includes}" name="includes"/> @@ -1777,7 +1755,7 @@ public class ModuleInfoSelector extends BaseExtendSelector { </macrodef> </target> <target if="do.depend.true" name="-compile-test-depend"> - <j2semodularproject1:depend xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}:${optional.test.dir}:${incubator.test.dir}:${local.test.dir}"/> + <j2semodularproject1:depend xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.src.dir}:${optional.test.dir}:${incubator.test.dir}"/> </target> <target depends="init,deps-jar,compile,-init-test-module-properties,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test"> <j2semodularproject1:test-javac xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1"/> @@ -1799,12 +1777,6 @@ public class ModuleInfoSelector extends BaseExtendSelector { <fileset dir="${incubator.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> <regexpmapper from="${incubator.test.dir.path.regexp}" to="\1/\3"/> </copy> - <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${local.test.dir.path}" property="local.test.dir.path.regexp"/> - <echo message="Copying resources from ${local.test.dir}"/> - <copy todir="${build.test.modules.dir}"> - <fileset dir="${local.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - <regexpmapper from="${local.test.dir.path.regexp}" to="\1/\3"/> - </copy> </target> <target name="-post-compile-test"> <!-- Empty placeholder for easier customization. --> @@ -1837,12 +1809,6 @@ public class ModuleInfoSelector extends BaseExtendSelector { <fileset dir="${incubator.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> <regexpmapper from="${incubator.test.dir.path.regexp}" to="\1/\3"/> </copy> - <j2semodularproject1:modsource_regexp xmlns:j2semodularproject1="http://www.netbeans.org/ns/j2se-modular-project/1" filePattern="(.*$)" modsource="${local.test.dir.path}" property="local.test.dir.path.regexp"/> - <echo message="Copying resources from ${local.test.dir}"/> - <copy todir="${build.test.modules.dir}"> - <fileset dir="${local.test.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/> - <regexpmapper from="${local.test.dir.path.regexp}" to="\1/\3"/> - </copy> </target> <target name="-post-compile-test-single"> <!-- Empty placeholder for easier customization. --> diff --git a/netbeans-project/nbproject/genfiles.properties b/netbeans-project/nbproject/genfiles.properties index d170af1fdd..c6592afb58 100644 --- a/netbeans-project/nbproject/genfiles.properties +++ b/netbeans-project/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.data.CRC32=d82237a1 build.xml.script.CRC32=9a509f0a build.xml.stylesheet.CRC32=32069288@1.22 -nbproject/build-impl.xml.data.CRC32=b318f117 -nbproject/build-impl.xml.script.CRC32=e33a7e59 +nbproject/build-impl.xml.data.CRC32=a5c28f79 +nbproject/build-impl.xml.script.CRC32=9782532a nbproject/build-impl.xml.stylesheet.CRC32=d1ebcf0f@1.22 diff --git a/netbeans-project/nbproject/project.properties b/netbeans-project/nbproject/project.properties index 9d1c097022..c79b5b9019 100644 --- a/netbeans-project/nbproject/project.properties +++ b/netbeans-project/nbproject/project.properties @@ -30,7 +30,8 @@ javac.source = 16 javac.target = 16 platform.active = default_platform junit.forkmode = once -module.name = org.apache.sis.test.uncommitted +module.name = org.apache.sis.gui +main.class = org.apache.sis.gui.DataViewer javac.compilerargs = ${test.options} \ -Xlint:all -Xdoclint:syntax,html,reference,missing/protected,accessibility/protected run.jvmargs = ${test.options} ${read.options} -enableassertions \ @@ -50,14 +51,12 @@ optional.main.dir = ../optional/src optional.test.dir = ../optional/src incubator.main.dir = ../incubator/src incubator.test.dir = ../incubator/src -local.test.dir = src-local src.dir.path = main test.src.dir.path = test optional.main.dir.path = main optional.test.dir.path = test incubator.main.dir.path = main incubator.test.dir.path = test -local.test.dir.path = test includes = ** excludes = modules.list = org.apache.sis.cloud.aws,\ @@ -120,29 +119,29 @@ test.options = --add-modules jama,GeographicLib.Java,\ # All dependencies except GeoAPI are downloaded by Ivy. # maven.repository = ${user.home}/.m2/repository -geoapi.version = 4.0-SNAPSHOT endorsed.classpath= javac.classpath= javac.modulepath=${javafx.module.path}:\ - ${maven.repository}/org/opengis/geoapi-pending/${geoapi.version}/geoapi-pending-${geoapi.version}.jar:\ - ${maven.repository}/org/opengis/geoapi-conformance/${geoapi.version}/geoapi-conformance-${geoapi.version}.jar:\ ${build.dir}/dependencies -javac.processorpath= +javac.processorpath=${javac.classpath} javac.processormodulepath= -javac.test.classpath= +javac.test.classpath=${javac.classpath} javac.test.modulepath=\ - ${build.modules.dir}:\ - ${javac.modulepath} + ${javac.modulepath}:\ + ${build.modules.dir} +javac.test.processorpath=${javac.test.classpath} run.classpath= run.modulepath=\ - ${build.modules.dir}:\ - ${javac.modulepath} -run.test.classpath= + ${javac.modulepath}:\ + ${build.modules.dir} +run.test.classpath=${javac.test.classpath} run.test.modulepath=\ - ${build.test.modules.dir}:\ - ${javac.test.modulepath} + ${javac.test.modulepath}:\ + ${build.test.modules.dir} +debug.classpath=${run.classpath} debug.modulepath=\ ${run.modulepath} +debug.test.classpath=${run.test.classpath} debug.test.modulepath=\ ${run.test.modulepath} @@ -150,9 +149,14 @@ debug.test.modulepath=\ # Build configuration and destination directories. # The `compile.on.save` property must be `false` for enabling the use of "../build.xml" file. # +do.jar = true +do.jlink = false +do.depend = false compile.on.save = false +javac.debug = true javac.deprecation = true javac.external.vm = false +javadoc.preview = false javadoc.windowtitle = Apache SIS javadoc.encoding = ${source.encoding} javadoc.html5 = true @@ -164,13 +168,17 @@ javadoc.nonavbar = false javadoc.notree = false javadoc.private = false javadoc.splitindex = false +javadoc.additionalparam = annotation.processing.enabled = false annotation.processing.enabled.in.editor = false annotation.processing.run.all.processors = true annotation.processing.processors.list = annotation.processing.source.output = ${build.generated.sources.dir}/ap-source-output +jlink.strip = false jlink.launcher = false jlink.launcher.name = Apache_SIS +jlink.additionalparam = +jlink.additionalmodules = jar.compress = true build.dir = build build.classes.dir = ${build.dir}/classes @@ -187,4 +195,5 @@ dist.jar = ${dist.dir}/SIS.jar dist.jlink.dir = ${dist.dir}/jlink dist.jlink.output = ${dist.jlink.dir}/SIS dist.javadoc.dir = ${dist.dir}/javadoc +dist.archive.excludes = mkdist.disabled = true diff --git a/netbeans-project/nbproject/project.xml b/netbeans-project/nbproject/project.xml index 0825bd261d..7c5ceb94b7 100644 --- a/netbeans-project/nbproject/project.xml +++ b/netbeans-project/nbproject/project.xml @@ -25,7 +25,6 @@ <root id="test.src.dir" pathref="test.src.dir.path"/> <root id="optional.test.dir" pathref="optional.test.dir.path"/> <root id="incubator.test.dir" pathref="incubator.test.dir.path"/> - <root id="local.test.dir" pathref="local.test.dir.path"/> </test-roots> </data> </configuration> diff --git a/netbeans-project/src-local/.gitignore b/netbeans-project/src-local/.gitignore deleted file mode 100644 index 30352382a9..0000000000 --- a/netbeans-project/src-local/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore everything except the specified files. -* -!.gitignore -!org.apache.sis.test.uncommitted/test/module-info.java -!org.apache.sis.test.uncommitted/test/org/apache/sis/test/uncommitted/package-info.java diff --git a/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/module-info.java b/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/module-info.java deleted file mode 100644 index e1b8f5098a..0000000000 --- a/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/module-info.java +++ /dev/null @@ -1,32 +0,0 @@ -/** - * A dummy module for performing tests in a NetBeans environment. - * This module imports all Apache SIS modules for making easy to - * test any feature. - * - * <p>This module is <em>not</em> versioned. It is ignored by Git, - * except for this {@code module-info} and one {@code package-info}. - * This is a space available for local experiments.</p> - */ -module org.apache.sis.test.uncommitted { - requires org.apache.sis.util; - requires org.apache.sis.metadata; - requires org.apache.sis.referencing; - requires org.apache.sis.referencing.gazetteer; - requires org.apache.sis.feature; - requires org.apache.sis.storage; - requires org.apache.sis.storage.xml; - requires org.apache.sis.storage.sql; - requires org.apache.sis.storage.netcdf; - requires org.apache.sis.storage.geotiff; - requires org.apache.sis.storage.earthobservation; - requires org.apache.sis.cloud.aws; - requires org.apache.sis.console; - requires org.apache.sis.openoffice; - requires org.apache.sis.portrayal; - requires org.apache.sis.profile.france; - requires org.apache.sis.profile.japan; - - requires org.opengis.geoapi.conformance; - requires org.apache.derby.tools; - requires org.hsqldb; -} diff --git a/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/org/apache/sis/test/uncommitted/package-info.java b/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/org/apache/sis/test/uncommitted/package-info.java deleted file mode 100644 index 42eab3c8b9..0000000000 --- a/netbeans-project/src-local/org.apache.sis.test.uncommitted/test/org/apache/sis/test/uncommitted/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -/** - * A dummy package for performing tests in a NetBeans environment. - * This package is <em>not</em> versioned. It is ignored by Git. - * This is a space available for local experiments. - */ -package org.apache.sis.test.uncommitted;