Hi,
I have a question related to best practices. Where should task incrementality be defined?
Let’s say we have a custom task class that has no knowledge of the structure of files on the filesystem. However to property define incrementality, the exact directory structure needs to be defined.
So the question is: Should the task incrementality be defined in custom task class or task definition?
class MakeLinux86GfxStaticLibraryTask extends DefaultTask {
static enum ScaleformBinaryType { RELEASE, SHIPPING, DEBUG }
ScaleformBinaryType scaleformBinaryType = null
@TaskAction
def makeGfx() {
project.exec {
workingDir "${project.projectDir}/gfx"
environment 'CFLAGS', '-m32'
commandLine 'ruby', 'make.rb', '--config', scaleformBinaryType.name().toLowerCase()
}
}
}
task makeLinux_x86ReleaseGfxStaticLibrary(type: MakeLinux86GfxStaticLibraryTask) {
scaleformBinaryType = MakeLinux86GfxStaticLibraryTask.ScaleformBinaryType.RELEASE
inputs.files fileTree(dir: "$projectDir/gfx", includes: ['*.rb', '*.sjson'])
inputs.files fileTree(dir: "$projectDir/gfx/gradle", include: '*.sh')
def libpath = "$projectDir/gfx/Lib/linux/makefile/release/"
outputs.files(["$libpath/libAIR_SCU.a",
"$libpath/libAppFramework_OPENGL.a"])
}
task makeLinux_x86ShippingGfxStaticLibrary(type: MakeLinux86GfxStaticLibraryTask) {
scaleformBinaryType = MakeLinux86GfxStaticLibraryTask.ScaleformBinaryType.SHIPPING
inputs.files fileTree(dir: "$projectDir/gfx", includes: ['*.rb', '*.sjson'])
inputs.files fileTree(dir: "$projectDir/gfx/gradle", include: '*.sh')
def libpath = "$projectDir/gfx/Lib/linux/makefile/shipping/"
outputs.files(["$libpath/libAIR_SCU.a",
"$libpath/libAppFramework_OPENGL.a"])
}
Thanks