Basics

Templates is a concept where plybuild effectively merges one project into another. Templates are added to the cloud-config repo under a templates folder, example, and are later referred to by their folder name in the plybuild.json file. A template, like most projects, consists of these filetypes:

Filetypes

Filetypes in templates are

.kt and .java files

If a template supplies a .kt or a .java file, the file is copied to its right destination and the package com.example... line in top of the file is replaced to support the target. I with the same path and filename is found in the target, the file is ignored.

*.properties files

If a template supplies a *.properties file the file is parsed by key=value pairs, and merged correctly into the target. If the target is missing a properties file with the same name as the template supplies, the whole file is copied. plybuild does not check key=value pairs across properties files.

pom.xml files

If a template and the target supplies a pom.xml file, the templates pom.xml following definitions are merged over:

  • <dependencies>
  • <dependencyManagement>
  • <build><plugins>

text files (default)

All files not matching the above is eighter copied over if the target does not contain it, or the differences are merged into the end of the targetfile.

Situations

Templates is used in the following situations

During build

See commands build

During merge

See commands add