aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/integTest/groovy/frege/gradle/integtest/fixtures/AbstractFregeIntegrationSpec.groovy67
-rw-r--r--src/integTest/groovy/frege/gradle/plugins/FregePluginIntegTest.groovy208
-rw-r--r--src/integTest/groovy/frege/gradle/tasks/FregeCompileIntegTest.groovy106
-rw-r--r--src/main/groovy/frege/gradle/DefaultFregeSourceSet.java31
-rw-r--r--src/main/groovy/frege/gradle/FregeSourceDirectorySet.groovy26
-rw-r--r--src/main/groovy/frege/gradle/FregeSourceSet.java8
-rw-r--r--src/main/groovy/frege/gradle/FregeSourceSetDirectoryFactory.groovy30
-rw-r--r--src/main/groovy/frege/gradle/FregeSourceSetOutputs.groovy7
-rw-r--r--src/main/groovy/frege/gradle/plugins/FregeBasePlugin.java87
-rw-r--r--src/main/groovy/frege/gradle/plugins/FregePlugin.groovy44
-rw-r--r--src/main/groovy/frege/gradle/plugins/FregePluginExtension.groovy11
-rw-r--r--src/main/groovy/frege/gradle/tasks/FregeCompile.groovy214
-rw-r--r--src/main/groovy/frege/gradle/tasks/FregeDoc.groovy86
-rw-r--r--src/main/groovy/frege/gradle/tasks/FregeNativeGen.groovy61
-rw-r--r--src/main/groovy/frege/gradle/tasks/FregeQuickCheck.groovy93
-rw-r--r--src/main/groovy/frege/gradle/tasks/FregeRepl.groovy40
-rw-r--r--src/main/resources/META-INF/gradle-plugins/org.frege-lang.base.properties1
-rw-r--r--src/main/resources/META-INF/gradle-plugins/org.frege-lang.properties1
-rw-r--r--src/test/groovy/ch.fhnw.thga.fregeplugin/FregePluginFunctionalTest.groovy18
-rw-r--r--src/test/groovy/frege/gradle/plugins/FregeBasePluginTest.groovy30
-rw-r--r--src/test/groovy/frege/gradle/plugins/FregePluginTest.groovy36
-rw-r--r--src/test/groovy/frege/gradle/tasks/FregeCompileTest.groovy39
22 files changed, 18 insertions, 1226 deletions
diff --git a/src/integTest/groovy/frege/gradle/integtest/fixtures/AbstractFregeIntegrationSpec.groovy b/src/integTest/groovy/frege/gradle/integtest/fixtures/AbstractFregeIntegrationSpec.groovy
deleted file mode 100644
index 71d3ea8..0000000
--- a/src/integTest/groovy/frege/gradle/integtest/fixtures/AbstractFregeIntegrationSpec.groovy
+++ /dev/null
@@ -1,67 +0,0 @@
-package frege.gradle.integtest.fixtures
-
-import org.gradle.testkit.runner.GradleRunner
-import org.gradle.testkit.runner.BuildResult
-import org.junit.Rule
-import org.junit.rules.TemporaryFolder
-import spock.lang.Specification
-
-class AbstractFregeIntegrationSpec extends Specification {
- public static final String DEFAULT_FREGE_VERSION = "3.24.405"
- List<File> pluginClasspath
-
- @Rule
- final TemporaryFolder testProjectDir = new TemporaryFolder()
- File buildFile
-
- def setup() {
- buildFile = testProjectDir.newFile('build.gradle')
-
- testProjectDir.newFolder("src", "main", "java", "org", "frege", "java")
- testProjectDir.newFolder("src", "main", "frege", "org", "frege")
-
- def pluginClasspathResource = getClass().classLoader.findResource("plugin-classpath.txt")
- if (pluginClasspathResource == null) {
- // try again via file reference
- pluginClasspathResource = new File("build/createClasspathManifest/plugin-classpath.txt")
- if (pluginClasspathResource == null) {
- throw new IllegalStateException("Did not find plugin classpath resource, run `integTestClasses` build task.")
- }
- }
- pluginClasspath = pluginClasspathResource.readLines().collect { new File(it) }
- }
-
-
- BuildResult run(String task) {
- run(null, task);
- }
-
- BuildResult run(String gradleVersion, String task) {
- def writer = new StringWriter();
- GradleRunner runner = newRunner(task, writer, gradleVersion)
- def result = runner.build()
- println writer;
- return result;
- }
-
- BuildResult fail(String task) {
- def writer = new StringWriter();
- GradleRunner runner = newRunner(task, writer, null)
- def result = runner.buildAndFail()
- println writer;
- return result;
- }
-
- private GradleRunner newRunner(String task, StringWriter writer, String gradleVersion) {
- def runner = GradleRunner.create()
- .withProjectDir(testProjectDir.root)
- .withArguments(task)
- .withPluginClasspath(pluginClasspath)
- .forwardStdOutput(writer)
- if (gradleVersion) {
- runner.withGradleVersion(gradleVersion)
- }
- runner
- }
-
-}
diff --git a/src/integTest/groovy/frege/gradle/plugins/FregePluginIntegTest.groovy b/src/integTest/groovy/frege/gradle/plugins/FregePluginIntegTest.groovy
deleted file mode 100644
index 798d333..0000000
--- a/src/integTest/groovy/frege/gradle/plugins/FregePluginIntegTest.groovy
+++ /dev/null
@@ -1,208 +0,0 @@
-package frege.gradle.plugins
-import frege.gradle.integtest.fixtures.AbstractFregeIntegrationSpec
-import org.gradle.testkit.runner.BuildResult
-import spock.lang.Unroll
-
-import static org.gradle.testkit.runner.TaskOutcome.NO_SOURCE
-import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
-import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE
-
-class FregePluginIntegTest extends AbstractFregeIntegrationSpec {
-
- def setup() {
- buildFile << """
- plugins {
- id 'org.frege-lang'
- }
-
- repositories {
- jcenter()
- flatDir {
- dirs '${new File(".").absolutePath}/lib'
- }
- }
- compileFrege {
- classpath = files()
- }
- """
- }
-
- def "can handle non existing source directories"() {
- given:
- buildFile << """
- dependencies {
- compile "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
- """
-
- when:
- def result = run(gradleVersion, "classes")
- then:
- result.task(":compileFrege").outcome == NO_SOURCE
- where:
- gradleVersion << ["4.0", "5.0", "5.3.1"]
- }
-
- @Unroll
- def "can compile and run frege code (gradle: #gradleVersion, frege: #fregeVersion)"() {
- given:
- buildFile << """
- dependencies {
- compile "org.frege-lang:frege:$fregeVersion"
- }
- ${sayHelloTask()}
- """
-
- fregeModule()
-
- when:
- def result = run(gradleVersion, "sayHello")
-
- then:
- result.output.contains("Hello Frege!")
- result.task(":sayHello").outcome == SUCCESS
-
- where:
- fregeVersion | gradleVersion
- DEFAULT_FREGE_VERSION | "5.3.1"
- DEFAULT_FREGE_VERSION | "5.0"
- DEFAULT_FREGE_VERSION | "4.0"
- "3.22.367-g2737683" | "2.12"
- }
-
- private void fregeModule(String modulePath = "src/main/frege/org/frege/HelloFrege.fr") {
- def moduleFolder = new File(testProjectDir.root, modulePath).parentFile
- moduleFolder.mkdirs()
- def moduleSource = testProjectDir.newFile(modulePath)
- moduleSource << """
- module org.frege.HelloFrege where
-
- greeting = "Hello Frege!"
-
- main _ = do
- println greeting
- """
- }
-
- def "can reference java from frege"() {
- given:
- buildFile << """
- dependencies {
- compile "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
- ${sayHelloTask()}
- """
-
- and:
- javaCode()
- fregeCallingJava()
- when:
- BuildResult result = run("sayHello")
- then:
- result.task(":compileJava").outcome == SUCCESS
- result.task(":compileFrege").outcome == SUCCESS
- result.output.contains("hello from java")
- }
-
- def "can run frege doc on frege module"() {
- given:
- buildFile << """
- dependencies {
- compile "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
- ext.destinationDir = "docs"
- """
-
- and:
- fregeModule()
- when:
- BuildResult result = run("fregeDoc")
- then:
- result.task(":fregeDoc").outcome == SUCCESS
- }
-
-
- def "frege doc works with mixed sources"() {
- given:
- buildFile << """
- dependencies {
- compile "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
- """
-
- and:
- javaCode()
- fregeCallingJava()
- when:
- BuildResult result = run("fregeDoc")
- then:
- result.task(":fregeDoc").outcome == SUCCESS
- }
-
- def "supports additional source sets"() {
- given:
- buildFile << """
-
- sourceSets {
- api
- }
-
- dependencies {
- apiCompile "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
-
-
- """
- and:
- javaCode()
- fregeModule("src/api/frege/org/frege/HelloFrege.fr")
- when:
- BuildResult result = run("apiClasses")
- then:
- result.task(":compileApiJava").outcome == UP_TO_DATE
- result.task(":compileApiFrege").outcome == SUCCESS
- classFileExists("api/org/frege/HelloFrege.class")
- }
-
- def classFileExists(String relativeClasspath) {
- assert new File(testProjectDir.root, "build/classes/$relativeClasspath/").exists()
- true
- }
-
- def fregeCallingJava() {
-
- File fregeSourceFile = testProjectDir.newFile("src/main/frege/org/frege/HelloFrege.fr")
- fregeSourceFile << """
- module org.frege.HelloFrege where
-
- data StaticHello = pure native org.frege.java.StaticHello where
- pure native helloJava org.frege.java.StaticHello.helloJava:: () -> String
-
-
- main _ = do
- println(StaticHello.helloJava())
-
- """
- }
-
- def javaCode(String sourceRoot = "java") {
- def javaSourceFile = testProjectDir.newFile("src/main/$sourceRoot/org/frege/java/StaticHello.java")
-
- javaSourceFile << """
- package org.frege.java;
-
- public class StaticHello {
- public static String helloJava() {
- return "hello from java";
- }
- }
- """
- }
-
- def sayHelloTask() {
- return """ task sayHello(type: JavaExec) {
- classpath = sourceSets.main.runtimeClasspath
- main = 'org.frege.HelloFrege'
- } """
- }
-} \ No newline at end of file
diff --git a/src/integTest/groovy/frege/gradle/tasks/FregeCompileIntegTest.groovy b/src/integTest/groovy/frege/gradle/tasks/FregeCompileIntegTest.groovy
deleted file mode 100644
index 2f2b9d4..0000000
--- a/src/integTest/groovy/frege/gradle/tasks/FregeCompileIntegTest.groovy
+++ /dev/null
@@ -1,106 +0,0 @@
-package frege.gradle.tasks
-import frege.gradle.integtest.fixtures.AbstractFregeIntegrationSpec
-
-import static org.gradle.testkit.runner.TaskOutcome.FAILED
-import static org.gradle.testkit.runner.TaskOutcome.SUCCESS
-import static org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE
-
-class FregeCompileIntegTest extends AbstractFregeIntegrationSpec {
-
- List<File> pluginClasspath
-
- def setup() {
- buildFile << """
- plugins {
- id 'org.frege-lang.base'
- }
-
- import frege.gradle.tasks.FregeCompile
-
- repositories {
- jcenter()
- flatDir {
- dirs '${new File(".").absolutePath}/lib'
- }
- }
-
- configurations { frege {} }
-
- dependencies {
- frege "org.frege-lang:frege:$DEFAULT_FREGE_VERSION"
- }
-
- task compile(type: FregeCompile) {
- destinationDir = file("frege-output")
- source("frege-src")
- module = "frege-src"
- classpath = configurations.frege
- fregepath = configurations.frege
- }
- """
-
- testProjectDir.newFolder("frege-src")
- }
-
- def "shows compile errors"() {
- given:
- simpleFrege()
- failingFrege()
- when:
- def result = fail("compile")
-
- then:
- result.task(":compile").outcome == FAILED
- result.output.contains("Failing.fr:6: can't resolve `Hello`")
- }
-
- def "is incremental"() {
- given:
- simpleFrege()
-
- buildFile << """
- compile.doLast {
- println System.identityHashCode(compile.allJvmArgs)
- println compile.allJvmArgs
- println compile.allJvmArgs.getClass()
- }
-"""
- when:
- def result = run("compile")
-
- then:
- result.task(":compile").outcome == SUCCESS
-
- when:
- result = run("compile")
-
- then:
- result.task(":compile").outcome == UP_TO_DATE
- }
-
-
- def failingFrege() {
- def failingFrege = testProjectDir.newFile("frege-src/Failing.fr")
- failingFrege << """
-
- module Failing where
-
- failingFun _ = do
- println(Hello)
- """
- }
-
- def simpleFrege() {
-
- def helloFrege = testProjectDir.newFile("frege-src/Hello.fr")
- helloFrege << """
-
- module Hello where
-
- import frege.prelude.PreludeBase
-
- main _ = do
- println("Hello From Frege")
- """
- }
-}
diff --git a/src/main/groovy/frege/gradle/DefaultFregeSourceSet.java b/src/main/groovy/frege/gradle/DefaultFregeSourceSet.java
deleted file mode 100644
index a1650a1..0000000
--- a/src/main/groovy/frege/gradle/DefaultFregeSourceSet.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package frege.gradle;
-
-import groovy.lang.Closure;
-import org.gradle.api.file.SourceDirectorySet;
-import org.gradle.util.ConfigureUtil;
-
-public class DefaultFregeSourceSet implements FregeSourceSet {
- private final SourceDirectorySet frege;
- private final SourceDirectorySet allFrege;
-
- public DefaultFregeSourceSet(String displayName, FregeSourceSetDirectoryFactory sourceSetFactory) {
- this.frege = sourceSetFactory.newSourceSetDirectory(String.format("%s Frege source", new Object[]{displayName}));
- this.frege.getFilter().include(new String[]{"**/*.fr"});
- this.allFrege = sourceSetFactory.newSourceSetDirectory(String.format("%s Frege source", new Object[]{displayName}));
- this.allFrege.source(this.frege);
- this.allFrege.getFilter().include(new String[]{"**/*.fr"});
- }
-
- public SourceDirectorySet getFrege() {
- return this.frege;
- }
-
- public FregeSourceSet frege(Closure configureClosure) {
- ConfigureUtil.configure(configureClosure, this.getFrege());
- return this;
- }
-
- public SourceDirectorySet getAllFrege() {
- return this.allFrege;
- }
-}
diff --git a/src/main/groovy/frege/gradle/FregeSourceDirectorySet.groovy b/src/main/groovy/frege/gradle/FregeSourceDirectorySet.groovy
deleted file mode 100644
index 35110f5..0000000
--- a/src/main/groovy/frege/gradle/FregeSourceDirectorySet.groovy
+++ /dev/null
@@ -1,26 +0,0 @@
-package frege.gradle
-
-import org.gradle.api.file.FileTree
-import org.gradle.api.tasks.util.PatternFilterable
-
-interface FregeSourceDirectorySet extends PatternFilterable {
- def String getName()
-
- def FregeSourceDirectorySet srcDir(Object srcPath)
-
- def FregeSourceDirectorySet srcDirs(Object... srcPaths)
-
- def Set<File> getSrcDirs()
-
- def FregeSourceDirectorySet setSrcDirs(Iterable<?> srcPaths)
-
- def FileTree getFiles()
-
- def PatternFilterable getFilter()
-
- def FregeSourceSetOutputs getOutput()
-
- def String getGeneratorTaskName()
-
- boolean contains(File file)
-} \ No newline at end of file
diff --git a/src/main/groovy/frege/gradle/FregeSourceSet.java b/src/main/groovy/frege/gradle/FregeSourceSet.java
deleted file mode 100644
index 27654f1..0000000
--- a/src/main/groovy/frege/gradle/FregeSourceSet.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package frege.gradle;
-
-import org.gradle.api.file.SourceDirectorySet;
-
-public interface FregeSourceSet {
- SourceDirectorySet getFrege();
- SourceDirectorySet getAllFrege();
-}
diff --git a/src/main/groovy/frege/gradle/FregeSourceSetDirectoryFactory.groovy b/src/main/groovy/frege/gradle/FregeSourceSetDirectoryFactory.groovy
deleted file mode 100644
index 96abc8f..0000000
--- a/src/main/groovy/frege/gradle/FregeSourceSetDirectoryFactory.groovy
+++ /dev/null
@@ -1,30 +0,0 @@
-package frege.gradle
-
-import org.gradle.api.file.SourceDirectorySet
-import org.gradle.api.internal.file.DefaultSourceDirectorySet
-import org.gradle.api.internal.file.FileResolver
-import org.gradle.api.internal.file.SourceDirectorySetFactory
-import org.gradle.api.internal.project.ProjectInternal
-import org.gradle.util.GradleVersion
-
-public class FregeSourceSetDirectoryFactory {
- private final boolean useFactory;
- private final FileResolver fileResolver
- private final ProjectInternal project
-
- public FregeSourceSetDirectoryFactory(ProjectInternal project, FileResolver fileResolver) {
- this.fileResolver = fileResolver
- this.project = project
- this.useFactory = GradleVersion.current().compareTo(GradleVersion.version("2.12")) >= 0;
-
- }
-
- public SourceDirectorySet newSourceSetDirectory(String displayName) {
- if (useFactory) {
- SourceDirectorySetFactory factory = project.getServices().get(SourceDirectorySetFactory.class);
- return factory.create(displayName);
- } else {
- return new DefaultSourceDirectorySet(displayName, fileResolver);
- }
- }
-}
diff --git a/src/main/groovy/frege/gradle/FregeSourceSetOutputs.groovy b/src/main/groovy/frege/gradle/FregeSourceSetOutputs.groovy
deleted file mode 100644
index 07e90a3..0000000
--- a/src/main/groovy/frege/gradle/FregeSourceSetOutputs.groovy
+++ /dev/null
@@ -1,7 +0,0 @@
-package frege.gradle
-
-import org.gradle.api.file.FileCollection
-
-interface FregeSourceSetOutputs {
- FileCollection getDirs()
-} \ No newline at end of file
diff --git a/src/main/groovy/frege/gradle/plugins/FregeBasePlugin.java b/src/main/groovy/frege/gradle/plugins/FregeBasePlugin.java
deleted file mode 100644
index 59fe46e..0000000
--- a/src/main/groovy/frege/gradle/plugins/FregeBasePlugin.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package frege.gradle.plugins;
-
-import frege.gradle.DefaultFregeSourceSet;
-import frege.gradle.FregeSourceSetDirectoryFactory;
-import frege.gradle.tasks.FregeCompile;
-import org.gradle.api.Action;
-import org.gradle.api.Plugin;
-import org.gradle.api.Project;
-import org.gradle.api.file.FileTreeElement;
-import org.gradle.api.internal.file.FileResolver;
-import org.gradle.api.internal.plugins.DslObject;
-import org.gradle.api.internal.project.ProjectInternal;
-import org.gradle.api.internal.tasks.DefaultSourceSet;
-import org.gradle.api.plugins.JavaBasePlugin;
-import org.gradle.api.plugins.JavaPluginConvention;
-import org.gradle.api.specs.Spec;
-import org.gradle.api.tasks.SourceSet;
-import org.gradle.internal.classpath.DefaultClassPath;
-
-import javax.inject.Inject;
-import java.io.File;
-import java.util.concurrent.Callable;
-
-public class FregeBasePlugin implements Plugin<Project> {
- private FileResolver fileResolver;
-
- private static String EXTENSION_NAME = "frege";
- private FregePluginExtension fregePluginExtension;
- private Project project;
-
- @Inject
- public FregeBasePlugin(FileResolver fileResolver) {
- this.fileResolver = fileResolver;
- }
-
- @Override
- public void apply(final Project project) {
- // Workaround to build proper jars on Windows, see https://github.com/Frege/frege-gradle-plugin/issues/9
- this.project = project;
- System.setProperty("file.encoding", "UTF-8");
- project.getPluginManager().apply(JavaBasePlugin.class);
- fregePluginExtension = project.getExtensions().create(EXTENSION_NAME, FregePluginExtension.class);
- JavaBasePlugin javaBasePlugin = project.getPlugins().getPlugin(JavaBasePlugin.class);
- configureSourceSetDefaults(javaBasePlugin);
- }
-
-
- private void configureSourceSetDefaults(final JavaBasePlugin javaBasePlugin) {
- project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().all(new Action<SourceSet>() {
- public void execute(final SourceSet sourceSet) {
- FregeSourceSetDirectoryFactory factory = new FregeSourceSetDirectoryFactory((ProjectInternal) project, fileResolver);
- final DefaultFregeSourceSet fregeSourceSet = new DefaultFregeSourceSet(((DefaultSourceSet) sourceSet).getDisplayName(), factory);
- new DslObject(sourceSet).getConvention().getPlugins().put("frege", fregeSourceSet);
-
- final String defaultSourcePath = String.format("src/%s/frege", sourceSet.getName());
- fregeSourceSet.getFrege().srcDir(defaultSourcePath);
- sourceSet.getResources().getFilter().exclude(new Spec<FileTreeElement>() {
- public boolean isSatisfiedBy(FileTreeElement element) {
- return fregeSourceSet.getFrege().contains(element.getFile());
- }
- });
- sourceSet.getAllJava().source(fregeSourceSet.getFrege());
- sourceSet.getAllSource().source(fregeSourceSet.getFrege());
-
- String compileTaskName = sourceSet.getCompileTaskName("frege");
- FregeCompile compile = project.getTasks().create(compileTaskName, FregeCompile.class);
- compile.setModule(project.file(defaultSourcePath).getAbsolutePath());
-// javaBasePlugin.configureForSourceSet(sourceSet, compile);
- compile.getConventionMapping().map("fregepath", new Callable() {
- public Object call() throws Exception {
- return sourceSet.getCompileClasspath();
- }
- });
- compile.dependsOn(sourceSet.getCompileJavaTaskName());
- compile.setDescription(String.format("Compiles the %s Frege source.", sourceSet.getName()));
- compile.setSource(fregeSourceSet.getFrege());
-
-// compile.setClasspath(sourceSet.getCompileClasspath());
-// compile.setDestinationDir((File)null);
-
-
- project.getTasks().getByName(sourceSet.getClassesTaskName()).dependsOn(compileTaskName);
- sourceSet.compiledBy(compile);
- }
- });
- }
-}
diff --git a/src/main/groovy/frege/gradle/plugins/FregePlugin.groovy b/src/main/groovy/frege/gradle/plugins/FregePlugin.groovy
deleted file mode 100644
index 3dd7ccc..0000000
--- a/src/main/groovy/frege/gradle/plugins/FregePlugin.groovy
+++ /dev/null
@@ -1,44 +0,0 @@
-package frege.gradle.plugins
-import frege.gradle.tasks.FregeDoc
-import frege.gradle.tasks.FregeNativeGen
-import frege.gradle.tasks.FregeQuickCheck
-import frege.gradle.tasks.FregeRepl
-import org.gradle.api.Plugin
-import org.gradle.api.Project
-import org.gradle.api.tasks.SourceSet
-
-class FregePlugin implements Plugin<Project> {
-
- Project project
-
- void apply(Project project) {
- this.project = project
-
- project.plugins.apply(FregeBasePlugin)
- project.plugins.apply("java")
-
- def replTask = project.task('fregeRepl', type: FregeRepl, group: 'frege', dependsOn: 'compileFrege')
- replTask.outputs.upToDateWhen { false } // always run, regardless of up to date checks
-
- def checkTask = project.task('fregeQuickCheck', type: FregeQuickCheck, group: 'frege', dependsOn: 'testClasses')
- checkTask.outputs.upToDateWhen { false } // always run, regardless of up to date checks
-
- project.tasks.test.dependsOn("fregeQuickCheck")
-
-
- configureFregeDoc()
-
- project.task('fregeNativeGen', type: FregeNativeGen, group: 'frege')
-
- }
-
- def configureFregeDoc() {
- FregeDoc fregeDoc = project.tasks.create('fregeDoc', FregeDoc)
- fregeDoc.group = 'frege'
- fregeDoc.dependsOn "compileFrege" // TODO remove
- SourceSet mainSourceSet = project.sourceSets.main
- fregeDoc.module = mainSourceSet.output.classesDirs.first().absolutePath
- fregeDoc.classpath = mainSourceSet.runtimeClasspath
- }
-
-}
diff --git a/src/main/groovy/frege/gradle/plugins/FregePluginExtension.groovy b/src/main/groovy/frege/gradle/plugins/FregePluginExtension.groovy
deleted file mode 100644
index ae180ec..0000000
--- a/src/main/groovy/frege/gradle/plugins/FregePluginExtension.groovy
+++ /dev/null
@@ -1,11 +0,0 @@
-package frege.gradle.plugins
-
-/**
- * Created by mperry on 6/02/2015.
- */
-class FregePluginExtension {
-
-
- String key1
-
-}
diff --git a/src/main/groovy/frege/gradle/tasks/FregeCompile.groovy b/src/main/groovy/frege/gradle/tasks/FregeCompile.groovy
deleted file mode 100644
index d619158..0000000
--- a/src/main/groovy/frege/gradle/tasks/FregeCompile.groovy
+++ /dev/null
@@ -1,214 +0,0 @@
-package frege.gradle.tasks
-
-import groovy.transform.TypeChecked
-import org.gradle.api.Action
-import org.gradle.api.file.Directory
-import org.gradle.api.file.FileCollection
-import org.gradle.api.tasks.Input
-import org.gradle.api.tasks.InputFiles
-import org.gradle.api.tasks.Optional
-import org.gradle.api.tasks.TaskAction
-import org.gradle.api.tasks.compile.AbstractCompile
-import org.gradle.process.JavaExecSpec
-
-/* Compiler flags as of 3.25.84
-
--d directory target directory for *.java and *.class files
--fp classpath where to find imported frege packages
--enc charset charset for source code files, standard is UTF-8
--enc DEFAULT platform default charset for source code files
--target n.m generate code for java version n.m, also passed to javac
--nocp exclude java classpath from -fp
--hints print more detailed error messages and warnings
--inline inline functions where possible
--strict-pats check patterns in multi-argument functions strictly from left to right
--comments generate commented code
--explain i[-j] print some debugging output from type checker
- regarding line(s) i (to j). May help to understand
- inexplicable type errors better.
--nowarn don't print warnings (not recommended)
--v verbose mode on
--make build outdated or missing imports
--sp srcpath look for source files in srcpath, default is .
--target x.y generate code for java version x.y, default is the
- version of the JVM the compiler is running in.
--j do not run the java compiler
--ascii do not use →, ⇒, ∀ and ∷ when presenting types,
- and use ascii characters for java generics variables
--greek make greek type variables
--fraktur make 𝖋𝖗𝖆𝖐𝖙𝖚𝖗 type variables
--latin make latin type variables
-
-*/
-
-
-
-@TypeChecked
-class FregeCompile extends AbstractCompile {
-
- FileCollection classpath
-
- @Input
- String stackSize = "4m"
-
- @Input
- boolean hints = false
-
- @Input
- boolean optimize = false
-
- @Input
- boolean strictPats = false
-
- @Input
- boolean excludeJavaClasspath = false
-
- boolean verbose = false
-
- @Input
- boolean inline = true
-
- @Input
- boolean make = true
-
- @Input
- boolean compileGeneratedJava = true
-
- @Input
- String target = ""
-
- @Input
- boolean comments = false
-
- @Input
- boolean suppressWarnings = false
-
- @Input
- String explain = ""
-
- @Input
- String extraArgs = ""
-
- @Input
- String allArgs = "" // this is an option to overrule all other settings
-
- @Input
- String module = ""
-
- @Optional @InputFiles
- FileCollection fregepath
-
- @Input
- File destinationDir
-
- @Input
- String mainClass = "frege.compiler.Main"
-
- @Input
- List<String> allJvmArgs = []
-
- @Input
- String encoding = ""
-
- @Input
- String prefix = ""</