summaryrefslogtreecommitdiff
path: root/src/main/groovy/frege/gradle/CompileTask.groovy
diff options
context:
space:
mode:
authorMark Perry <maperry78@yahoo.com.au>2015-09-20 22:42:17 +1000
committerMark Perry <maperry78@yahoo.com.au>2015-09-20 22:42:17 +1000
commitf59436a7c04d339b1a3265bc7523e1c35c0afb71 (patch)
treef48726795c41ba7d81e4a50ab32e51ecb015c190 /src/main/groovy/frege/gradle/CompileTask.groovy
parente1004a918adab604d5fe88e1412016a63d2881d9 (diff)
downloadfrege-gradle-plugin-f59436a7c04d339b1a3265bc7523e1c35c0afb71.tar.gz
frege-gradle-plugin-f59436a7c04d339b1a3265bc7523e1c35c0afb71.tar.bz2
frege-gradle-plugin-f59436a7c04d339b1a3265bc7523e1c35c0afb71.zip
Added main class option. Removed automatic module name
Diffstat (limited to 'src/main/groovy/frege/gradle/CompileTask.groovy')
-rw-r--r--src/main/groovy/frege/gradle/CompileTask.groovy22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main/groovy/frege/gradle/CompileTask.groovy b/src/main/groovy/frege/gradle/CompileTask.groovy
index 43905b9..60d7caf 100644
--- a/src/main/groovy/frege/gradle/CompileTask.groovy
+++ b/src/main/groovy/frege/gradle/CompileTask.groovy
@@ -82,6 +82,8 @@ class CompileTask extends DefaultTask {
String prefix = ""
+ String mainClass = "frege.compiler.Main"
+
// TODO: Missing presentation of types
@@ -124,7 +126,7 @@ class CompileTask extends DefaultTask {
FileResolver fileResolver = getServices().get(FileResolver.class)
JavaExecAction action = new DefaultJavaExecAction(fileResolver)
- action.setMain("frege.compiler.Main")
+ action.setMain(mainClass)
def pf = project.files(project.configurations.compile)
def path = pf.getAsPath()
logger.info("Compile configuation as path: $path")
@@ -234,15 +236,15 @@ class CompileTask extends DefaultTask {
args << outputDir
if (!module && !extraArgs) {
- logger.info "no module and no extra args given: compiling all of the sourceDir"
- logger.info("sourcePaths2: $sourcePaths")
- if (sourcePaths != null && !sourcePaths.isEmpty()) {
- if (sourcePaths.size() != 1) {
- throw new GradleException("No module specified and module cannot be deduced from a source path with multiple paths")
- } else {
- args << sourcePaths.collect{d -> d.absolutePath}.join(File.pathSeparator)
- }
- }
+// logger.info "no module and no extra args given: compiling all of the sourceDir"
+// logger.info("sourcePaths2: $sourcePaths")
+// if (sourcePaths != null && !sourcePaths.isEmpty()) {
+// if (sourcePaths.size() != 1) {
+// throw new GradleException("No module specified and module cannot be deduced from a source path with multiple paths")
+// } else {
+// args << sourcePaths.collect{d -> d.absolutePath}.join(File.pathSeparator)
+// }
+// }
} else if (module) {
logger.info "compiling module '$module'"