From e646036af47f6633105f1bb138a5fc7fc65ef159 Mon Sep 17 00:00:00 2001 From: orctom Date: Tue, 19 Sep 2017 23:11:45 +0800 Subject: [PATCH] #19 adding support for comments and blank lines --- .../groovy/com/orctom/gradle/archetype/util/FileUtils.groovy | 3 +++ src/test/resources/sample/src/main/resources/.nontemplates | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/main/groovy/com/orctom/gradle/archetype/util/FileUtils.groovy b/src/main/groovy/com/orctom/gradle/archetype/util/FileUtils.groovy index 76f3a16..e3691aa 100644 --- a/src/main/groovy/com/orctom/gradle/archetype/util/FileUtils.groovy +++ b/src/main/groovy/com/orctom/gradle/archetype/util/FileUtils.groovy @@ -56,6 +56,9 @@ class FileUtils { Set nonTemplatesWildcards = nonTemplatesFile.readLines() as Set FileNameFinder finder = new FileNameFinder() nonTemplatesWildcards.each { + if (null == it || 0 == it.trim().length() || it.startsWith("#")) { + return + } def files = finder.getFileNames(templateDirPath, it) nonTemplates.addAll(files) } diff --git a/src/test/resources/sample/src/main/resources/.nontemplates b/src/test/resources/sample/src/main/resources/.nontemplates index 4e435a3..bc7da0f 100644 --- a/src/test/resources/sample/src/main/resources/.nontemplates +++ b/src/test/resources/sample/src/main/resources/.nontemplates @@ -1,3 +1,4 @@ +# comments **/*.jar **/*.bat **/*.sh @@ -6,7 +7,9 @@ **/*.xz **/*.tar **/*.7z + gradle/ .gradle/ + gradlew gradlew.bat \ No newline at end of file