Add toString for ScalaInstance and verify that version does not contain spaces

This commit is contained in:
Mark Harrah 2009-10-20 18:47:51 -04:00
parent 94a0fb5916
commit 80e1a4f60f
1 changed files with 2 additions and 0 deletions

View File

@ -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
{