Skip to content
Daan van Yperen edited this page Sep 16, 2016 · 2 revisions

Will the fluid interface work with GWT/HTML target?

GWT is supported.

Assuming a default LibGDX or artemis-odb-quickstart project:

  1. Include the components module in your html/build.gradle

    task addSource << {
        sourceSets.main.compileClasspath += files(project(':core').sourceSets.main.allJava.srcDirs)
        sourceSets.main.compileClasspath += files(project(':components').sourceSets.main.allJava.srcDirs)
    }
  2. Create a gwt include file for your component module '/components/src/GdxArtemisComponents.gwt.xml'

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "http://google-web-    toolkit.googlecode.com/svn/trunk/distro-source/core/src/gwt-module.dtd">
    <module>
    	<source path="com/mycompany/game/component" />
    </module>

1. include the component module in your main `.gwt.xml` so gwt will be able to find all sources.

    ```xml
       <inherits name='GdxArtemisComponents'/>
       <inherits name='GdxArtemisGame'/>
    ```
  
1. Make sure the reflection generator for Artemis knows about the fluid classes in `.gwt.xml`, or it will complain about missing type information at launch.

```xml
    <extend-configuration-property name="artemis.reflect.include" value="com.artemis.SuperMapper"/>
    <extend-configuration-property name="artemis.reflect.include" value="com.artemis.E"/>

That's about it! gradle html:dist

Clone this wiki locally