Using a different template for generating scripts

Overriding the templates used for generating start scripts for application plugin is ugly

    (unixStartScriptGenerator as TemplateBasedScriptGenerator).template = project.resources.text.fromFile(file("path/to/my/file.sh"))
    (windowsStartScriptGenerator as TemplateBasedScriptGenerator).template = project.resources.text.fromFile(file("path/to/my/file.bat"))

(Groovy DSL is not much better either).

Is there any better way to write this?