Tuesday, March 24, 2015

Re: It should be registered via or entry in your .gwt.xml ?



On Tuesday, March 24, 2015 at 4:14:30 PM UTC+1, MacWiz wrote:
Since upgrading to GWT 2.7.0, we continue to struggle with how to eliminate these warnings.  We get 10 warnings like the following:

     [java]             Preparing method appEdir
     [java]                [WARN] Resource 'org/kablink/teaming/gwt/public/images/LdapBrowser/eDir.png' was located via ClassLoader. As a result changes in that resource will not be reflected in per-file recompiles. It should be registered via  <source /> or <resource /> entry in your .gwt.xml. In a future version of GWT, we will remove this fallback and your application will stop compiling

with the 10th warning following by the following:

     [java]                [WARN] Suppressing further ClassLoader resource load warnings.

I'm guessing we'd see this for ALL the images defined in our classes that extend ClientBundle as all are defined in a similar way.  All of our images are defined using the following pattern:

@ImageOptions(repeatStyle = RepeatStyle.Both)
@Source("org/kablink/teaming/gwt/public/images/LdapBrowser/eDir.png")
public ImageResource appEdir();

(this ImageResource corresponds to the warning listed above.)

We've tried several different ways of adding <source> and <resource> tags to our module XML with no success in eliminating these warnings.  Can anybody suggest how a <source> (or <resource>) tag should be structured in our module XML to eliminate them?  Note that at this point, this is purely a cosmetic issue in that everything works (all the images load and display correctly.)  We'd simply like to eliminate the compilation warnings (and be ready to move to future versions of GWT as they become available.

2 things:

  • is there a reason for having your images in your "public path" (assuming your module is rooted in org.kablink.teaming.gwt, then org/kablink/teaming/gwt/public would be the default value for the "public path"), as you're using them in a ClientBundle? if not, then move them out of the public path and in the source path (common practice is to put them next to the ClientBundle interface)
  • assuming your module is in org.kablink.teaming.gwt, it should be either <source path="public"/> or <resource path="public"/>. You can find an example in com.google.gwt.uibinder.UiBinder: https://gwt.googlesource.com/gwt/+/2.7.0/user/src/com/google/gwt/uibinder/UiBinder.gwt.xml (FYI, the <public/> is useless and was added mechanically when adding -enforceStrictResources)
 

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment