Commits

Meikel Brandmeyer committed 26a775a

Clean up incremental compile code

Comments (0)

Files changed (1)

clojuresque-base/src/main/groovy/clojuresque/tasks/ClojureCompile.groovy

             if (it.file.path.endsWith(".clj"))
                 outOfDateInputs << it.file
         }
-        inputs.removed   { deleteDerivedFiles(it.file) }
+        inputs.removed {
+            if (it.file.path.endsWith(".clj"))
+                deleteDerivedFiles(it.file)
+        }
 
         def toCompile = findDependentFiles(outOfDateInputs, dependencyGraph)
 
         }
     }
 
-    public findDependentFiles(outOfDateFiles, dependencyGraph) {
+    def findDependentFiles(outOfDateFiles, dependencyGraph) {
         def toCompile = [] as Set
         outOfDateFiles.each {
-            toCompile.add(it)
-            def dependents = dependencyGraph[it]
-            if (dependents)
-                toCompile.addAll(dependents)
+            toCompile << it
+            dependencyGraph[it].each { dep -> toCompile << dep }
         }
         toCompile
     }
 
-    public deleteDerivedFiles(parent) {
+    def deleteDerivedFiles(parent) {
         def relativeParent = getSrcDirs().findResult {
             Util.relativizePath(it, parent)
         }