Though we do not make a promise to process GWT.create() of entry point
types before any other GWT.create() calls, it was easy to restore this
behavior in incremental, so I went ahead and did it (
https://gwt-review.googlesource.com/#/c/10410/).

You should probably find a way not to depend on this in the future, as it
is not promised and may change again.


On Mon Nov 17 2014 at 2:07:02 PM Christopher Viel <
viel.christop...@gmail.com> wrote:

> Hi,
>
> I'm gonna add some more background here.
>
> The generator generates a bunch of file and binds the interfaces using
> GIN. I would't say this is strictly necessary, but it brings the advantages
> of DI to the generated code. So we have an Entry Point that is an interface
> and a rebind rule. UserAgentAsserter uses a similar technique. What we also
> do is generate a Ginjector interface and put a
> *GWT.create(GeneratedGinjector.class)* call inside the generated entry
> point. That way GIN's generator is called after and everything should be
> resolvable. The generated ginjector is setup to look at a specific property
> to load additional gin modules. Here it happens  that one of them is also
> generated. So all of that actually work with 2.7.
>
> What no longer works is if the entry point and the ginjector are no longer
> generated. If there is a GWT.create() call that resolves to a Ginjector
> from an explicit entry point, it fails. I'm not sure I'm being very clear
> here so here's an example:
>
> *MyModule.gwt.xml:*
> <module>
>     <entry-point class="com.project.EntryPointToGenerate"/>
>     <entry-point class="com.project.ExplicitEntryPoint"/>
>
>     <extend-configuration-property name="gin.ginjector.modules"
>             value="com.project.GeneratedGinModule"/>
>
>     <generate-with class="com.project.EntryPointGenerator">
>         <when-type-is class="com.project.EntryPointToGenerate"/>
>     </generate-with>
> </module>
>
> *EntryPointToGenerate:*
> public interface EntryPointToGenerate extends EntryPoint {}
>
> *EntryPointGenerator*: Generates *com.project.GeneratedGinModule* and an
> implementation of *EntryPointToGenerate*
>
> *ExplicitEntryPoint*:
> public class ExplicitEntryPoint implements EntryPoint {
>     private static final ExplicitGinjector GINJECTOR = GWT.create(
> ExplicitGinjector.class);
>
>     @Override
>     public void onModuleLoad() {}
> }
>
> *ExplicitGinjector:*
> @GinModules( value = ExplicitGinModule.class, properties =
> "gin.ginjector.modules" )
> public interface ExplicitGinjector extends Ginjector {
>     /* snip */
> }
>
> With this code in a regular compilation, EntryPointToGenerate is generated
> before ExplicitEntryPoint is traversed. With incremental compilation,
> ExplicitEntryPoint is traversed (and incidentally GINs generator is called)
> before EntryPointGenerator is called. I would expect the first entry point
> to be traversed at first, even if it means calling a generator.
>
> On Sunday, November 16, 2014 3:56:20 PM UTC-5, Nicolas Morel wrote:
>>
>> Hi,
>>
>> I'm currently testing GWT 2.7.0-rc1 and one of my project using GWTP
>> Rest-Dispatch <https://github.com/ArcBees/GWTP/wiki/Rest-Dispatch> is
>> not working under SDM.
>> The compilation fails with this error :
>>
>>                   [ERROR] Unable to load gin module type
>> [com.gwtplatform.dispatch.rest.client.RestGinModule], maybe you haven't
>> compiled your client java sources?
>> java.lang.ClassNotFoundException: com$gwtplatform$dispatch$rest$
>> client$RestGinModule
>> at com.google.gwt.inject.rebind.GinBridgeClassLoader.findClass(
>> GinBridgeClassLoader.java:150)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>> at com.google.gwt.inject.rebind.GinBridgeClassLoader.loadClass(
>> GinBridgeClassLoader.java:108)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:340)
>> at com.google.gwt.inject.rebind.GinjectorGenerator.loadClass(
>> GinjectorGenerator.java:223)
>> at com.google.gwt.inject.rebind.GinjectorGenerator.
>> getPropertyModuleClasses(GinjectorGenerator.java:137)
>> at com.google.gwt.inject.rebind.GinjectorGenerator.getModuleClasses(
>> GinjectorGenerator.java:116)
>> at com.google.gwt.inject.rebind.GinjectorGenerator.generate(
>> GinjectorGenerator.java:72)
>> at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(
>> IncrementalGenerator.java:40)
>>
>> The full stack trace is available in attachment.
>>
>> The problem has been reported to the GWTP team here
>> <https://github.com/ArcBees/GWTP/issues/614>. The "normal" compilation
>> works but not the incremental compile from SDM.
>>
>> I made a simple example available here
>> <https://github.com/nmorel/hello-gwt-rest-dispatch>.
>>
>> From what I saw, the RestGinModule that gin is trying to load is
>> generated by a GWT generator (VelocityGenerator
>> <https://github.com/ArcBees/GWTP/blob/master/gwtp-core/gwtp-dispatch-rest/src/main/java/com/gwtplatform/dispatch/rest/rebind/VelocityGenerator.java>
>> .generateRestGinModule()) and passed to gin through the property
>>  "gin.ginjector.modules".
>> It seems unconventional but was working before.
>> Any ideas what is going on please ?
>>
>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "GWT Contributors" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-web-toolkit-contributors/57be9c00-e1f2-4c99-ad20-40c0c86943aa%40googlegroups.com
> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/57be9c00-e1f2-4c99-ad20-40c0c86943aa%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/CAFw3gJ-r-Dc2Hgjpx8BCXwA6DWyxm2KzbcvKi-QhEF6O%2BBAOug%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to