-
Notifications
You must be signed in to change notification settings - Fork 113
Weaving Gradle
Adrian Papari edited this page Jan 6, 2019
·
33 revisions
1.7.1+
Weaving and factories do 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.
- Add plugin dependency to your build script
classpath "net.onedaybeard.artemis:artemis-odb-gradle-plugin:2.2.0"
. - Add repository
jcenter()
, which contains dependencies for the artemis gradle plugin. - Apply the plugin
apply plugin: "artemis"
- Specify classes folder with
Weave.classesDir
- Use
weave.dependsOn
to have it run somewhere after building. - (Optional) make your final build step depend on weave (lastTask.dependsOn weave).
weave {
classesDir = sourceSets.main.output.classesDir
dependsOn build
enableArtemisPlugin = true
enablePooledWeaving = true
generateLinkMutators = true
optimizeEntitySystems = true
}
NOTE for Gradle 4.0.1: Since this version onward Gradle splits classes by language type in the build folder in order to support mixed language builds. If you want to comply with this replace classesDir = sourceSets.main.output.classesDir with classesDir = new File(buildDir, "classes/java/main") in the above snippet.
See https://github.com/DaanVanYperen/libgdx-artemis-quickstart for an up to date example.
- Overview
- Concepts
- Getting Started
- Using
- More guides
- Plugins
- Game Gallery
- Tools and Frameworks
- API reference