Skip to content
Daan van Yperen edited this page Sep 29, 2015 · 33 revisions

Gradle

1.7.1+

Basics

Weaving and factories might not work with older versions of Gradle! Use a recent version

Gradle is a bit more involved. It operates in place on .class files, you will have to hook the weave task somewhere in your build process. See next chapter for a concrete example.

  1. Add plugin dependency to your build script classpath "net.onedaybeard.artemis:artemis-odb-gradle-plugin:0.13.1".
  2. Add repository jcenter(), which contains dependencies for the artemis gradle plugin.
  3. Apply the plugin apply plugin: "artemis"
  4. Specify classes folder with Weave.classesDir
  5. Use weave.dependsOn to have it run somewhere after building.
  6. (Optional) make your final build step depend on weave (lastTask.dependsOn weave).
weave {
    classesDir = sourceSets.main.output.classesDir
    dependsOn build
    enableArtemisPlugin = true
    enablePooledWeaving = true
    ideFriendlyPacking = true
    optimizeEntitySystems = true
}

See https://github.com/DaanVanYperen/libgdx-artemis-quickstart for an up to date example.

Clone this wiki locally