diff options
author | Manuel Carrasco Moñino <manolo@apache.org> | 2015-02-24 15:13:11 +0100 |
---|---|---|
committer | Manuel Carrasco Moñino <manolo@apache.org> | 2015-02-24 15:13:11 +0100 |
commit | a1192e815fc8a298c25b0eb1d4c9fc364749c80f (patch) | |
tree | 158804947d68e4478779ea77c285437ccd6deef6 | |
parent | 81d741fb0b3bcde738eac9a6569bcfd0cc7ac3ee (diff) | |
parent | 62feb260ede3bfeeb9602ba6b261ef79bf7bdf8d (diff) | |
download | gwtquery-a1192e815fc8a298c25b0eb1d4c9fc364749c80f.tar.gz gwtquery-a1192e815fc8a298c25b0eb1d4c9fc364749c80f.zip |
Merge pull request #343 from han39/master
Use absolute path to load library in JsniBundle
-rw-r--r-- | gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java index cfd9893e..eb1511e4 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/rebind/JsniBundleGenerator.java @@ -131,11 +131,16 @@ public class JsniBundleGenerator extends Generator { try { if (!src.matches("(?i)https?://.*")) { String file = path + "/" + src; - logger.log(TreeLogger.INFO, getClass().getSimpleName() - + " - importing external javascript: " + file); - in = this.getClass().getClassLoader().getResourceAsStream(file); if (in == null) { + // If we didn't find the resource relative to the package, assume it is absolute. + file = src; + in = this.getClass().getClassLoader().getResourceAsStream(file); + } + if (in != null) { + logger.log(TreeLogger.INFO, getClass().getSimpleName() + + " - importing external javascript: " + file); + } else { logger.log(TreeLogger.ERROR, "Unable to read javascript file: " + file); } } else { |