1. David Carr
  2. gradle-tagreport-plugin

Commits

David Carr  committed 83e179f

xml: make ordering of patterns repeatable

  • Participants
  • Parent commits 9bedc35
  • Branches default

Comments (0)

Files changed (3)

File src/main/groovy/us/carrclan/david/gradle/tag/TagReportTask.groovy

View file
                 results.matchesGroupedByTag.each { curTag, curMatches ->
                     tag(name: curTag.name) {
                         patterns() {
-                            for (curPattern in curTag.patterns) {
-                                pattern(curPattern.pattern())
+                            for (curPattern in curTag.patterns.collect {it.pattern()}.sort()) {
+                                pattern(curPattern)
                             }
                         }
                         matches() {

File src/test/groovy/us/carrclan/david/gradle/tag/TaglistPluginTest.groovy

View file
 
     private List<TagType> getTagTypes1() {
         return [
-            new TagType(name: "TODO", patterns: [~/TODO/, ~/@todo/]),
+            new TagType(name: "TODO", patterns: [~/TODO/, ~/@todo/, ~/LATER/, ~/@task/]),
             new TagType(name: "XXX", patterns: [~/XXX/])
         ]
     }

File src/test/resources/us/carrclan/david/gradle/tag/report1.expected.xml

View file
 <report>
     <tag name="TODO">
         <patterns>
+            <pattern>@task</pattern>
             <pattern>@todo</pattern>
+            <pattern>LATER</pattern>
             <pattern>TODO</pattern>
         </patterns>
         <matches>