orctom/gradle-archetype-plugin

variable substitution not working if any empty line in .nontemplates

Closed this issue · 2 comments

This weird behavior happens if there any empty line in the .nontemplates file:

**/*.jar
**/*.bat
**/*.sh
**/*.zip
**/*.gz
**/*.xz
**/*.tar
**/*.7z

gradle/
.gradle/
gradlew
gradlew.bat

You can reproduce the bug simply by modifying the .nontemplates and run command against your sample project:

$ gradle cleanArch generate

$ cat generated/settings.gradle
include "@projectName@-model", "@projectName@-web"

// @packagePath@
// @groupPath@/@namePath@
// @name.capitalize()@
// @new Date()@

Circumstances are I want to add more patterns to .nontemplates, and use empty(or blank) lines to make it easier for grouping purpose. I came across this problem just in that case, and finally find the bug. Either this behavior should be mentioned in the README or be fixed.

Also, supporting comments (e.g., lines start with '#') is expected, but I didn't test against that yet.

Checkout version 1.4.6