My Copy task copies multiple sources:
For example:
task initConfig(type: Copy) {
from('src/main/config') {
include '**/*.properties'
include '**/*.xml'
filter(ReplaceTokens, tokens: [version: '2.3.1'])
}
from('src/main/config') {
exclude '**/*.properties', '**/*.xml'
}
from('src/main/languages') {
rename 'EN_US_(.*)', '$1'
}
into 'build/target/config'
}
When one of the sources doesn't exist, the task doesn't fail nor log an error.
Using "inputs.sourceFiles.empty" as a solution works just for a single source:
Using assert to each source...is not an elegant solution since I have a lot of sources.
assert file("bla bla").exists()
How can I fail the task when one of the sources is missing?