summaryrefslogtreecommitdiff
path: root/src/main/groovy/frege/gradle/CompileTask.groovy
diff options
context:
space:
mode:
authorMark Perry <maperry78+github@gmail.com>2015-09-18 16:31:44 +1000
committerMark Perry <maperry78+github@gmail.com>2015-09-18 16:31:44 +1000
commit0a96b0e05694140f6d2beee4213ebc2e38014509 (patch)
treec8309c39ea7f7f747128079baa010a0eaa2ac550 /src/main/groovy/frege/gradle/CompileTask.groovy
parente8b9455631260aa1211583cf958cbed32c6d7b92 (diff)
downloadfrege-gradle-plugin-0a96b0e05694140f6d2beee4213ebc2e38014509.tar.gz
frege-gradle-plugin-0a96b0e05694140f6d2beee4213ebc2e38014509.tar.bz2
frege-gradle-plugin-0a96b0e05694140f6d2beee4213ebc2e38014509.zip
Changes for source path - does not work
Diffstat (limited to 'src/main/groovy/frege/gradle/CompileTask.groovy')
-rw-r--r--src/main/groovy/frege/gradle/CompileTask.groovy20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/groovy/frege/gradle/CompileTask.groovy b/src/main/groovy/frege/gradle/CompileTask.groovy
index 1a590b3..04722d7 100644
--- a/src/main/groovy/frege/gradle/CompileTask.groovy
+++ b/src/main/groovy/frege/gradle/CompileTask.groovy
@@ -9,7 +9,6 @@ import org.gradle.api.tasks.*
import org.gradle.process.internal.DefaultJavaExecAction
import org.gradle.process.internal.JavaExecAction
import org.gradle.api.internal.file.FileResolver
-import fj.data.Option
class CompileTask extends DefaultTask {
@@ -50,8 +49,8 @@ class CompileTask extends DefaultTask {
@Optional @Input
String module = ""
- @Optional @InputDirectory
- File sourceDir = deduceSourceDir(project)
+// @Optional @InputDirectory
+ List<File> sourcePaths = deduceSourceDir(project)
@Optional @OutputDirectory
File outputDir = deduceClassesDir(project)
@@ -63,8 +62,9 @@ class CompileTask extends DefaultTask {
new File(projectDir, subdir).exists() ? new File(projectDir, subdir) : null
}
- static File deduceSourceDir(Project project) {
- deduceSourceDir(project.projectDir, DEFAULT_SRC_DIR)
+ static List<File> deduceSourceDir(Project project) {
+ def d = deduceSourceDir(project.projectDir, DEFAULT_SRC_DIR)
+ d == null ? [] : [d]
}
static File deduceClassesDir(File projectDir, String subdir) {
@@ -160,9 +160,10 @@ class CompileTask extends DefaultTask {
if (skipCompile)
args << "-j"
- if (sourceDir != null) {
+ if (sourcePaths != null && !sourcePaths.isEmpty()) {
+ logger.info("sourcePaths1: $sourcePaths")
args << "-sp"
- args << sourceDir.absolutePath
+ args << sourcePaths.collect { d -> d.absolutePath }.join(":")
}
args << "-d"
@@ -176,8 +177,9 @@ class CompileTask extends DefaultTask {
if (!module && !extraArgs) {
logger.info "no module and no extra args given: compiling all of the sourceDir"
- if (sourceDir != null) {
- args << sourceDir.absolutePath
+ logger.info("sourcePaths2: $sourcePaths")
+ if (sourcePaths != null && !sourcePaths.isEmpty()) {
+ args << sourcePaths.collect { d -> d.absolutePath }.join(":")
}
} else if (module) {