aboutsummaryrefslogtreecommitdiff
path: root/src/main/groovy/frege/gradle/NativeGenTask.groovy
diff options
context:
space:
mode:
authorRene Groeschke <rene@gradle.com>2015-11-21 00:59:06 +0000
committerRene Groeschke <rene@gradle.com>2015-11-21 00:59:30 +0000
commitd47c934650540277c911514d4cf7ddf55a69492a (patch)
tree600a74141be47081049f1441de260f09436d17cb /src/main/groovy/frege/gradle/NativeGenTask.groovy
parentb53817cd366bdd15ec142fc880fe68c7e5ea00a1 (diff)
downloadfrege-gradle-plugin-d47c934650540277c911514d4cf7ddf55a69492a.tar.gz
frege-gradle-plugin-d47c934650540277c911514d4cf7ddf55a69492a.tar.bz2
frege-gradle-plugin-d47c934650540277c911514d4cf7ddf55a69492a.zip
create frege compile task per sourceSet
Diffstat (limited to 'src/main/groovy/frege/gradle/NativeGenTask.groovy')
-rw-r--r--src/main/groovy/frege/gradle/NativeGenTask.groovy61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/main/groovy/frege/gradle/NativeGenTask.groovy b/src/main/groovy/frege/gradle/NativeGenTask.groovy
deleted file mode 100644
index c9128ca..0000000
--- a/src/main/groovy/frege/gradle/NativeGenTask.groovy
+++ /dev/null
@@ -1,61 +0,0 @@
-package frege.gradle
-
-import org.gradle.api.DefaultTask
-import org.gradle.api.internal.file.FileResolver
-import org.gradle.api.tasks.Input
-import org.gradle.api.tasks.InputFile
-import org.gradle.api.tasks.Optional
-import org.gradle.api.tasks.OutputFile
-import org.gradle.api.tasks.TaskAction
-
-import org.gradle.process.internal.DefaultJavaExecAction
-import org.gradle.process.internal.JavaExecAction
-
-class NativeGenTask extends DefaultTask {
-
- /*
- * Example from https://github.com/Frege/frege-native-gen:
- * java -cp /path/to/guava-15.0.jar:lib/frege-YY.jar:frege-native-gen-XX.jar frege.nativegen.Main com.google.common.collect.ImmutableCollection
- */
-
- // help not currently supported by native gen tool
- Boolean help = false
-
- @Optional
- @InputFile
- File typesFile = new File(project.projectDir, "types.properties")
-
- @Input
- String className = null
-
- @Optional
- @OutputFile
- File outputFile = new File(project.buildDir, "generated/frege/NativeGenOutput.fr")
-
-
- @TaskAction
- void gen() {
-
- FileResolver fileResolver = getServices().get(FileResolver.class)
- JavaExecAction action = new DefaultJavaExecAction(fileResolver)
- action.setMain("frege.nativegen.Main")
- action.workingDir = project.projectDir
- action.standardInput = System.in
- action.standardOutput = outputFile.newOutputStream()
- action.errorOutput = System.err
- action.setClasspath(project.files(project.configurations.compile) + project.files("$project.buildDir/classes/main"))
-
- def args = []
- if (help) {
- args << "-h"
- } else {
- args << className
- args << typesFile.absolutePath
- }
- logger.info("Calling Frege NativeGen with args: '$args'")
- action.args args
- action.execute()
- }
-
-
-}