Hello,
I have the following task:
task processMailTemplates {
description "Processes mail templates"
dependsOn npmInstall
outputs.upToDateWhen { false }
def templateSrcDir = "src/main/templates/mail/"
def templateDestDir = "$buildDir/generated-mail-templates/META-INF/templates/mail/"
doFirst {
mkdir templateDestDir
}
doLast {
exec {
//Fails because template destination directory does not exist
commandLine "ls $templateDestDir"
}
def templateNames = []
fileTree(dir: templateSrcDir, include: '**/*.html').visit {
FileVisitDetails details -> templateNames << details.file.name
}
templateNames.each { templateName -> inlineCss(templateSrcDir + templateName, templateDestDir + templateName) }
}
}
I am trying to create a directory from the doFirst closure but it does not work for some reason: the ls $templateDir
fails…
Can anyone please help ?
edit: I also have the following sourceSets configuration:
sourceSets {
main {
output.dir("$buildDir/generated-mail-templates", builtBy: 'processMailTemplates')
}
}