From 2a84a80d5baf76dbb32f47bbeda53adf161ea1ee Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Thu, 12 Apr 2012 17:31:24 -0400 Subject: [PATCH] clean up scalaOrg changes --- launch/BootConfiguration.scala | 11 ++++++----- launch/Launch.scala | 6 +++--- launch/LaunchConfiguration.scala | 4 ++-- launch/Update.scala | 5 ++--- util/classpath/ScalaInstance.scala | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/launch/BootConfiguration.scala b/launch/BootConfiguration.scala index aed6c77dc..699bf0a8a 100644 --- a/launch/BootConfiguration.scala +++ b/launch/BootConfiguration.scala @@ -6,11 +6,12 @@ import java.io.File // -// scala-/ [baseDirectoryName] +// [.]scala-/ [baseDirectoryName] // lib/ [ScalaDirectoryName] // -/ [appDirectoryName] // // see also ProjectProperties for the set of constants that apply to the build.properties file in a project +// The scala organization is used as a prefix in baseDirectoryName when a non-standard organization is used. private object BootConfiguration { // these are the Scala module identifiers to resolve/retrieve @@ -53,11 +54,11 @@ private object BootConfiguration val DefaultIvyConfiguration = "default" + /** The name of the directory within the boot directory to retrieve scala to. */ val ScalaDirectoryName = "lib" - + /** The Ivy pattern to use for retrieving the scala compiler and library. It is relative to the directory - * containing all jars for the requested version of scala. - */ + * containing all jars for the requested version of scala. */ val scalaRetrievePattern = ScalaDirectoryName + "/[artifact](-[classifier]).[ext]" def artifactType(classifier: String) = @@ -81,7 +82,7 @@ private object BootConfiguration case None => "other" case Some(sv) => (if (scalaOrg == ScalaOrg) "" else scalaOrg + ".") + ScalaVersionPrefix + sv } - + def extractScalaVersion(dir: File): Option[String] = { val name = dir.getName diff --git a/launch/Launch.scala b/launch/Launch.scala index 3bcc59ccd..b89c20415 100644 --- a/launch/Launch.scala +++ b/launch/Launch.scala @@ -87,7 +87,7 @@ class Launch private[xsbt](val bootDirectory: File, val lockBoot: Boolean, val i def getScala(version: String, reason: String): xsbti.ScalaProvider = getScala(version, reason, ScalaOrg) def getScala(version: String, reason: String, scalaOrg: String) = scalaProviders((scalaOrg, version), reason) def app(id: xsbti.ApplicationID, version: String): xsbti.AppProvider = app(id, Option(version)) - def app(id: xsbti.ApplicationID, scalaVersion: Option[String]): xsbti.AppProvider = + def app(id: xsbti.ApplicationID, scalaVersion: Option[String]): xsbti.AppProvider = getAppProvider(id, scalaVersion, false) val bootLoader = new BootFilteredLoader(getClass.getClassLoader) @@ -150,7 +150,7 @@ class Launch private[xsbt](val bootDirectory: File, val lockBoot: Boolean, val i retrieve() else existing(app, ScalaOrg, explicitScalaVersion, baseDirs) getOrElse retrieve() - + val scalaVersion = getOrError(strictOr(explicitScalaVersion, retrievedApp.detectedScalaVersion), "No Scala version specified or detected") val scalaProvider = getScala(scalaVersion, "(for " + id.name + ")") @@ -174,7 +174,7 @@ class Launch private[xsbt](val bootDirectory: File, val lockBoot: Boolean, val i def getScalaProvider(scalaOrg: String, scalaVersion: String, reason: String): xsbti.ScalaProvider = locked(new Callable[xsbti.ScalaProvider] { def call = getScalaProvider0(scalaOrg, scalaVersion, reason) }) - private[this] final def getScalaProvider0(scalaOrg: String, scalaVersion: String, reason: String) = + private[this] final def getScalaProvider0(scalaOrg: String, scalaVersion: String, reason: String) = { val scalaM = scalaModule(scalaOrg, scalaVersion) val (scalaHome, lib) = scalaDirs(scalaM, scalaOrg, scalaVersion) diff --git a/launch/LaunchConfiguration.scala b/launch/LaunchConfiguration.scala index 625ad630d..dea0ea65f 100644 --- a/launch/LaunchConfiguration.scala +++ b/launch/LaunchConfiguration.scala @@ -15,14 +15,14 @@ final case class LaunchConfiguration(scalaVersion: Value[String], ivyConfigurati val sv = Value.get(scalaVersion) if(sv == "auto") None else Some(sv) } - + def withScalaVersion(newScalaVersion: String) = LaunchConfiguration(new Explicit(newScalaVersion), ivyConfiguration, app, boot, logging, appProperties) def withApp(app: Application) = LaunchConfiguration(scalaVersion, ivyConfiguration, app, boot, logging, appProperties) def withAppVersion(newAppVersion: String) = LaunchConfiguration(scalaVersion, ivyConfiguration, app.withVersion(new Explicit(newAppVersion)), boot, logging, appProperties) // TODO: withExplicit def withVersions(newScalaVersion: String, newAppVersion: String, classifiers0: Classifiers) = LaunchConfiguration(new Explicit(newScalaVersion), ivyConfiguration.copy(classifiers = classifiers0), app.withVersion(new Explicit(newAppVersion)), boot, logging, appProperties) - + def map(f: File => File) = LaunchConfiguration(scalaVersion, ivyConfiguration, app.map(f), boot.map(f), logging, appProperties) } final case class IvyOptions(ivyHome: Option[File], classifiers: Classifiers, repositories: List[xsbti.Repository], checksums: List[String]) diff --git a/launch/Update.scala b/launch/Update.scala index 23816e467..c24c151d3 100644 --- a/launch/Update.scala +++ b/launch/Update.scala @@ -36,8 +36,7 @@ final class UpdateApp(val id: Application, val classifiers: List[String], val tp final class UpdateConfiguration(val bootDirectory: File, val ivyHome: Option[File], val scalaOrg: String, val scalaVersion: Option[String], val repositories: List[xsbti.Repository], val checksums: List[String]) { - def getScalaVersion = scalaVersion match { case Some(sv) => sv; case None => "" } - + def getScalaVersion = scalaVersion match { case Some(sv) => sv; case None => "" } } final class UpdateResult(val success: Boolean, val scalaVersion: Option[String]) @@ -130,7 +129,7 @@ final class Update(config: UpdateConfiguration) target match { case u: UpdateScala => - val scalaVersion = getScalaVersion + val scalaVersion = getScalaVersion addDependency(moduleID, scalaOrg, CompilerModuleName, scalaVersion, "default;optional(default)", u.classifiers) addDependency(moduleID, scalaOrg, LibraryModuleName, scalaVersion, "default", u.classifiers) excludeJUnit(moduleID) diff --git a/util/classpath/ScalaInstance.scala b/util/classpath/ScalaInstance.scala index 9b687c9b5..68ec2b420 100644 --- a/util/classpath/ScalaInstance.scala +++ b/util/classpath/ScalaInstance.scala @@ -23,7 +23,7 @@ object ScalaInstance { val ScalaOrg = "org.scala-lang" val VersionPrefix = "version " - + def apply(org: String, version: String, launcher: xsbti.Launcher): ScalaInstance = // Due to incompatibility with previous launchers if scalaOrg has default value revert to an existing method if (org == ScalaOrg)