Skip to content

davidzchen/gradle-dustjs-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gradle Dust.js Plugin Build Status

A Gradle plugin that compiles templates. This plugin requires LinkedIn Dust.js and uses Rhino to run the Dust compiler.

Usage

Add the plugin

Add a buildscript dependency on the plugin to pull the artifact for the plugin:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'com.linkedin:gradle-dustjs-plugin:1.0.0'
  }
}

Apply the plugin

apply plugin: 'dustjs'

Configure the Plugin

dustjs {
  source = fileTree('src/main/tl') {
    include 'template.tl'
  }
  dest = 'src/main/webapp/assets/js'
}

Tasks

This plugin adds the dustjs task and the implicit cleanDustjs task.

dustjs

The dustjs task compiles the specified Dust .tl files from the source directory into .js files into the dest directory.

The basename of the template file is used as the template name. For example, if one of the files to be compiled is template.tl, then running the plugin is equivalent to the following dustc invocation:

$ dustc --name=template source/template.tl dest/template.js

cleanDustjs

The cleanDustjs task completely deletes the dest directory.

Acknowledgements

This plugin makes use of code adapted from Oliver Becker's Gradle LESS plugin and Jonathan Parsons' Play Framework Dust.js plugin.

About

Gradle plugin for compiling Dust.js templates

Resources

License

Stars

Watchers

Forks

Packages

No packages published