cookery/core/build.gradle
2020-04-27 00:01:12 +02:00

47 lines
No EOL
1.3 KiB
Groovy

sourceCompatibility = '1.8'
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
sourceSets {
main {
java.srcDirs = [ "src/" ]
resources.srcDirs= ["resources/"]
}
test {
java.srcDirs = ["test/"]
}
}
dependencies {
compile "org.jmonkeyengine:jme3-core:${jme3Version}-stable"
compile "org.jmonkeyengine:jme3-terrain:${jme3Version}-stable"
implementation 'se.koc:zutil:1.0.0-SNAPSHOT'
testImplementation "org.junit.jupiter:junit-jupiter-engine:5.5.2"
testImplementation "org.junit.platform:junit-platform-runner:1.5.2"
}
task buildResources {
def sourcePath = project.file("resources")
def targetPath = project.file("build/resources/main/")
fileTree(dir: sourcePath).each { sourceFile ->
if (sourceFile.getName().endsWith(".blend")) {
println "Exporting: ${sourceFile}"
def tmpFile = sourceFile.getAbsolutePath().replace(sourcePath.absolutePath, targetPath.absolutePath)
tmpFile = tmpFile.replaceAll(".blend\$", ".fbx")
def targetFile = new File(tmpFile)
println " - Output: ${targetFile}"
exec {
executable "sh"
args "-c", "blender.exe --background '${sourceFile}' --python 'blender-export.py' -- '${targetFile}'"
}
}
}
}
test {
useJUnitPlatform()
}