Skip to content

08. Advanced Features

Fernando Rubbo edited this page Jan 10, 2015 · 3 revisions

In this option we describe the advanced features and configurations

Templating options

There are some options for templating:

The default template engine is Groovy Templates. However, you change this on settings in build.gradle file. For example:

scd4j {
    install {
        modules .. 
        config ..		
    }	
    settings {
        template {
            engine "mustache"
        }
    }
}

The options you can provide in 'settings - template - engine' are:

  • groovy for Groovy Templates (default)
  • velocity for Apache Velocity
  • mustache for Mustache
  • handlebars for Handlebars

Using Path Variables

SCD4J also allows you to use variables to define the directory and/or file names. The syntax to use this feature requires that you define the name of the variable between @. For example:

modules/
     my_module/
             Module.hook
             my_dir_@varName@/
                            file_@anotherVarName@.txt

In the above example, you can see two variables being used: (1) varName to define the name of the directory and (2) anotherVarName to define the name of the file.

Those variables may be set in the scd4j config file or programatically using methods defined in ModuleHook.java or FileHook.java, depending the objective.

Clone this wiki locally