ArcBees / gwtquery

A jQuery clone for GWT, and much more.
MIT License
85 stars 38 forks source link

JsniBundle : Unable to read javascript file using .. #293

Closed han39 closed 9 years ago

han39 commented 10 years ago

Is it possible to add the absolute path to load the resource ? I have an error when I want to access a different package :

@LibrarySource(value = "../resources/js/jquery.highlight.js") void hightlight();

[INFO] Computing all possible rebind results for 'fr.agfahealthcare.cassis.tools.JqueryHighlight.HighlightJsniResource' [INFO] Rebinding fr.agfahealthcare.cassis.tools.JqueryHighlight.HighlightJsniResource [INFO] Invoking generator com.google.gwt.query.rebind.JsniBundleGenerator [INFO] JsniBundleGenerator - importing external javascript: fr/agfahealthcare/cassis/tools/../resources/js/jquery.highlight.js [INFO] [ERROR] Unable to read javascript file: fr/agfahealthcare/cassis/tools/../resources/js/jquery.highlight.js [INFO] [ERROR] Error parsing javascript source: ../resources/js/jquery.highlight.js null [INFO] [ERROR] Errors in 'fr/agfahealthcare/cassis/tools/JqueryHighlight.java'

The below code, as ClientBundle do, is working :

String file = path + "/" + src; 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); }

Thanks.

han39 commented 9 years ago

Any news about this tiny issue ?

manolo commented 9 years ago

could you write the patch and do a pull request?

han39 commented 9 years ago

I'll try to do that asap.