summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/main/groovy/frege/gradle/FregePlugin.groovy3
-rw-r--r--src/main/groovy/frege/gradle/FregeReplTask.groovy8
-rw-r--r--src/main/groovy/frege/gradle/ReplTask.groovy16
-rw-r--r--todo.txt15
4 files changed, 19 insertions, 23 deletions
diff --git a/src/main/groovy/frege/gradle/FregePlugin.groovy b/src/main/groovy/frege/gradle/FregePlugin.groovy
index 259bffa..2765a21 100644
--- a/src/main/groovy/frege/gradle/FregePlugin.groovy
+++ b/src/main/groovy/frege/gradle/FregePlugin.groovy
@@ -20,9 +20,6 @@ class FregePlugin implements Plugin<Project> {
def checkTask = project.task('quickCheck', type: FregeQuickCheckTask, group: 'Tools', dependsOn: 'classes')
checkTask.outputs.upToDateWhen { false } // always run, regardless of up to date checks
-
-// project.task('fregeRepl', type: ReplTask) // we can now choose
-
project.task('fregeNativeGen', type: NativeGenTask)
}
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()
}
diff --git a/src/main/groovy/frege/gradle/ReplTask.groovy b/src/main/groovy/frege/gradle/ReplTask.groovy
deleted file mode 100644
index eb47944..0000000
--- a/src/main/groovy/frege/gradle/ReplTask.groovy
+++ /dev/null
@@ -1,16 +0,0 @@
-package frege.gradle
-
-import frege.repl.*
-import org.gradle.api.DefaultTask
-import org.gradle.api.tasks.TaskAction
-
-/**
- * Created by MarkPerry on 17/02/2015.
- */
-public class ReplTask extends DefaultTask {
-
- @TaskAction
- void repl() {
- frege.repl.FregeRepl.main([] as String[])
- }
-}
diff --git a/todo.txt b/todo.txt
index 89c7e3a..42259ee 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,2 +1,15 @@
- make a compileTestFrege with the respective task dependencies
-- add task for FregeDoc \ No newline at end of file
+- add task for FregeDoc
+
+Generating HTML documentation
+
+Say you have compiled a module foo.bar.Baz and you want to generate the documentation.
+
+java -cp frege.jar frege.tools.Doc -d doc -fp . foo.bar.Baz
+This will create a file doc/foo/bar/Baz.html with useful information derived from the class file. Make sure to specify the correct class path with -fp.
+
+Even if you have no documentation comments, the documentation will still include all classes, instances, data types and top level functions, along with their types and may serve as quick overview.
+
+The directory named after -d must exist previously, further subdirectories are created on the fly.
+
+The generated document may contain hyperlinks to documentation of modules your module depends on. They will work under the assumption that all documentation was generated with the same target directory (-d). \ No newline at end of file