sbt-native-packager
sbt-native-packager copied to clipboard
Evaluate templating system alternatives
Status Quo
Native-packager has currently a homemade templating system, which has scaled well so far. It provides the following features
- one-time resolving of placeholders
- bash and bat friendly surroundings (
${{placeholder}}
and@@placeholder@@
) - different charsets and eol styles
- placeholder definition as
Seq[(String,String)]
, allowing duplicate additions
These features limited the usage in many ways, which lead to the following hard to use/debug issues
- Template nesting is done with placeholders, which means the value's in the
replacements: Seq[(String,String)]
become incredible large strings, making debugging hard and nested resolving a manual work. - Different placeholder styles need additional configuration
- No typing for template and global namespaces (
linuxScriptReplacements
,bashScriptReplacements
) lead to a lot of clutter and hard to understand mechanisms - Untested internal library
Requirements
The experience lead to the following requirements
- Typed templates as much as possible
- Separate namespaces for templates
- Testable: unit tests and shellcheck tests
- Nesting of templates
- Recursive resolving
- Support optional values
- Scala 2.10 or Java
Acceptance Criteria
- [ ] All templates use the new templating system
- [ ] All bash scripts are tested with shellcheck
First candidate is scalate with mustache templates.
sbt-pack uses twirl.