summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2009-11-06 14:47:25 +0000
committerLukas Rytz <lukas.rytz@epfl.ch>2009-11-06 14:47:25 +0000
commit1e93e1784387edd386b109bc22e91595ea3da60c (patch)
tree1ef3fde22882e96950abc4e41ac67ff0b80e2397 /src
parenta690e4691ce55cbe2df6c98208a726dc360d871a (diff)
downloadscala-1e93e1784387edd386b109bc22e91595ea3da60c.tar.gz
scala-1e93e1784387edd386b109bc22e91595ea3da60c.tar.bz2
scala-1e93e1784387edd386b109bc22e91595ea3da60c.zip
fix build on windows. fixes #2578
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/ant/sabbus/ScalacFork.scala16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
index c3d232b16d..8be3d4a4e3 100644
--- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
+++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
@@ -11,6 +11,7 @@
package scala.tools.ant.sabbus
import java.io.File
+import java.io.FileWriter
import org.apache.tools.ant.Project
import org.apache.tools.ant.taskdefs.{MatchingTask, Java}
import org.apache.tools.ant.util.{GlobPatternMapper, SourceFileScanner}
@@ -84,12 +85,19 @@ class ScalacFork extends MatchingTask with TaskArgs {
java.setClasspath(compilerPath.get)
java.setClassname("scala.tools.nsc.Main")
if (!timeout.isEmpty) java.setTimeout(timeout.get)
+
+ //dump the arguments to a file and do "java @file"
+ val tempArgFile = File.createTempFile("scalacfork","")
+ val outf = new FileWriter(tempArgFile)
for (arg <- settings.toArgs)
- java.createArg().setValue(arg)
+ { outf.write(arg) ; outf.write(" ") }
for (file <- includedFiles)
- java.createArg().setFile(file)
- for (af <- argfile)
- java.createArg().setValue("@"+ af)
+ { outf.write(file.getPath) ; outf.write(" ") }
+ outf.close
+
+ java.createArg().setValue("@"+ tempArgFile.getAbsolutePath)
+ if (argfile.isDefined)
+ java.createArg().setValue("@"+ argfile.get)
log(java.getCommandLine.getCommandline.mkString("", " ", ""), Project.MSG_VERBOSE)
val res = java.executeJava()