From b990a29c09c0df5644c9c4664d9f3be8d6db3170 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Mon, 8 Apr 2013 09:21:40 -0400 Subject: [PATCH] Undeprecate ScalaInstance.libraryJar, which will be reliable for modularized Scala. --- main/src/main/scala/sbt/Defaults.scala | 1 - util/classpath/src/main/scala/sbt/ScalaInstance.scala | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index bc618a15d..257016892 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -1314,7 +1314,6 @@ object Classpaths def unmanagedScalaLibrary: Initialize[Task[Seq[File]]] = Def.taskDyn { if(autoScalaLibrary.value && scalaHome.value.isDefined) - // TODO: what goes here when Scala library is modularized? Def.task { scalaInstance.value.libraryJar :: Nil } else Def.task { Nil } diff --git a/util/classpath/src/main/scala/sbt/ScalaInstance.scala b/util/classpath/src/main/scala/sbt/ScalaInstance.scala index 13cf38202..617de9ebb 100644 --- a/util/classpath/src/main/scala/sbt/ScalaInstance.scala +++ b/util/classpath/src/main/scala/sbt/ScalaInstance.scala @@ -7,16 +7,14 @@ package sbt import xsbti.ArtifactInfo.{ScalaCompilerID, ScalaLibraryID, ScalaOrganization} /** Represents the source for Scala classes for a given version. The reason both a ClassLoader and the jars are required -* is that the compiler requires the location of the library/compiler jars on the (boot)classpath and the loader is used +* is that the compiler requires the location of the library jar on the (boot)classpath and the loader is used * for the compiler itself. * The 'version' field is the version used to obtain the Scala classes. This is typically the version for the maven repository. * The 'actualVersion' field should be used to uniquely identify the compiler. It is obtained from the compiler.properties file. * * This should be constructed via the ScalaInstance.apply methods. The primary constructor is deprecated. **/ -final class ScalaInstance(val version: String, val loader: ClassLoader, - @deprecated("Only `allJars` and `jars` can be reliably provided for modularized Scala.", "0.13.0") - val libraryJar: File, +final class ScalaInstance(val version: String, val loader: ClassLoader, val libraryJar: File, @deprecated("Only `allJars` and `jars` can be reliably provided for modularized Scala.", "0.13.0") val compilerJar: File, @deprecated("Only `allJars` and `jars` can be reliably provided for modularized Scala.", "0.13.0") @@ -106,8 +104,7 @@ object ScalaInstance private def compilerJar(scalaHome: File) = scalaJar(scalaHome, "scala-compiler.jar") private def libraryJar(scalaHome: File) = scalaJar(scalaHome, "scala-library.jar") - @deprecated("No longer used.", "0.13.0") - def scalaJar(scalaHome: File, name: String) = new File(scalaHome, "lib" + File.separator + name) + def scalaJar(scalaHome: File, name: String) = new File(scalaLib(scalaHome), name) @deprecated("No longer used.", "0.13.0") def optScalaJar(scalaHome: File, name: String): List[File] =