Disable :core:createFlatBuffers task at configuration level if building on non-Windows

Disable :core:createFlatBuffers task at configuration level if building on non-Windows
Added warning messages stating that it's been disabled (should add check)
This commit is contained in:
Collin Smith
2020-12-01 18:21:49 -08:00
parent 85780c6ba8
commit 0e2313c44a

View File

@ -92,8 +92,8 @@ flatbuffers {
task createFlatBuffers(type: FlatBuffers) {
doFirst {
if (!state.upToDate && OperatingSystem.current() != OperatingSystem.WINDOWS) {
throw new GradleException("'$name' can only run on $OperatingSystem.WINDOWS")
if (OperatingSystem.current() != OperatingSystem.WINDOWS) {
throw new GradleException("'$name' can only run on Windows")
}
}
@ -105,5 +105,10 @@ 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'