summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/ant
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/ant')
-rw-r--r--src/compiler/scala/tools/ant/FastScalac.scala15
-rw-r--r--src/compiler/scala/tools/ant/Pack200Task.scala8
-rw-r--r--src/compiler/scala/tools/ant/ScalaMatchingTask.scala6
-rw-r--r--src/compiler/scala/tools/ant/ScalaTool.scala3
-rw-r--r--src/compiler/scala/tools/ant/Scalac.scala16
-rw-r--r--src/compiler/scala/tools/ant/sabbus/ScalacFork.scala2
-rw-r--r--src/compiler/scala/tools/ant/sabbus/Use.scala1
-rwxr-xr-xsrc/compiler/scala/tools/ant/templates/tool-unix.tmpl12
-rw-r--r--src/compiler/scala/tools/ant/templates/tool-windows.tmpl2
9 files changed, 27 insertions, 38 deletions
diff --git a/src/compiler/scala/tools/ant/FastScalac.scala b/src/compiler/scala/tools/ant/FastScalac.scala
index 6f0a30aa9d..3b62c493d3 100644
--- a/src/compiler/scala/tools/ant/FastScalac.scala
+++ b/src/compiler/scala/tools/ant/FastScalac.scala
@@ -8,7 +8,7 @@
package scala.tools.ant
-import org.apache.tools.ant.{AntClassLoader, Project}
+import org.apache.tools.ant.AntClassLoader
import org.apache.tools.ant.taskdefs.Java
import org.apache.tools.ant.types.Path
@@ -109,7 +109,7 @@ class FastScalac extends Scalac {
List(
/*scalac*/
s.debuginfo, s.target
- ) filter (x => x.value != x.default) map (x => "%s:%s".format(x.name, x.value))
+ ) filter (x => x.value != x.default) map (x => s"${x.name}:${x.value}")
val booleanSettings =
List(
@@ -129,7 +129,7 @@ class FastScalac extends Scalac {
val phaseSetting = {
val s = settings.log
if (s.value.isEmpty) Nil
- else List("%s:%s".format(s.name, s.value.mkString(",")))
+ else List(s"${s.name}:${s.value.mkString(",")}")
}
val fscOptions =
@@ -147,8 +147,7 @@ class FastScalac extends Scalac {
case cl: AntClassLoader =>
path add new Path(getProject, cl.getClasspath)
case _ =>
- buildError("Compilation failed because of an internal compiler error;"+
- " see the error output for details.")
+ buildError("Compilation failed because of an internal compiler error; see the error output for details.")
}
path
}
@@ -160,8 +159,7 @@ class FastScalac extends Scalac {
File(url.getFile).jfile.getParentFile.getParentFile.getAbsolutePath
} catch {
case _: Throwable =>
- buildError("Compilation failed because of an internal compiler error;"+
- " couldn't determine value for -Dscala.home=<value>")
+ buildError("Compilation failed because of an internal compiler error; couldn't determine value for -Dscala.home=<value>")
}
java.createJvmarg() setValue "-Dscala.usejavacp=true"
java.createJvmarg() setValue ("-Dscala.home="+scalaHome)
@@ -186,7 +184,6 @@ class FastScalac extends Scalac {
val res = execWithArgFiles(java, paths)
if (failonerror && res != 0)
- buildError("Compilation failed because of an internal compiler error;"+
- " see the error output for details.")
+ buildError("Compilation failed because of an internal compiler error; see the error output for details.")
}
}
diff --git a/src/compiler/scala/tools/ant/Pack200Task.scala b/src/compiler/scala/tools/ant/Pack200Task.scala
index 3c1bc8cad9..df162d734a 100644
--- a/src/compiler/scala/tools/ant/Pack200Task.scala
+++ b/src/compiler/scala/tools/ant/Pack200Task.scala
@@ -8,14 +8,10 @@
package scala.tools.ant
-import java.io.{BufferedOutputStream, File, FileInputStream,
- FileOutputStream, PipedInputStream, PipedOutputStream}
-import java.util.jar.{JarFile, JarInputStream, JarOutputStream, Pack200}
+import java.io.{BufferedOutputStream, File, FileOutputStream}
+import java.util.jar.{JarFile, JarOutputStream, Pack200}
import java.util.jar.Pack200.Packer._
-import org.apache.tools.ant.{BuildException, DirectoryScanner}
-import org.apache.tools.ant.types.FileSet
-
/** An [[http://ant.apache.org Ant]] task that applies the pack200 encoding
* to a JAR file.
*
diff --git a/src/compiler/scala/tools/ant/ScalaMatchingTask.scala b/src/compiler/scala/tools/ant/ScalaMatchingTask.scala
index 68a84bed0c..43b9010509 100644
--- a/src/compiler/scala/tools/ant/ScalaMatchingTask.scala
+++ b/src/compiler/scala/tools/ant/ScalaMatchingTask.scala
@@ -8,11 +8,8 @@
package scala.tools.ant
-import java.io.{ File, InputStream, FileWriter }
-
import org.apache.tools.ant.{ Task, BuildException }
import org.apache.tools.ant.taskdefs.MatchingTask
-import org.apache.tools.ant.types.{ Path, Reference }
trait ScalaTask {
self: Task =>
@@ -27,5 +24,4 @@ trait ScalaTask {
throw new BuildException(message, getLocation())
}
-abstract class ScalaMatchingTask extends MatchingTask with ScalaTask {
-}
+abstract class ScalaMatchingTask extends MatchingTask with ScalaTask
diff --git a/src/compiler/scala/tools/ant/ScalaTool.scala b/src/compiler/scala/tools/ant/ScalaTool.scala
index bb6a933d3f..67879d6de3 100644
--- a/src/compiler/scala/tools/ant/ScalaTool.scala
+++ b/src/compiler/scala/tools/ant/ScalaTool.scala
@@ -8,8 +8,7 @@
package scala.tools.ant
-import java.io.{File, InputStream, FileWriter}
-import org.apache.tools.ant.BuildException
+import java.io.{File, FileWriter}
import org.apache.tools.ant.types.{Path, Reference}
/** An Ant task that generates a shell or batch script to execute a
diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala
index a6024d4388..511572f6f3 100644
--- a/src/compiler/scala/tools/ant/Scalac.scala
+++ b/src/compiler/scala/tools/ant/Scalac.scala
@@ -10,13 +10,11 @@ package scala.tools.ant
import java.io.{File, PrintWriter, BufferedWriter, FileWriter}
-import org.apache.tools.ant.{ BuildException, Project, AntClassLoader }
+import org.apache.tools.ant.{ Project, AntClassLoader}
import org.apache.tools.ant.taskdefs.Java
import org.apache.tools.ant.types.{Path, Reference}
-import org.apache.tools.ant.util.{FileUtils, GlobPatternMapper,
- SourceFileScanner, facade}
-import org.apache.tools.ant.util.facade.{FacadeTaskHelper,
- ImplementationSpecificArgument}
+import org.apache.tools.ant.util.{FileUtils, GlobPatternMapper, SourceFileScanner}
+import org.apache.tools.ant.util.facade.{FacadeTaskHelper, ImplementationSpecificArgument}
import scala.tools.nsc.{Global, Settings, CompilerCommand}
import scala.tools.nsc.io.{Path => SPath}
@@ -90,9 +88,9 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
object CompilerPhase extends PermissibleValue {
val values = List("namer", "typer", "pickler", "refchecks",
"uncurry", "tailcalls", "specialize", "explicitouter",
- "erasure", "lazyvals", "lambdalift", "constructors",
- "flatten", "mixin", "delambdafy", "cleanup", "icode", "inliner",
- "closelim", "dce", "jvm", "terminal")
+ "erasure", "fields", "lambdalift", "constructors",
+ "flatten", "mixin", "delambdafy", "cleanup",
+ "jvm", "terminal")
}
/** Defines valid values for the `target` property. */
@@ -553,7 +551,7 @@ class Scalac extends ScalaMatchingTask with ScalacShared {
val str =
if (javaFiles.isEmpty) "%d source file%s".format(list.length, plural(list))
else "%d scala and %d java source files".format(scalaFiles.length, javaFiles.length)
- log("Compiling %s to %s".format(str, getDestination.toString))
+ log(s"Compiling $str to $getDestination")
}
else log("No files selected for compilation", Project.MSG_VERBOSE)
diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
index cde827ba54..c31f55c9b6 100644
--- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
+++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
@@ -10,7 +10,7 @@ package scala
package tools.ant
package sabbus
-import java.io.{ File, FileWriter }
+import java.io.File
import org.apache.tools.ant.Project
import org.apache.tools.ant.taskdefs.Java
import org.apache.tools.ant.util.{ GlobPatternMapper, SourceFileScanner }
diff --git a/src/compiler/scala/tools/ant/sabbus/Use.scala b/src/compiler/scala/tools/ant/sabbus/Use.scala
index a8736f228b..cb514e35b3 100644
--- a/src/compiler/scala/tools/ant/sabbus/Use.scala
+++ b/src/compiler/scala/tools/ant/sabbus/Use.scala
@@ -13,7 +13,6 @@ package sabbus
import java.io.File
-import org.apache.tools.ant.types.{Path, Reference}
import org.apache.tools.ant.util.{GlobPatternMapper, SourceFileScanner}
class Use extends ScalaMatchingTask {
diff --git a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
index 5e6b3c041e..70ae9af444 100755
--- a/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-unix.tmpl
@@ -160,7 +160,7 @@ while [[ $# -gt 0 ]]; do
shift 2
;;
-nobootcp)
- unset usebootcp
+ usebootcp="false"
shift
;;
-usebootcp)
@@ -189,15 +189,19 @@ declare -a classpath_args
# default to the boot classpath for speed, except on cygwin/mingw/msys because
# JLine on Windows requires a custom DLL to be loaded.
-unset usebootcp
-if [[ -z "$cygwin$mingw$msys" ]]; then
+if [[ "$usebootcp" != "false" && -z "$cygwin$mingw$msys" ]]; then
usebootcp="true"
fi
# If using the boot classpath, also pass an empty classpath
# to java to suppress "." from materializing.
-if [[ -n $usebootcp ]]; then
+if [[ "$usebootcp" == "true" ]]; then
classpath_args=("-Xbootclasspath/a:$TOOL_CLASSPATH" -classpath "\"\"")
+ # Java 9 removed sun.boot.class.path, and the supposed replacement to at least see
+ # the appended boot classpath (jdk.boot.class.path.append) is not visible.
+ # So we have to pass a custom system property that PathResolver will find.
+ # We do this for all JVM versions, rather than getting into the business of JVM version detection.
+ classpath_args+=("-Dscala.boot.class.path=$TOOL_CLASSPATH")
else
classpath_args=(-classpath "$TOOL_CLASSPATH")
fi
diff --git a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
index 50e44fb669..338f2f1375 100644
--- a/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
+++ b/src/compiler/scala/tools/ant/templates/tool-windows.tmpl
@@ -156,7 +156,7 @@ rem (see http://support.microsoft.com/?kbid=833431)
rem set _SCALA_HOME=%~dps0..
:set_home
set _BIN_DIR=
- for %%i in (%~sf0) do set _BIN_DIR=%_BIN_DIR%%%~dpsi
+ for %%i in ("%~sf0") do set _BIN_DIR=%_BIN_DIR%%%~dpsi
set _SCALA_HOME=%_BIN_DIR%..
goto :eof