Commits

Meikel Brandmeyer  committed c4e9f60

Allow setting *warn-on-reflection* per source set

Refers #3

  • Participants
  • Parent commits c26b3e2

Comments (0)

Files changed (3)

File src/main/groovy/de/kotka/gradle/ClojureCompileTask.groovy

 
     private void initialise() {
         def action = [ execute: { ClojureCompileTask task ->
+            boolean warnOnReflection = task.sourceSet.warnOnReflection
             Set<File> sourceDirs = task.sourceSet.srcDirs
             File destDir = task.destinationDir
             FileTree source = task.source
             ant.java(args) {
                 sysproperty(key: "clojure.compile.path", value: destDir)
                 sysproperty(key: "clojure.compile.warn-on-reflection",
-                    value: "false")
+                    value: warnOnReflection)
                 source.each {
                     arg(value: it)
                 }

File src/main/groovy/de/kotka/gradle/ClojureSourceSet.groovy

     public ClojureSourceSet clojure(Closure closure)
     public FileTree getAllClojure()
     public Set<File> getSrcDirs()
+    public boolean getWarnOnReflection()
+    public void setWarnOnReflection(boolean flag)
 }

File src/main/groovy/de/kotka/gradle/DefaultClojureSourceSet.groovy

     private DefaultSourceDirectorySet clojure
     private PatternSet clojurePatterns
     private UnionFileTree allClojure
+    private boolean warnOnReflection
 
     public DefaultClojureSourceSet(String displayName,
             FileResolver fileResolver) {
         clojurePatterns.include("**/*.clj")
 
         allClojure = new UnionFileTree(desc, clojure.matching(clojurePatterns))
+
+        warnOnReflection = false
     }
 
     public DefaultSourceDirectorySet getClojure() {
     public Set<File> getSrcDirs() {
         return clojure.srcDirs
     }
+
+    public boolean getWarnOnReflection() {
+        return warnOnReflection
+    }
+
+    public void setWarnOnReflection(boolean flag) {
+        warnOnReflection = flag
+    }
 }