From 2960f96c497f75883a8e03b5983ddd10ed570caf Mon Sep 17 00:00:00 2001 From: Raphaƫl Garnier Date: Mon, 23 Feb 2015 23:33:07 +0100 Subject: 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. --- .../java/com/google/gwt/query/rebind/JsniBundleGenerator.java | 11 ++++++++--- 1 file 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 { -- cgit v1.2.3