riiablo/core/build.gradle
Collin Smith 6e44b4d745 Refined flatbuffers dependency implementation (see #132)
Included flatc.exe within repository (v1.11.0 binary)
Added check within :core:createFlatBuffers task for Windows OS family
Added flatbuffersVersion variable within gradle.properties to 1.11.0
Changed many fields to variables and implemented flatbuffers closure
2020-12-01 10:02:07 -08:00

103 lines
3.4 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/java/com/riiablo/net/')
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"
}
dependencies {
api "com.google.guava:guava:20.0"
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"
api "com.google.flatbuffers:flatbuffers-java:$flatbuffersVersion"
}
dependencies {
api "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
}
dependencies {
api "org.reflections:reflections:0.9.12"
}
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 {
api "io.netty:netty-all:$nettyVersion"
}
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("'flatc' can only run on Windows")
}
}
inputDir = flatbuffersSourceDirs
outputDir = generatedSourceDirs
}