How to determine whether you're in SuperDevMode inside (custom) linker code

34 views
Skip to first unread message

bobbit...@gmail.com

unread,
Jun 10, 2017, 7:22:17 AM6/10/17
to GWT Users
Inside the linker code, I can only use com.google.gwt.core.shared.GWT, so I can't call APIs such as GWT.getModuleBaseForStaticFiles() or GWT.getModuleBaseURL() (which people have used to detect SDM) and while GWT.create() is doc'd in com.google.gwt.core.shared.GWT, it doesn't work and throws a runtime exception saying I can only use in "client code" (which I guess excludes the linker).  So the trick involving the superdevmode property and deferred binding also doesn't work.

So how can I detected SDM inside the linker?

Thomas Broyer

unread,
Jun 10, 2017, 9:12:32 AM6/10/17
to GWT Users
You can look for the "superdevmode" property value out of the LinkerContext.

The tricks you mention are for client-side code, at runtime; not at compile-time.

As for GWT.create(), have a look at ServerGWTBridge to see how that could be used outside of GWT client code. Though I'd discourage that use, that's not future-proof.

Reply all
Reply to author
Forward
0 new messages