0.1.14 • Published 8 years ago
grunt-atlassian-soy v0.1.14
grunt-atlassian-soy
Uses Atlassian's Soy compiler to compile Soy files to JS. Optionaly compiles soy templates for each I18n file specified.
You can find the required JAR file in Atlassian's Soy Template Repository.
Getting Started
This plugin requires Grunt >=0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
$ npm install --save-dev grunt-atlassian-soy
Usage
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
soy: {
soy: {
target1: {
basedir:'base',
glob:'*.soy',
outputPath:'out',
extension:'.soy.js',
i18n: 'name_of_i18n_file.properties',
soyToJsJarPath:'path/to/jar.jar',
propPath:'path/to/i18n/files',
},
target2: {
basedir:'base',
glob:'*.soy',
outputPath:'out',
extension:'.soy.js',
i18n: 'name_of_i18n_file.properties',
soyToJsJarPath:'path/tojar.jar',
propPath:'path/to/i18n/files',
}
}
});
grunt.registerTask('default', ['soy']);
Options
Because of how Grunt works an additional level of configuration is required since the compiler runs all tasks in parallel.
basedir, glob, outputPath, extension, i18n
soyToJSJarPath
Type: String
The path to the Soy Template compiler JAR file
propPath
Type: String
The directory containing I18n files