This commit is contained in:
Eugene Yokota 2015-09-14 10:54:22 -04:00
commit 076ccd7b90
3 changed files with 14 additions and 4 deletions

View File

@ -245,7 +245,8 @@ object Defaults extends BuildCommon {
clean := {
val _ = clean.value
IvyActions.cleanCachedResolutionCache(ivyModule.value, streams.value.log)
}
},
scalaCompilerBridgeSource := ModuleID(xsbti.ArtifactInfo.SbtOrganization, "compiler-interface", sbtVersion.value, Some("component")).sources()
)
// must be a val: duplication detected by object identity
private[this] lazy val compileBaseGlobal: Seq[Setting[_]] = globalDefaults(Seq(
@ -274,8 +275,7 @@ object Defaults extends BuildCommon {
if (plugin) scalaBase / ("sbt-" + sbtv) else scalaBase
}
// TODO: Fix source module
def compilersSetting = compilers := Compiler.compilers(scalaInstance.value, classpathOptions.value, javaHome.value, ivyConfiguration.value, ???)(appConfiguration.value, streams.value.log)
def compilersSetting = compilers := Compiler.compilers(scalaInstance.value, classpathOptions.value, javaHome.value, ivyConfiguration.value, scalaCompilerBridgeSource.value)(appConfiguration.value, streams.value.log)
lazy val configTasks = docTaskSettings(doc) ++ inTask(compile)(compileInputsSettings) ++ configGlobal ++ compileAnalysisSettings ++ Seq(
compile <<= compileTask,

View File

@ -180,6 +180,7 @@ object Keys {
val sbtPlugin = SettingKey[Boolean]("sbt-plugin", "If true, enables adding sbt as a dependency and auto-generation of the plugin descriptor file.", BMinusSetting)
val printWarnings = TaskKey[Unit]("print-warnings", "Shows warnings from compilation, including ones that weren't printed initially.", BPlusTask)
val fileInputOptions = SettingKey[Seq[String]]("file-input-options", "Options that take file input, which may invalidate the cache.", CSetting)
val scalaCompilerBridgeSource = SettingKey[ModuleID]("scala-compiler-bridge-source", "Configures the module ID of the sources of the compiler bridge.", CSetting)
val clean = TaskKey[Unit]("clean", "Deletes files produced by the build, such as generated sources, compiled classes, and task caches.", APlusTask)
val console = TaskKey[Unit]("console", "Starts the Scala interpreter with the project classes on the classpath.", APlusTask)

View File

@ -20,6 +20,7 @@ import StandardMain._
import java.io.File
import java.net.URI
import java.util.Locale
import scala.util.control.NonFatal
/** This class is the entry point for sbt.*/
final class xMain extends xsbti.AppMain {
@ -181,7 +182,15 @@ object BuiltinCommands {
val extracted = Project.extract(s)
import extracted._
val index = structure.index
index.keyIndex.keys(Some(currentRef)).toSeq.map(index.keyMap).distinct
index.keyIndex.keys(Some(currentRef)).toSeq.map { key =>
try
Some(index.keyMap(key))
catch {
case NonFatal(ex) =>
s.log error ex.getMessage
None
}
}.collect { case Some(s) => s }.distinct
}
def sortByLabel(keys: Seq[AttributeKey[_]]): Seq[AttributeKey[_]] = keys.sortBy(_.label)