I’m currently working on the Lazybones Gradle plugin. The plugin registers an extension using a custom LazybonesConventions class. I then use convention mappings to map the extension properties to task properties. This was working until I tried to map to a Zip task’s ‘excludes’ property:
def task = project.tasks.create(taskName, Zip)
task.with {
conventionMapping.map("baseName") { tmplName + project.extensions.lazybones.packageNameSuffix }
conventionMapping.map("destinationDir") { project.extensions.lazybones.packagesDir }
includeEmptyDirs = true
version = project.file("$tmplDir/VERSION").text.trim()
from tmplDir
conventionMapping.map("excludes") { project.extensions.lazybones.packageExcludes }
}
The exclusions don’t appear to work. If I set the ‘excludes’ property to a literal list, those files are excluded as expected. Is there any way to achieve what I want? Is the ‘excludes’ property special in some way such that the convention mapping doesn’t work?