aboutsummaryrefslogtreecommitdiff
path: root/src/main/groovy
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/groovy')
-rw-r--r--src/main/groovy/org/gradle/frege/FregeTask.groovy59
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")