Commits

Meikel Brandmeyer committed 478dfa0

Configure clojuredoc task in plugin setup

  • Participants
  • Parent commits f3d8a73

Comments (0)

Files changed (1)

File clojuresque/src/main/groovy/clojuresque/ClojureBasePlugin.groovy

         configureConfigurations(project)
         configureSourceSets(project)
         configureCompilation(project)
+        configureDocs(project)
         configureTests(project)
         configureClojarsUpload(project)
     }
         }
     }
 
+    private void configureDocs(Project project) {
+        project.sourceSets.each { set ->
+            if (set.equals(project.sourceSets.test))
+                return
+            String docTaskName = set.getTaskName(null, "clojuredoc")
+            ClojureDocTask task = project.tasks.add(name: docTaskName,
+                    type: ClojureDocTask.class) {
+                destinationDir = project.file(
+                    project.docsDir.path + "/clojuredoc"
+                )
+                source set.clojure
+                clojureRoots = set.clojure
+                compileClasspath = set.compileClasspath
+                dependsOn set.compileClasspath
+                description =
+                    String.format("Generate documentation for the %s Clojure source.",
+                            set.name)
+            }
+        }
+    }
+
     private void configureTests(Project project) {
         ClojureTestTask clojureTest = project.tasks.add(name: "clojureTest",
                 type: ClojureTestTask.class) {