diff options
author | Mark Perry <maperry78@yahoo.com.au> | 2015-02-11 02:27:08 +1000 |
---|---|---|
committer | Mark Perry <maperry78@yahoo.com.au> | 2015-02-11 02:27:08 +1000 |
commit | 00b83f113bbf286d145b2a7037afd4c28ed11ee8 (patch) | |
tree | 8315f68cd93dafa88bc5643be33f1e42febe5f57 /src/main/groovy | |
parent | 71d6e9a40a8a00002df9eff6bee91a204ad4cb40 (diff) | |
download | frege-gradle-plugin-00b83f113bbf286d145b2a7037afd4c28ed11ee8.tar.gz frege-gradle-plugin-00b83f113bbf286d145b2a7037afd4c28ed11ee8.tar.bz2 frege-gradle-plugin-00b83f113bbf286d145b2a7037afd4c28ed11ee8.zip |
Improve task options
Diffstat (limited to 'src/main/groovy')
-rw-r--r-- | src/main/groovy/org/gradle/frege/FregeTask.groovy | 59 |
1 files changed, 37 insertions, 22 deletions
diff --git a/src/main/groovy/org/gradle/frege/FregeTask.groovy b/src/main/groovy/org/gradle/frege/FregeTask.groovy index 6dffb95..c0f898e 100644 --- a/src/main/groovy/org/gradle/frege/FregeTask.groovy +++ b/src/main/groovy/org/gradle/frege/FregeTask.groovy @@ -12,27 +12,36 @@ class FregeTask extends DefaultTask { private static final FREGE_FILE_EXTENSION_PATTERN = ~/.*\.fr?$/ + static String DEFAULT_CLASSES_DIR = "build/classes/main" + static String DEFAULT_SRC_DIR = "src/main/frege" + @Input - boolean hints + boolean hints = false @Input - boolean verbose + boolean verbose = false @Input - boolean inline = true + boolean inline = false @Input boolean make = true @Input - boolean skipCompile + boolean skipCompile = false @Input boolean includeStale + @Input + String extraArgs = "" + + @Input + String allArgs = "" + // TODO: Find default @OutputDirectory - File outputDir = new File("build/classes/main") + File outputDir = new File(DEFAULT_CLASSES_DIR) @TaskAction void executeCompile() { @@ -45,26 +54,32 @@ class FregeTask extends DefaultTask { action.setClasspath(project.files(project.configurations.compile)) List args = [] - if (hints) - args << "-hints" - if (inline) - args << "-inline" - if (make) - args << "-make" - if (verbose) - args << "-v" - if (skipCompile) - args << "-j" - - args << "-d" - args << outputDir - - - eachFileRecurse(new File("src/main/frege")) { File file -> + + if (allArgs != "") { + args = allArgs.split().toList() + } else { + + if (hints) + args << "-hints" + if (inline) + args << "-inline" + if (make) + args << "-make" + if (verbose) + args << "-v" + if (skipCompile) + args << "-j" + + args << "-d" + args << outputDir + + args = args + extraArgs.split().toList() + } + + eachFileRecurse(new File(DEFAULT_SRC_DIR)) { File file -> if (file.name =~ FREGE_FILE_EXTENSION_PATTERN) { args << file } - } println("FregeTask args: $args") |