summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Perry <maperry78+github@gmail.com>2015-09-17 14:14:55 +1000
committerMark Perry <maperry78+github@gmail.com>2015-09-17 14:14:55 +1000
commit73356defc605ac514e89f2b9b0a423732bf2c44e (patch)
tree9a35ac50ad26dad6e00ece0dd7c12e698fed2e0a
parent16a76f63a3712b43b3e134a26893afcd34e4afd9 (diff)
downloadfrege-gradle-plugin-73356defc605ac514e89f2b9b0a423732bf2c44e.tar.gz
frege-gradle-plugin-73356defc605ac514e89f2b9b0a423732bf2c44e.tar.bz2
frege-gradle-plugin-73356defc605ac514e89f2b9b0a423732bf2c44e.zip
Added help to fregeDoc task
-rw-r--r--src/main/groovy/frege/gradle/DocTask.groovy33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/main/groovy/frege/gradle/DocTask.groovy b/src/main/groovy/frege/gradle/DocTask.groovy
index c020cf6..061ae00 100644
--- a/src/main/groovy/frege/gradle/DocTask.groovy
+++ b/src/main/groovy/frege/gradle/DocTask.groovy
@@ -12,9 +12,29 @@ import org.gradle.process.internal.JavaExecAction
class DocTask extends DefaultTask {
+ /* Usage: java -jar fregec.jar frege.tools.Doc [-v] [-d opt] [-x mod,...] modules ...
+ * -v print a message for each processed module
+ * -d docdir specify root directory for documentation
+ * Documentation for module x.y.Z will be writen to
+ * $docdir/x/y/Z.html
+ * -cp classpath class path for doc tool
+ * -x mod1[,mod2] exclude modules whose name starts with 'mod1' or 'mod2'
+ *
+ * Modules can be specified in three ways:
+ * my.nice.Modul by name, the Java class for this module must be on the class path
+ * directory/ all modules that could be loaded if the given directory was on the class path, except exxcluded ones
+ * path.jar all modules in the specified JAR file, except excluded ones
+ *
+ * Example: document base frege distribution without compiler modules
+ * java -cp fregec.jar frege.tools.Doc -d doc -x frege.compiler fregec.jar
+ *
+ */
+
static String DEFAULT_SRC_DIR = "src/main/frege" // TODO: should this come from a source set?
static String DEFAULT_DOCS_SUBDIR = "docs/frege" // TODO: should this come from a convention?
+ Boolean help = false
+
@Optional
@InputDirectory
File sourceDir = new File(project.projectDir, DEFAULT_SRC_DIR).exists() ? new File(project.projectDir, DEFAULT_SRC_DIR) : null
@@ -45,11 +65,16 @@ class DocTask extends DefaultTask {
action.setClasspath(project.files(project.configurations.compile) + project.files("$project.buildDir/classes/main"))
def args = []
- if (verbose) args << '-v'
- args << '-d' << targetDir.absolutePath
- if (exclude) args << '-x' << exclude
- args << module
+ if (help) {
+ args << "-h"
+ } else {
+ if (verbose) args << '-v'
+ args << '-d' << targetDir.absolutePath
+ if (exclude) args << '-x' << exclude
+ args << module
+ }
+ logger.info("Calling Frege Doc with args: '$args'")
action.args args
action.execute()
}