riiablo/core/build.gradle

127 lines
4.0 KiB
Groovy

apply plugin: 'java-library'
apply plugin: 'artemis'
apply plugin: 'io.netifi.flatbuffers'
import io.netifi.flatbuffers.plugin.tasks.FlatBuffers
import org.gradle.internal.os.OperatingSystem
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets.main.resources.srcDirs += rootProject.file('assets')
idea.module.resourceDirs += rootProject.file('assets')
project.ext.generatedSourceDirs = file('gen/main/java/')
sourceSets.main.java.srcDirs += generatedSourceDirs
idea.module.generatedSourceDirs += generatedSourceDirs
project.ext.flatbuffersSourceDirs = file('src/main/flatbuffers/')
// LibGDX
dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-ai:$gdxAiVersion"
api "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
}
// Libraries
dependencies {
api "com.android.support:support-annotations:28.0.0"
api "commons-io:commons-io:2.5"
api "org.apache.commons:commons-lang3:3.9"
api "org.apache.commons:commons-collections4:4.1"
api "org.apache.commons:commons-math3:3.6.1"
api "org.apache.commons:commons-text:1.8"
api "com.jcraft:jzlib:1.1.3"
}
// Networking
dependencies {
api "com.google.flatbuffers:flatbuffers-java:$flatbuffersVersion"
api "io.netty:netty-all:$nettyVersion"
}
// Box2D (to be deprecated)
dependencies {
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
}
// Logging
// Some utilities do not work on Android
// Intended for use in :desktop to get package tree at runtime for debugging
dependencies {
api "org.reflections:reflections:0.9.12"
}
// Artemis ODB
dependencies {
// components to expose
api "net.onedaybeard.artemis:artemis-odb:$artemisOdbVersion"
api "net.mostlyoriginal.artemis-odb:contrib-core:$artemisContribVersion"
//api "net.mostlyoriginal.artemis-odb:contrib-jam:$artemisContribVersion"
// Artemis-odb
api "net.onedaybeard.artemis:artemis-odb:$artemisOdbVersion"
// api "net.onedaybeard.artemis:artemis-odb-serializer-json-libgdx:$artemisOdbVersion"
// Artemis-odb bonus functionality (systems, events, components).
api "net.mostlyoriginal.artemis-odb:contrib-core:$artemisContribVersion"
//api "net.mostlyoriginal.artemis-odb:contrib-jam:$artemisContribVersion"
api "net.mostlyoriginal.artemis-odb:contrib-eventbus:$artemisContribVersion"
//api "net.mostlyoriginal.artemis-odb:contrib-plugin-operations:$artemisContribVersion"
//api "net.mostlyoriginal.artemis-odb:contrib-plugin-profiler:$artemisContribVersion"
//api "net.mostlyoriginal.artemis-odb:contrib-plugin-singleton:$artemisContribVersion"
}
dependencies {
testImplementation "junit:junit:4.12"
testImplementation "com.badlogicgames.gdx:gdx-backend-headless:$gdxVersion"
testImplementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
// TODO: configure atemis weave and debug unknown primitive type [B error
// weave {
// classesDir = sourceSets.main.java.outputDir
// enableArtemisPlugin = true
// enablePooledWeaving = true
// generateLinkMutators = true
// optimizeEntitySystems = true
// }
//
// classes.finalizedBy weave
flatbuffers {
flatcPath = rootProject.file('flatbuffers/flatc.exe')
language = 'java'
flatBuffersVersion = flatbuffersVersion
}
task createFlatBuffers(type: FlatBuffers) {
doFirst {
if (OperatingSystem.current() != OperatingSystem.WINDOWS) {
throw new GradleException("'$name' can only run on Windows")
}
}
inputDir = flatbuffersSourceDirs
outputDir = generatedSourceDirs
}
task generateSources {
outputs.dir project.ext.flatbuffersSourceDirs
}
if (OperatingSystem.current() != OperatingSystem.WINDOWS) {
logger.warn("Disabling $createFlatBuffers.name because it can only run on Windows")
createFlatBuffers.enabled = false
}
generateSources.dependsOn 'createFlatBuffers'
compileJava.dependsOn 'generateSources'
//tasks.withType(JavaCompile) {
// options.compilerArgs << '-Xlint:unchecked'
// options.deprecation = true
//}