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 2020/08/15 12:15:41 UTC

[sis] branch geoapi-4.0 updated (42b1726 -> 906b2a1)

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

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


    from 42b1726  Initial Windows batch script for launching the application.
     new ffe086b  Declare static final constants for programmatic names such as directory and environment variable.
     new 906b2a1  Change the URL to Jenkins server.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/sis/internal/setup/FXFinder.java    | 41 ++++++++++++++++++----
 pom.xml                                            |  2 +-
 2 files changed, 35 insertions(+), 8 deletions(-)


[sis] 01/02: Declare static final constants for programmatic names such as directory and environment variable.

Posted by de...@apache.org.
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 ffe086b5044f5e8bfcc578430fd481463b061a20
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sat Aug 15 14:13:37 2020 +0200

    Declare static final constants for programmatic names such as directory and environment variable.
---
 .../org/apache/sis/internal/setup/FXFinder.java    | 41 ++++++++++++++++++----
 1 file changed, 34 insertions(+), 7 deletions(-)

diff --git a/application/sis-javafx/src/main/java/org/apache/sis/internal/setup/FXFinder.java b/application/sis-javafx/src/main/java/org/apache/sis/internal/setup/FXFinder.java
index ba91b5b..5cc2736 100644
--- a/application/sis-javafx/src/main/java/org/apache/sis/internal/setup/FXFinder.java
+++ b/application/sis-javafx/src/main/java/org/apache/sis/internal/setup/FXFinder.java
@@ -44,6 +44,33 @@ import javax.swing.UnsupportedLookAndFeelException;
  */
 public final class FXFinder {
     /**
+     * The URL where to download JavaFX.
+     */
+    private static final String DOWNLOAD_URL = "https://openjfx.io/";
+
+    /**
+     * The {@value} directory in JavaFX installation directory.
+     * This is the directory where JAR files are expected to be found.
+     */
+    private static final String LIB_DIRECTORY = "lib";
+
+    /**
+     * A file to search in the {@value #LIB_DIRECTORY} directory for determining if JavaFX is present.
+     */
+    private static final String SENTINEL_FILE = "javafx.controls.jar";
+
+    /**
+     * The environment variable containing the path to JavaFX {@value #LIB_DIRECTORY} directory.
+     */
+    private static final String PATH_VARIABLE = "PATH_TO_FX";
+
+    /**
+     * File extension of Windows batch file. If the script file to edit does not have this extension,
+     * then it is assumed to be a Unix bash script.
+     */
+    private static final String WINDOWS_BATCH_EXTENSION = ".bat";
+
+    /**
      * Do not allow instantiation of this class.
      */
     private FXFinder() {
@@ -110,9 +137,9 @@ public final class FXFinder {
 
         if (choice == 0) {
             if (Desktop.isDesktopSupported() && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
-                Desktop.getDesktop().browse(URI.create("https://openjfx.io/"));
+                Desktop.getDesktop().browse(URI.create(DOWNLOAD_URL));
             } else {
-                JOptionPane.showMessageDialog(null, "See https://openjfx.io/",
+                JOptionPane.showMessageDialog(null, "See " + DOWNLOAD_URL,
                         "JavaFX download", JOptionPane.INFORMATION_MESSAGE);
             }
         } else if (choice == 1) {
@@ -140,11 +167,11 @@ public final class FXFinder {
      * @return      the {@code lib} directory, or {@code null} if not found.
      */
     private static File findSubDirectory(final File dir) {
-        if (new File(dir, "javafx.controls.jar").exists()) {
+        if (new File(dir, SENTINEL_FILE).exists()) {
             return dir;
         }
-        final File lib = new File(dir, "lib");
-        if (new File(lib, "javafx.controls.jar").exists()) {
+        final File lib = new File(dir, LIB_DIRECTORY);
+        if (new File(lib, SENTINEL_FILE).exists()) {
             return lib;
         }
         return null;
@@ -157,8 +184,8 @@ public final class FXFinder {
      * @param  dir     directory selected by user.
      */
     private static void setDirectory(final Path setenv, final File dir) throws IOException {
-        String command = "PATH_TO_FX";
-        if (setenv.getFileName().toString().endsWith(".bat")) {
+        String command = PATH_VARIABLE;
+        if (setenv.getFileName().toString().endsWith(WINDOWS_BATCH_EXTENSION)) {
             command = "SET " + command;                             // Microsoft Windows syntax.
         }
         final ArrayList<String> content = new ArrayList<>();


[sis] 02/02: Change the URL to Jenkins server.

Posted by de...@apache.org.
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 906b2a14a420bec3b9e74f4b997ba6b65f8da3f5
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Sat Aug 15 14:14:56 2020 +0200

    Change the URL to Jenkins server.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index d869a00..5c372bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,7 +84,7 @@
 
   <ciManagement>
     <system>jenkins</system>
-    <url>https://builds.apache.org/job/sis</url>
+    <url>https://ci-builds.apache.org/job/SIS/</url>
   </ciManagement>
 
   <issueManagement>