nebula.plugin.ospackage.daemon.DaemonTemplateTask.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nebula-ospackage-plugin Show documentation
Show all versions of nebula-ospackage-plugin Show documentation
Opinionated plugins that wrap the gradle-ospackage-plugin
package nebula.plugin.ospackage.daemon
import org.gradle.api.internal.ConventionTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.TaskAction
/**
* Monster class that does everything.
*/
class DaemonTemplateTask extends ConventionTask {
//@Input
Map context
//@Input
Collection templates
@Input
File destDir
@TaskAction
def template() {
TemplateHelper templateHelper = new TemplateHelper(getDestDir(), '/nebula/plugin/ospackage/daemon')
getTemplates().collect { String templateName ->
templateHelper.generateFile(templateName, getContext())
}
}
//@OutputFiles
Collection getTemplatesOutout() {
return templates.collect {
new File(destDir, it)
}
}
}