diff options
7 files changed, 17 insertions, 16 deletions
@@ -12,13 +12,14 @@ git clone https://github.com/tricktron/frege-gradle-plugin.git ``` ## How to Use -1. Specify the frege compiler release, version and main module in your `build.gradle`: +1. Specify the frege compiler release, version, main module and repl source file in your `build.gradle`: ```groovy frege { version = '3.25.84' release = '3.25alpha' - mainModule = 'my.mod.Name' + mainModule = 'my.mod.Name' // see runFrege task + replSource = 'Name.fr' // see replFrege task } ``` @@ -35,7 +36,7 @@ Optional configuration parameters inside `build.gradle`: - **setupFrege**: Downloads the specified version of the Frege compiler. - **compileFrege**: All your `*.fr` files in `mainSourceDir` get compiled to `outputDir`. - **runFrege**: Runs the Frege module specified by `mainModule`. Alternatively you can also pass the main module by command line, e.g: `gradle runFrege --mainModule=my.mod.Name`. -- **replFrege**: Takes care of all project dependencies and prints the command to start the Frege REPL, e.g: `java -cp <your-correct-classpath-with-all-dependencies> frege.repl.FregeRepl`. +- **replFrege**: Takes care of all project dependencies of the specified filename by `replSource` and prints the command to start the Frege REPL, e.g: `java -cp <your-correct-classpath-with-all-dependencies> frege.repl.FregeRepl`. Afterwards you can load your file into the repl with `:l <absolute path to replSource>`. ### Dependencies diff --git a/src/functionalTest/java/ch/fhnw/thga/gradleplugins/FregePluginFunctionalTest.java b/src/functionalTest/java/ch/fhnw/thga/gradleplugins/FregePluginFunctionalTest.java index c1d482f..a7c2b35 100644 --- a/src/functionalTest/java/ch/fhnw/thga/gradleplugins/FregePluginFunctionalTest.java +++ b/src/functionalTest/java/ch/fhnw/thga/gradleplugins/FregePluginFunctionalTest.java @@ -500,7 +500,7 @@ public class FregePluginFunctionalTest { fregeBuilder .version("'3.25.84'") .release("'3.25alpha'") - .replModule(String.format("'%s'", completionFr)) + .replSource(String.format("'%s'", completionFr)) .build()); setupDefaultFregeProjectStructure( SIMPLE_FREGE_CODE, diff --git a/src/main/java/ch/fhnw/thga/gradleplugins/FregeExtension.java b/src/main/java/ch/fhnw/thga/gradleplugins/FregeExtension.java index 7b186a8..5bcbf3d 100644 --- a/src/main/java/ch/fhnw/thga/gradleplugins/FregeExtension.java +++ b/src/main/java/ch/fhnw/thga/gradleplugins/FregeExtension.java @@ -29,7 +29,7 @@ public abstract class FregeExtension { public abstract ListProperty<String> getCompilerFlags(); - public abstract Property<String> getReplModule(); + public abstract Property<String> getReplSource(); @Inject public FregeExtension(ProjectLayout projectLayout) { diff --git a/src/main/java/ch/fhnw/thga/gradleplugins/FregePlugin.java b/src/main/java/ch/fhnw/thga/gradleplugins/FregePlugin.java index 26c52c8..a318b81 100644 --- a/src/main/java/ch/fhnw/thga/gradleplugins/FregePlugin.java +++ b/src/main/java/ch/fhnw/thga/gradleplugins/FregePlugin.java @@ -97,7 +97,7 @@ public class FregePlugin implements Plugin<Project> ReplFregeTask.class, task -> { - task.getReplSource().set(extension.getReplModule()); + task.getReplSource().set(extension.getReplSource()); task.dependsOn(compileFregeTask.map( compileTask -> { diff --git a/src/test/java/ch/fhnw/thga/gradleplugins/Builder.java b/src/test/java/ch/fhnw/thga/gradleplugins/Builder.java index d379013..df070a2 100644 --- a/src/test/java/ch/fhnw/thga/gradleplugins/Builder.java +++ b/src/test/java/ch/fhnw/thga/gradleplugins/Builder.java @@ -15,7 +15,7 @@ public interface Builder { Builder compilerFlags(String compilerFlags); - Builder replModule(String replModule); + Builder replSource(String replSource); FregeDTO build(); } diff --git a/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTO.java b/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTO.java index bea1e81..e092eac 100644 --- a/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTO.java +++ b/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTO.java @@ -14,7 +14,7 @@ public class FregeDTO { public final String outputDir; public final String mainModule; public final String compilerFlags; - public final String replModule; + public final String replSource; public FregeDTO( String version, @@ -24,7 +24,7 @@ public class FregeDTO { String outputDir, String mainModule, String compilerFlags, - String replModule) { + String replSource) { this.version = version; this.release = release; this.compilerDownloadDir = compilerDownloadDir; @@ -32,7 +32,7 @@ public class FregeDTO { this.outputDir = outputDir; this.mainModule = mainModule; this.compilerFlags = compilerFlags; - this.replModule = replModule; + this.replSource = replSource; } public String getVersion() { @@ -63,8 +63,8 @@ public class FregeDTO { return compilerFlags; } - public String getReplModule() { - return replModule; + public String getReplSource() { + return replSource; } private String getFieldValue(Field field) { diff --git a/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTOBuilder.java b/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTOBuilder.java index d3a6c52..cae01d5 100644 --- a/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTOBuilder.java +++ b/src/test/java/ch/fhnw/thga/gradleplugins/FregeDTOBuilder.java @@ -8,7 +8,7 @@ public final class FregeDTOBuilder implements Builder { private String outputDir = ""; private String mainModule = ""; private String compilerFlags = ""; - private String replModule = ""; + private String replSource = ""; private static volatile FregeDTOBuilder instance; @@ -74,9 +74,9 @@ public final class FregeDTOBuilder implements Builder { } @Override - public Builder replModule(String replModule) + public Builder replSource(String replSource) { - this.replModule = replModule; + this.replSource = replSource; return this; } @@ -89,6 +89,6 @@ public final class FregeDTOBuilder implements Builder { outputDir, mainModule, compilerFlags, - replModule); + replSource); } } |