This plugin provides tasks for Scalate
in Gradle build script. Currently, task for precompile
of templates is supported.
Note: Scalate already provides its official plugins to Precompile Templates for Maven and SBT. Use of the official plugin in Maven or SBT is strongly recommended. Use this plugin ** only when ** you somehow have to precompile your scalate templates in Gradle build and unable to change it to Maven or SBT.
- The plugin depends on
'scala'
plugin. Include below in your build script.
apply plugin: 'scala'
-
Add necessary dependencies for scala. See user manual for "gradle scala plugin".
-
Add scalate-core.jar in your project dependencies with
:compile
configuration.
dependencies {
compile 'org.fusesource.scalate:scalate-core:1.5.3'
}
To use the plugin, include in your build script:
apply plugin: 'scalate'
The plugin JAR is needed in the classpath of your build script. You need cloudbees repository aside from central. Below script snippet is an example on how to retrieve the plugin jar.
buildscript {
repositories {
mavenCentral()
maven {
url "http://repository-rmci.forge.cloudbees.com/release/"
}
}
dependencies {
classpath 'murtools:gradle-scalate-plugin:0.0.2'
}
}
The plugin defines the following tasks:
scalatePreCompile
: precompile your templates of ssp, scaml etc. Below properties are defined for this task.templateSrcDir
: (File) root directory where your scalate templates located. Default issrc/main/webapp
.workingDirectory
: (File) directory where generated .scala files will be located.targetDirectory
: (File) directrory where compiled .class files will be located. Default isbuild/classes/main
templates
: (File) path of additional template file aside from thetemplateSrcDir
contextClass
: (String) class name of RenderContext to precompile. Default is ServletRenderContextbootClassName
: (String) boot class name