/gradle-scalate-plugin

This plugin provides tasks for Scalate in Gradle build script.

Primary LanguageGroovy

Gradle Scalate plugin

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.

Prerequired

  • The plugin depends on 'scala' plugin. Include below in your build script.
    apply plugin: 'scala'
        dependencies {
            compile 'org.fusesource.scalate:scalate-core:1.5.3'
        }

Usage

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'
        }
    }

Tasks

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 is src/main/webapp.
  • workingDirectory: (File) directory where generated .scala files will be located.
  • targetDirectory: (File) directrory where compiled .class files will be located. Default is build/classes/main
  • templates: (File) path of additional template file aside from the templateSrcDir
  • contextClass: (String) class name of RenderContext to precompile. Default is ServletRenderContext
  • bootClassName: (String) boot class name

Todo