From 80e1a4f60f870a572b2efe53f97cbc5b06929c27 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 20 Oct 2009 18:47:51 -0400 Subject: [PATCH] Add toString for ScalaInstance and verify that version does not contain spaces --- compile/ScalaInstance.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compile/ScalaInstance.scala b/compile/ScalaInstance.scala index a0ab64fe5..3eae59b4f 100644 --- a/compile/ScalaInstance.scala +++ b/compile/ScalaInstance.scala @@ -9,8 +9,10 @@ package xsbt * The 'actualVersion' field should be used to uniquely identify the compiler. It is obtained from the compiler.properties file.*/ final class ScalaInstance(val version: String, val loader: ClassLoader, val libraryJar: File, val compilerJar: File) extends NotNull { + require(version.indexOf(' ') < 0, "Version cannot contain spaces (was '" + version + "')") /** Gets the version of Scala in the compiler.properties file from the loader. This version may be different than that given by 'version'*/ lazy val actualVersion = ScalaInstance.actualVersion(loader)(" version " + version) + override def toString = "Scala instance{version label " + version + ", actual version " + actualVersion + ", library jar: " + libraryJar + ", compiler jar: " + compilerJar + "}" } object ScalaInstance {