Lowering the noise level in the classpath debugging output.

Try ant -Dscalac.args="-Ylog-classpath" if you would like the
rare joy of having a fair idea what is being used to compile
what.  No review.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@20938 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
extempore 2010-02-20 22:50:20 +00:00
parent 2d550f70fe
commit e7c4daa2a2
2 changed files with 16 additions and 11 deletions

View File

@ -243,8 +243,7 @@ class Settings(errorFn: String => Unit) extends ScalacSettings {
lazy val OutputSetting = untupled((output _).tupled andThen add[OutputSetting])
lazy val DefinesSetting = () => add(new DefinesSetting())
override def toString() =
"Settings(\n%s)" format (userSetSettings map (" " + _ + "\n") mkString)
override def toString() = "Settings {\n%s}\n" format (userSetSettings map (" " + _ + "\n") mkString)
}
object Settings {

View File

@ -56,22 +56,25 @@ object PathResolver {
def javaUserClassPath = propOrElse("java.class.path", "")
def javaExtDirs = propOrElse("java.ext.dirs", "")
def userHome = propOrElse("user.home", "")
def scalaHome = propOrElse("scala.home", "")
def scalaHome = System.getProperty("scala.home") // keep null so we know when it's unset
def scalaExtDirs = propOrElse("scala.ext.dirs", "")
def scalaHomeGuessed = searchForScalaHome
def scalaHomeIsSet = System.getProperty("scala.home") != null
def scalaHomeIsSet = scalaHome != null
override def toString = """
|object Environment {
| javaBootClassPath = %s
| javaBootClassPath = <%d chars>
| javaUserClassPath = %s
| javaExtDirs = %s
| userHome = %s
| scalaHome = %s
| scalaExtDirs = %s
|}""".trim.stripMargin.format(
ppcp(javaBootClassPath), ppcp(javaUserClassPath), ppcp(javaExtDirs),
userHome, scalaHome, ppcp(scalaExtDirs)
javaBootClassPath.length,
ppcp(javaUserClassPath),
ppcp(javaExtDirs),
userHome, scalaHome,
ppcp(scalaExtDirs)
)
}
@ -83,7 +86,7 @@ object PathResolver {
def javaUserClassPath = firstNonEmpty(Environment.javaUserClassPath, Environment.classPathEnv)
def javaExtDirs = Environment.javaExtDirs
def scalaHome = Environment.scalaHome
def scalaHome = Option(Environment.scalaHome) getOrElse ""
def scalaHomeDir = Directory(scalaHome)
def scalaHomeExists = scalaHomeDir.isDirectory
def scalaLibDir = Directory(scalaHomeDir / "lib")
@ -225,12 +228,15 @@ class PathResolver(settings: Settings, context: JavaContext) {
lazy val result = {
val cp = new JavaClassPath(containers, context)
if (settings.Ylogcp.value) {
Console.println("Classpath built from settings: " + settings)
Console.println("Classpath built from " + settings)
Console.println("And Environment: " + PathResolver.Environment)
cp.show
val xs = (Calculated.basis drop 2).flatten.distinct
println("After java boot/extdirs classpath has %d entries:" format xs.size)
xs foreach (x => println(" " + x))
}
cp
}
}
def asURLs = result.asURLs
}