Source

clojuresque / scriptoresque / src / main / groovy / clojuresque / ClojureScriptPlugin.groovy

The default branch has multiple heads

Diff from to

File scriptoresque/src/main/groovy/clojuresque/ClojureScriptPlugin.groovy

         configureConfigurations(project)
         configureSourceSets(project)
         configureCompilation(project)
+        configureGzip(project)
     }
 
     private void configureConfigurations(Project project) {
             project.tasks[set.classesTaskName].dependsOn task
         }
     }
+
+    private void configureGzip(Project project) {
+        project.sourceSets.each { set ->
+            if (set.equals(project.sourceSets.test))
+                return
+            def File destDir = project.file(
+                String.format("%s/javascript/%s", project.buildDir.path, set.name))
+
+            String compileTaskName = set.getCompileTaskName("clojureScript")
+            ClojureScriptCompileTask compileTask = project.tasks[compileTaskName]
+
+            String taskName = set.getTaskName("gzip", "clojureScript")
+            ClojureScriptGzipTask gzipTask = project.tasks.add(name: taskName,
+                    type: ClojureScriptGzipTask.class) {
+                destinationDir = destDir
+                source compileTask
+                description =
+                    String.format("Gzip the %s ClojureScript compilate.",
+                            set.name)
+            }
+        }
+    }
 }