Optional module installation

29 views
Skip to first unread message

Trevor Stewart

unread,
Jan 27, 2015, 4:03:12 PM1/27/15
to gwt-pl...@googlegroups.com
What is the easiest/correct way to optionally install a module?  We have a case where we would like to have a presenter and view only available in the application when running in "development" mode, where that mode is set by a flag in the .gwt.xml file.

Previously, we were running GXT with an MVC architecture and would do the following in our module:
  <replace-with class="com.mypackage.DevEditController" >
    <all>
        <when-property-is name="isDevelopment" value="true" />
        <when-type-is class="com.mypackage.EditController" />
    </all>
  </replace-with>
  <replace-with class="com.mypackage.StubEditController" >
    <all>
        <when-property-is name="isDevelopment" value="false" />
        <when-type-is class="com.mypackage.EditController" />
    </all>
  </replace-with>

And would create the controller with the following:
(EditController)GWT.create(EditController.class);

I would like to do something similar with GWTP, where the non-development compile of the application wouldn't know anything about this presenter.  Essentially, doing something along the lines of this in our module file:
<set-configuration-property name="gin.ginjector.modules" 
                              value="com.mypackage.gin.SharedModule"/>

if this is development mode:
<set-configuration-property name="gin.ginjector.module.desktop"
                              value="com.mypackage.gin.DevDesktopModule"/>
else:
<set-configuration-property name="gin.ginjector.module.desktop"
                              value="com.mypackage.gin.DesktopModule"/>

Where DesktopModule and DevModule would do the same things, but DevDesktopModule would load an additional module containing the presenter/view binding.

Is this doable from a configuration perspective, or is it easier to just have two .gwt.xml files and alternate them as part of the build?


Thank you.

Maxime Mériouma-Caron

unread,
Feb 24, 2015, 2:54:10 PM2/24/15
to gwt-pl...@googlegroups.com
GWTP doesn't provide that feature. We usually have different gwt.xml files that are handled as part of the maven build with profiles
Reply all
Reply to author
Forward
0 new messages