From 992490f446720cd4cf4fb9aadff463b2328a8287 Mon Sep 17 00:00:00 2001 From: Thibault Gagnaux Date: Mon, 20 Dec 2021 20:48:17 +0100 Subject: feat: adds `replSource` property and command-line option The `replSource` property specifies the frege source file that you want to load into the repl. It is excluded in the `fregeCompile` task so that we don't get two java class files (one from `compileFrege` and one from the fregeRepl `:l` command) that shadow each other on the classpath. As a result, we can make interactive changes to the `replSource` file and use the `:r` reload command to see them. --- .../ch/fhnw/thga/gradleplugins/internal/DependencyFregeTask.java | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/main/java/ch/fhnw/thga/gradleplugins/internal') diff --git a/src/main/java/ch/fhnw/thga/gradleplugins/internal/DependencyFregeTask.java b/src/main/java/ch/fhnw/thga/gradleplugins/internal/DependencyFregeTask.java index 4459bd4..87f4d2b 100644 --- a/src/main/java/ch/fhnw/thga/gradleplugins/internal/DependencyFregeTask.java +++ b/src/main/java/ch/fhnw/thga/gradleplugins/internal/DependencyFregeTask.java @@ -8,6 +8,7 @@ import org.gradle.api.tasks.Input; import org.gradle.api.tasks.InputDirectory; import org.gradle.api.tasks.InputFile; import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.options.Option; import ch.fhnw.thga.gradleplugins.SharedTaskLogic; @@ -21,6 +22,11 @@ public abstract class DependencyFregeTask extends DefaultTask { @InputDirectory public abstract DirectoryProperty getFregeOutputDir(); + @Input + @Option(option = "replSource", + description = "The filename which you want to load into the repl, e.g. 'myFregeFile.fr'") + public abstract Property getReplSource(); + @TaskAction public void fregeDependencies() { -- cgit