diff options
author | Raphaël Garnier <garnier.raphael@gmail.com> | 2015-02-23 23:33:07 +0100 |
---|---|---|
committer | Raphaël Garnier <garnier.raphael@gmail.com> | 2015-02-23 23:33:07 +0100 |
commit | 62feb260ede3bfeeb9602ba6b261ef79bf7bdf8d (patch) | |
tree | 158804947d68e4478779ea77c285437ccd6deef6 /gwtquery-core | |
parent | 81d741fb0b3bcde738eac9a6569bcfd0cc7ac3ee (diff) | |
download | gwtquery-62feb260ede3bfeeb9602ba6b261ef79bf7bdf8d.tar.gz gwtquery-62feb260ede3bfeeb9602ba6b261ef79bf7bdf8d.zip |
Use absolute path to load library in JsniBundle
As ClientBundle do, it's now possible to use relative or absolute path
to load js libraries in JsniBundle.
Diffstat (limited to 'gwtquery-core')
-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 { |