Skip to content
Adrian Papari edited this page Jan 6, 2019 · 33 revisions

Incorporating Artemis into my gwt project

General

Typical artemis/gwt integration consists of adding library dependencies including source jars, and adding some configuration to your projects main gwt.xml file.

Add Artemis to your GWT module build process.

  dependencies {
        compile "net.onedaybeard.artemis:artemis-odb-gwt:2.2.0"
        compile "net.onedaybeard.artemis:artemis-odb-gwt:2.2.0:sources"
        compile "net.onedaybeard.artemis:artemis-odb:2.2.0:sources"
}

Add Artemis to Mygame.gwt.xml

  • <inherits name='com.artemis.backends.artemis_backends_gwt' />
  • add <extend-configuration-property name="artemis.reflect.include" value="my.game.components" /> for each package with components and systems (needed for @Wire)

See @Wire if you are having issues with reflection, gwt and artemis.

LibGDX

Example LibGDX project with gwt support: https://github.com/DaanVanYperen/libgdx-artemis-quickstart

Summary: Add dependencies to core and html gradle files, and include artemis into your Mygame.gwt.xml

PlayN

Example PlayN project with gwt support: https://github.com/DaanVanYperen/playn-artemis-quickstart

See below for a rough outline of the steps required for PlayN, refer to the quickstart commits for a step by step guide.

Summary:

  • Add artemis to project main gwt.xml file (see above).
  • Add artemis pom dependencies + source.
  • Add pom dependency for gwt-user, identical to Artemis gwt version (currently 2.6.1)
  • Tweak maven gwt plugin to get the artemis-odb reflection helper to work:
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>gwt-maven-plugin</artifactId>
        <version>2.6.0</version>
        <configuration>
            <enableClosureCompiler>true</enableClosureCompiler>
            <disableClassMetadata>false</disableClassMetadata>
            <disableCastChecking>true</disableCastChecking>
        </configuration>
    </plugin>
Clone this wiki locally