[sikuli] 111/385: minor: libs export

Gilles Filippini pini at moszumanska.debian.org
Sun Jun 29 19:25:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.

commit cf76be97e97fb609ae000ccd7518e0b7e8f2a0f4
Author: Raimund Hocke <rmhdevelop at me.com>
Date:   Mon Jan 6 09:59:35 2014 +0100

    minor: libs export
---
 .../java/org/sikuli/basics/ResourceLoader.java     | 46 +++++++++++-----------
 .../src/main/java/org/sikuli/basics/SikuliX.java   |  2 +-
 2 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/Basics/src/main/java/org/sikuli/basics/ResourceLoader.java b/Basics/src/main/java/org/sikuli/basics/ResourceLoader.java
index 4dedc7a..2cfa7e3 100755
--- a/Basics/src/main/java/org/sikuli/basics/ResourceLoader.java
+++ b/Basics/src/main/java/org/sikuli/basics/ResourceLoader.java
@@ -27,7 +27,7 @@ import java.util.zip.ZipInputStream;
 public class ResourceLoader implements IResourceLoader {
 
   //<editor-fold defaultstate="collapsed" desc="new logging concept">
-  private String me = "ResourceLoaderBasic";
+  private String me = "ResourceLoader";
   private String mem = "...";
   private int lvl = 3;
 
@@ -159,30 +159,30 @@ public class ResourceLoader implements IResourceLoader {
       return;
     }
 
-    if (System.getProperty("sikuli.DoNotExport") == null && !isFatJar()) {
-      libsURL = null;
-      if (jarPath.contains("Basics")) {
-        try {
-          SikuliX.addToClasspath(jarPath.replace("Basics", "Libs"));
-          libsURL = new URL(jarURL.toString().replace("Basics", "Libs"));
-          tessURL = new URL(jarURL.toString().replace("Basics", "Tesseract"));
-          log(-1, "The jar in use was not built with setup!\n"
-                  + "We might be running from local Maven repository?\n" + jarPath);
-        } catch (Exception ex) {
-        }
-      }
-      if (libsURL == null) {
-        RunSetup.popError("Terminating: The jar in use was not built with setup!\n" + jarPath);
-        System.exit(1);
-      }
-    }
-
     if (libPath == null || libsDir == null) {
       libPath = null;
       libsDir = null;
       File libsfolder;
       String libspath;
 
+      if (System.getProperty("sikuli.DoNotExport") == null && !isFatJar()) {
+        libsURL = null;
+        if (jarPath.contains("Basics")) {
+          try {
+            log(-1, "The jar in use was not built with setup!\n"
+                    + "We might be running from local Maven repository?\n" + jarPath);
+            SikuliX.addToClasspath(jarPath.replace("Basics", "Libs"));
+            libsURL = new URL(jarURL.toString().replace("Basics", "Libs"));
+            tessURL = new URL(jarURL.toString().replace("Basics", "Tesseract"));
+          } catch (Exception ex) {
+          }
+        }
+        if (libsURL == null) {
+          RunSetup.popError("Terminating: The jar in use was not built with setup!\n" + jarPath);
+          System.exit(1);
+        }
+      }
+
       // check the bit-arch
       osarch = System.getProperty("os.arch");
       log(lvl - 1, "we are running on arch: " + osarch);
@@ -331,7 +331,7 @@ public class ResourceLoader implements IResourceLoader {
 
     if (libsDir == null && libPath != null) {
       log(-1, "libs dir is empty, has wrong content or is outdated");
-      log(-2, "Please wait! Trying to extract libs to: " + libPath);
+      log(-2, "Trying to extract libs to: " + libPath);
       if (!FileManager.deleteFileOrFolder(libPath,
               new FileManager.fileFilter() {
         @Override
@@ -864,7 +864,7 @@ public class ResourceLoader implements IResourceLoader {
       try {
         ZipInputStream zip = new ZipInputStream(jar.openStream());
         ZipEntry ze;
-        log(lvl, "Accessing jar: " + jar.toString());
+        log(lvl, "from:\n" + jar.toString());
         while ((ze = zip.getNextEntry()) != null) {
           String entryName = ze.getName();
           if (entryName.startsWith(path)
@@ -882,7 +882,7 @@ public class ResourceLoader implements IResourceLoader {
       }
     } else {
       String p = FileManager.slashify(jar.getPath(), false);
-      //TODO hack: to get folder Commands and Lib from Basics
+//TODO hack: to get folder Commands and Lib from Basics
       if (path.startsWith("Commands/") || path.startsWith("Lib/")) {
         p = p.replace("Natives", "Basics");
       }
@@ -892,7 +892,7 @@ public class ResourceLoader implements IResourceLoader {
           String.format("%d", folder.lastModified())});
         log(lvl, "Found 1 file in %s", path);
       } else {
-        log(lvl, "accessing folder: " + folder.getAbsolutePath());
+        log(lvl, "from:\n" + folder.getAbsolutePath());
         for (File f : getDeepFileList(folder, deep)) {
           log(lvl + 2, "file: " + f.getAbsolutePath());
           fList.add(new String[]{FileManager.slashify(f.getAbsolutePath(), false),
diff --git a/Basics/src/main/java/org/sikuli/basics/SikuliX.java b/Basics/src/main/java/org/sikuli/basics/SikuliX.java
index 8e081db..daee99e 100644
--- a/Basics/src/main/java/org/sikuli/basics/SikuliX.java
+++ b/Basics/src/main/java/org/sikuli/basics/SikuliX.java
@@ -253,7 +253,7 @@ public class SikuliX {
     Method method;
     URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
     URL[] urls = sysLoader.getURLs();
-    log0(lvl, "adding to classpath: " + jar);
+    log0(lvl, "add to classpath: " + jar);
     for (int i = 0; i < urls.length; i++) {
       log0(lvl + 1, "%d: %s", i, urls[i]);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git



More information about the pkg-java-commits mailing list