summaryrefslogtreecommitdiff
path: root/src/main/groovy/frege/gradle/FregeReplTask.groovy
diff options
context:
space:
mode:
authorDierk Koenig <dierk.koenig@canoo.com>2015-02-25 23:44:35 +0100
committerDierk Koenig <dierk.koenig@canoo.com>2015-02-25 23:45:33 +0100
commitbed54dcada13d82be455670769afe8038d49cbc0 (patch)
treef507a34724148f7f7cfd0a3e9a474571cdcc91fd /src/main/groovy/frege/gradle/FregeReplTask.groovy
parenteb6934c39cf00d92ae657896c504fa17ac6bfc5a (diff)
downloadfrege-gradle-plugin-bed54dcada13d82be455670769afe8038d49cbc0.tar.gz
frege-gradle-plugin-bed54dcada13d82be455670769afe8038d49cbc0.tar.bz2
frege-gradle-plugin-bed54dcada13d82be455670769afe8038d49cbc0.zip
the repl needs to start with the targetDir on the classpath where the compiled classes are available for loading
Diffstat (limited to 'src/main/groovy/frege/gradle/FregeReplTask.groovy')
-rw-r--r--src/main/groovy/frege/gradle/FregeReplTask.groovy8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/groovy/frege/gradle/FregeReplTask.groovy b/src/main/groovy/frege/gradle/FregeReplTask.groovy
index 50d8026..012405b 100644
--- a/src/main/groovy/frege/gradle/FregeReplTask.groovy
+++ b/src/main/groovy/frege/gradle/FregeReplTask.groovy
@@ -6,15 +6,17 @@ import org.gradle.api.tasks.*
import org.gradle.process.internal.DefaultJavaExecAction
import org.gradle.process.internal.JavaExecAction
-import javax.management.relation.Relation
-
class FregeReplTask extends DefaultTask {
static String DEFAULT_SRC_DIR = "src/main/frege" // TODO: should this come from a source set?
+ static String DEFAULT_CLASSES_SUBDIR = "classes/main" // TODO: should this come from a convention?
@Optional @InputDirectory
File sourceDir = new File(project.projectDir, DEFAULT_SRC_DIR)
+ @Optional @InputDirectory
+ File targetDir = new File(project.buildDir, DEFAULT_CLASSES_SUBDIR)
+
@TaskAction
void openFregeRepl() {
@@ -29,7 +31,7 @@ class FregeReplTask extends DefaultTask {
action.setMain("frege.repl.FregeRepl")
action.workingDir = sourceDir
action.standardInput = System.in
- action.setClasspath(project.files(project.configurations.compile ))
+ action.setClasspath(project.files(project.configurations.runtime ) + project.files(targetDir.absolutePath))
action.execute()
}