From 62feb260ede3bfeeb9602ba6b261ef79bf7bdf8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Garnier?= Date: Mon, 23 Feb 2015 23:33:07 +0100 Subject: [PATCH] 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. --- .../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 { -- 2.39.5