mirror of https://github.com/sbt/sbt.git
Merge
This commit is contained in:
commit
97e21b62c9
|
|
@ -7,7 +7,7 @@ import Sxr.sxr
|
|||
// but can be shared across the multi projects.
|
||||
def buildLevelSettings: Seq[Setting[_]] = inThisBuild(Seq(
|
||||
organization := "org.scala-sbt",
|
||||
version := "0.13.10-SNAPSHOT",
|
||||
version := "1.0.0-SNAPSHOT",
|
||||
bintrayOrganization := Some(if (publishStatus.value == "releases") "typesafe" else "sbt"),
|
||||
bintrayRepository := s"ivy-${publishStatus.value}",
|
||||
bintrayPackage := "sbt",
|
||||
|
|
|
|||
|
|
@ -3,12 +3,12 @@
|
|||
*/
|
||||
package sbt
|
||||
|
||||
import sbt.compiler.javac.{ IncrementalCompilerJavaTools, JavaTools }
|
||||
import sbt.internal.inc.javac.{ IncrementalCompilerJavaTools, JavaTools }
|
||||
import sbt.internal.inc.{ AnalyzingCompiler, ClasspathOptions, CompileSetup, CompileOutput, IC, JavaTool, LoggerReporter, ScalaInstance }
|
||||
import xsbti.{ Logger => _, _ }
|
||||
import xsbti.compile.{ CompileOrder, GlobalsCache }
|
||||
import CompileOrder.{ JavaThenScala, Mixed, ScalaThenJava }
|
||||
import compiler._
|
||||
import inc._
|
||||
import sbt.internal.inc.{ Analysis, ComponentCompiler, IncOptions, Locate }
|
||||
import Locate.DefinesClass
|
||||
import java.io.File
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.File
|
||||
import compiler.AnalyzingCompiler
|
||||
import sbt.internal.inc.AnalyzingCompiler
|
||||
import sbt.internal.util.JLine
|
||||
import sbt.util.Logger
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.{ File, PrintWriter }
|
||||
import compiler.{ AnalyzingCompiler, JavaCompiler }
|
||||
import sbt.internal.inc.{ AnalyzingCompiler, JavaCompiler }
|
||||
|
||||
import Predef.{ conforms => _, _ }
|
||||
import sbt.internal.util.Types.:+:
|
||||
|
|
@ -26,9 +26,9 @@ object Doc {
|
|||
scaladoc(label, cache, compiler, Seq())
|
||||
def scaladoc(label: String, cache: File, compiler: AnalyzingCompiler, fileInputOptions: Seq[String]): Gen =
|
||||
cached(cache, fileInputOptions, prepare(label + " Scala API documentation", compiler.doc))
|
||||
def javadoc(label: String, cache: File, doc: sbt.compiler.javac.JavaTools, log: Logger, reporter: Reporter): Gen =
|
||||
def javadoc(label: String, cache: File, doc: sbt.internal.inc.javac.JavaTools, log: Logger, reporter: Reporter): Gen =
|
||||
javadoc(label, cache, doc, log, reporter, Seq())
|
||||
def javadoc(label: String, cache: File, doc: sbt.compiler.javac.JavaTools, log: Logger, reporter: Reporter, fileInputOptions: Seq[String]): Gen =
|
||||
def javadoc(label: String, cache: File, doc: sbt.internal.inc.javac.JavaTools, log: Logger, reporter: Reporter, fileInputOptions: Seq[String]): Gen =
|
||||
cached(cache, fileInputOptions, prepare(label + " Java API documentation", filterSources(javaSourcesOnly,
|
||||
(sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], maxErrors: Int, log: Logger) => {
|
||||
// doc.doc
|
||||
|
|
@ -48,7 +48,7 @@ object Doc {
|
|||
generate("Scala", label, compiler.doc, sources, classpath, outputDirectory, options, maximumErrors, log)
|
||||
}
|
||||
}
|
||||
private[sbt] final class Javadoc(maximumErrors: Int, doc: sbt.compiler.Javadoc) extends Doc {
|
||||
private[sbt] final class Javadoc(maximumErrors: Int, doc: sbt.internal.inc.Javadoc) extends Doc {
|
||||
def apply(label: String, sources: Seq[File], classpath: Seq[File], outputDirectory: File, options: Seq[String], log: Logger) {
|
||||
// javadoc doesn't handle *.scala properly, so we evict them from javadoc sources list.
|
||||
generate("Java", label, doc.doc, sources.filterNot(_.name.endsWith(".scala")), classpath, outputDirectory, options, maximumErrors, log)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.{ File, Writer }
|
||||
import inc.Relations
|
||||
import sbt.internal.inc.Relations
|
||||
|
||||
import sbt.internal.util.Relation
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.File
|
||||
import compiler.{ AnalyzingCompiler, JavaCompiler }
|
||||
import sbt.internal.inc.{ AnalyzingCompiler, ClasspathOptions, JavaCompiler, RawCompiler, ScalaInstance }
|
||||
|
||||
import Predef.{ conforms => _, _ }
|
||||
import sbt.io.Path._
|
||||
|
|
@ -74,7 +74,7 @@ object RawCompileLike {
|
|||
|
||||
def rawCompile(instance: ScalaInstance, cpOptions: ClasspathOptions): Gen = (sources, classpath, outputDirectory, options, maxErrors, log) =>
|
||||
{
|
||||
val compiler = new sbt.compiler.RawCompiler(instance, cpOptions, log)
|
||||
val compiler = new RawCompiler(instance, cpOptions, log)
|
||||
compiler(sources, classpath, outputDirectory, options)
|
||||
}
|
||||
def compile(label: String, cache: File, instance: ScalaInstance, cpOptions: ClasspathOptions): Gen =
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ package sbt
|
|||
|
||||
import std._
|
||||
import xsbt.api.{ Discovered, Discovery }
|
||||
import inc.Analysis
|
||||
import sbt.internal.inc.Analysis
|
||||
import TaskExtra._
|
||||
import sbt.internal.util.FeedbackProvidedException
|
||||
import sbt.internal.util.Types._
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ package sbt
|
|||
import sbt.internal.util.{ AttributeKey, FullReader }
|
||||
import sbt.internal.util.complete.{ Completion, Completions, DefaultParsers, History => CHistory, HistoryCommands, Parser, TokenCompletions }
|
||||
import sbt.internal.util.Types.{ const, idFun }
|
||||
import classpath.ClasspathUtilities.toLoader
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities.toLoader
|
||||
import sbt.internal.inc.ModuleUtilities
|
||||
import DefaultParsers._
|
||||
import Function.tupled
|
||||
import Command.applyEffect
|
||||
|
|
|
|||
|
|
@ -2,13 +2,14 @@ package sbt
|
|||
|
||||
import java.io.File
|
||||
import sbt.internal.util.AttributeKey
|
||||
import sbt.internal.inc.classpath.ClassLoaderCache
|
||||
|
||||
object BasicKeys {
|
||||
val historyPath = AttributeKey[Option[File]]("history", "The location where command line history is persisted.", 40)
|
||||
val shellPrompt = AttributeKey[State => String]("shell-prompt", "The function that constructs the command prompt from the current build state.", 10000)
|
||||
val watch = AttributeKey[Watched]("watch", "Continuous execution configuration.", 1000)
|
||||
private[sbt] val interactive = AttributeKey[Boolean]("interactive", "True if commands are currently being entered from an interactive environment.", 10)
|
||||
private[sbt] val classLoaderCache = AttributeKey[classpath.ClassLoaderCache]("class-loader-cache", "Caches class loaders based on the classpath entries and last modified times.", 10)
|
||||
private[sbt] val classLoaderCache = AttributeKey[ClassLoaderCache]("class-loader-cache", "Caches class loaders based on the classpath entries and last modified times.", 10)
|
||||
private[sbt] val OnFailureStack = AttributeKey[List[Option[String]]]("on-failure-stack", "Stack that remembers on-failure handlers.", 10)
|
||||
private[sbt] val explicitGlobalLogLevels = AttributeKey[Boolean]("explicit-global-log-levels", "True if the global logging levels were explicitly set by the user.", 10)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
package sbt
|
||||
|
||||
import java.io.File
|
||||
import sbt.internal.inc.ReflectUtilities
|
||||
import sbt.internal.util.complete.{ DefaultParsers, EditDistance, Parser }
|
||||
import sbt.internal.util.Types.const
|
||||
import sbt.internal.util.{ AttributeKey, AttributeMap, Util }
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import java.util.concurrent.Callable
|
|||
import sbt.util.Logger
|
||||
import sbt.internal.util.{ AttributeKey, AttributeMap, ErrorHandling, ExitHook, ExitHooks, GlobalLogging }
|
||||
import sbt.internal.util.complete.HistoryCommands
|
||||
import sbt.internal.inc.classpath.ClassLoaderCache
|
||||
|
||||
/**
|
||||
* Data structure representing all command execution information.
|
||||
|
|
@ -129,7 +130,7 @@ trait StateOps {
|
|||
def setInteractive(flag: Boolean): State
|
||||
|
||||
/** Get the class loader cache for the application.*/
|
||||
def classLoaderCache: classpath.ClassLoaderCache
|
||||
def classLoaderCache: ClassLoaderCache
|
||||
|
||||
/** Create and register a class loader cache. This should be called once at the application entry-point.*/
|
||||
def initializeClassLoaderCache: State
|
||||
|
|
@ -233,9 +234,9 @@ object State {
|
|||
def interactive = getBoolean(s, BasicKeys.interactive, false)
|
||||
def setInteractive(i: Boolean) = s.put(BasicKeys.interactive, i)
|
||||
|
||||
def classLoaderCache: classpath.ClassLoaderCache = s get BasicKeys.classLoaderCache getOrElse newClassLoaderCache
|
||||
def classLoaderCache: ClassLoaderCache = s get BasicKeys.classLoaderCache getOrElse newClassLoaderCache
|
||||
def initializeClassLoaderCache = s.put(BasicKeys.classLoaderCache, newClassLoaderCache)
|
||||
private[this] def newClassLoaderCache = new classpath.ClassLoaderCache(s.configuration.provider.scalaProvider.launcher.topLoader)
|
||||
private[this] def newClassLoaderCache = new ClassLoaderCache(s.configuration.provider.scalaProvider.launcher.topLoader)
|
||||
}
|
||||
|
||||
import ExceptionCategory._
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import Keys.{ name, organization, thisProject, autoGeneratedProject }
|
|||
import Def.{ ScopedKey, Setting }
|
||||
import sbt.io.Hash
|
||||
import sbt.internal.util.Attributed
|
||||
import sbt.internal.inc.ReflectUtilities
|
||||
|
||||
// name is more like BuildDefinition, but that is too long
|
||||
trait Build {
|
||||
|
|
@ -68,5 +69,5 @@ object Build {
|
|||
|
||||
@deprecated("Use Attributed.data", "0.13.0")
|
||||
def data[T](in: Seq[Attributed[T]]): Seq[T] = Attributed.data(in)
|
||||
def analyzed(in: Seq[Attributed[_]]): Seq[inc.Analysis] = in.flatMap { _.metadata.get(Keys.analysis) }
|
||||
def analyzed(in: Seq[Attributed[_]]): Seq[sbt.internal.inc.Analysis] = in.flatMap { _.metadata.get(Keys.analysis) }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import sbt.util.Logger
|
|||
import java.io.File
|
||||
import sbt.librarymanagement.Resolver
|
||||
import sbt.internal.librarymanagement.{ InlineIvyConfiguration, IvyPaths }
|
||||
import sbt.internal.inc.{ AnalyzingCompiler, ClasspathOptions }
|
||||
|
||||
object ConsoleProject {
|
||||
def apply(state: State, extra: String, cleanupCommands: String = "", options: Seq[String] = Nil)(implicit log: Logger): Unit = {
|
||||
|
|
@ -20,7 +21,7 @@ object ConsoleProject {
|
|||
val ivyPaths = new IvyPaths(unit.unit.localBase, bootIvyHome(state.configuration))
|
||||
val ivyConfiguration = new InlineIvyConfiguration(ivyPaths, Resolver.withDefaultResolvers(Nil),
|
||||
Nil, Nil, localOnly, lock, checksums, None, log)
|
||||
val compiler: sbt.compiler.AnalyzingCompiler = Compiler.compilers(ClasspathOptions.repl, ivyConfiguration)(state.configuration, log).scalac
|
||||
val compiler: AnalyzingCompiler = Compiler.compilers(ClasspathOptions.repl, ivyConfiguration)(state.configuration, log).scalac
|
||||
val imports = BuildUtil.getImports(unit.unit) ++ BuildUtil.importAll(bindings.map(_._1))
|
||||
val importString = imports.mkString("", ";\n", ";\n\n")
|
||||
val initCommands = importString + extra
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import Def.{ ScopedKey, Setting }
|
|||
import Scope.GlobalScope
|
||||
import CommandStrings.{ CrossCommand, crossHelp, SwitchCommand, switchHelp }
|
||||
import java.io.File
|
||||
import sbt.internal.inc.ScalaInstance
|
||||
|
||||
import sbt.io.IO
|
||||
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@ import sbt.librarymanagement.Configurations.{ Compile, CompilerPlugin, Integrati
|
|||
import sbt.librarymanagement.CrossVersion.{ binarySbtVersion, binaryScalaVersion, partialVersion }
|
||||
import sbt.internal.util.complete._
|
||||
import std.TaskExtra._
|
||||
import sbt.inc.{ Analysis, FileValueCache, IncOptions, Locate }
|
||||
import sbt.compiler.MixedAnalyzingCompiler
|
||||
import sbt.internal.inc.{ Analysis, ClassfileManager, ClasspathOptions, CompilerCache, FileValueCache, IncOptions, Locate, LoggerReporter, MixedAnalyzingCompiler, ScalaInstance }
|
||||
import testing.{ Framework, Runner, AnnotatedFingerprint, SubclassFingerprint }
|
||||
|
||||
import sbt.librarymanagement._
|
||||
|
|
@ -58,10 +57,10 @@ object Defaults extends BuildCommon {
|
|||
|
||||
def lock(app: xsbti.AppConfiguration): xsbti.GlobalLock = app.provider.scalaProvider.launcher.globalLock
|
||||
|
||||
def extractAnalysis[T](a: Attributed[T]): (T, inc.Analysis) =
|
||||
(a.data, a.metadata get Keys.analysis getOrElse inc.Analysis.Empty)
|
||||
def extractAnalysis[T](a: Attributed[T]): (T, Analysis) =
|
||||
(a.data, a.metadata get Keys.analysis getOrElse Analysis.Empty)
|
||||
|
||||
def analysisMap[T](cp: Seq[Attributed[T]]): T => Option[inc.Analysis] =
|
||||
def analysisMap[T](cp: Seq[Attributed[T]]): T => Option[Analysis] =
|
||||
{
|
||||
val m = (for (a <- cp; an <- a.metadata get Keys.analysis) yield (a.data, an)).toMap
|
||||
m.get _
|
||||
|
|
@ -79,7 +78,7 @@ object Defaults extends BuildCommon {
|
|||
|
||||
private[sbt] lazy val globalJvmCore: Seq[Setting[_]] =
|
||||
Seq(
|
||||
compilerCache := state.value get Keys.stateCompilerCache getOrElse compiler.CompilerCache.fresh,
|
||||
compilerCache := state.value get Keys.stateCompilerCache getOrElse CompilerCache.fresh,
|
||||
sourcesInBase :== true,
|
||||
autoAPIMappings := false,
|
||||
apiMappings := Map.empty,
|
||||
|
|
@ -238,7 +237,7 @@ object Defaults extends BuildCommon {
|
|||
|
||||
def compileBase = inTask(console)(compilersSetting :: Nil) ++ compileBaseGlobal ++ Seq(
|
||||
incOptions := incOptions.value.withNewClassfileManager(
|
||||
sbt.inc.ClassfileManager.transactional(crossTarget.value / "classes.bak", sbt.util.Logger.Null)),
|
||||
ClassfileManager.transactional(crossTarget.value / "classes.bak", sbt.util.Logger.Null)),
|
||||
scalaInstance <<= scalaInstanceTask,
|
||||
crossVersion := (if (crossPaths.value) CrossVersion.binary else CrossVersion.Disabled),
|
||||
crossTarget := makeCrossTarget(target.value, scalaBinaryVersion.value, sbtBinaryVersion.value, sbtPlugin.value, crossPaths.value),
|
||||
|
|
@ -502,7 +501,7 @@ object Defaults extends BuildCommon {
|
|||
val stamps = for (a <- ans; f <- a.relations.definesClass(dep)) yield intlStamp(f, a, Set.empty)
|
||||
if (stamps.isEmpty) Long.MinValue else stamps.max
|
||||
}
|
||||
def intlStamp(f: File, analysis: inc.Analysis, s: Set[File]): Long = {
|
||||
def intlStamp(f: File, analysis: Analysis, s: Set[File]): Long = {
|
||||
if (s contains f) Long.MinValue else
|
||||
stamps.getOrElseUpdate(f, {
|
||||
import analysis.{ relations => rel, apis }
|
||||
|
|
@ -822,7 +821,7 @@ object Defaults extends BuildCommon {
|
|||
def mainRunTask = run <<= runTask(fullClasspath in Runtime, mainClass in run, runner in run)
|
||||
def mainRunMainTask = runMain <<= runMainTask(fullClasspath in Runtime, runner in run)
|
||||
|
||||
def discoverMainClasses(analysis: inc.Analysis): Seq[String] =
|
||||
def discoverMainClasses(analysis: Analysis): Seq[String] =
|
||||
Discovery.applications(Tests.allDefs(analysis)).collect({ case (definition, discovered) if discovered.hasMain => definition.name }).sorted
|
||||
|
||||
def consoleProjectTask = (state, streams, initialCommands in consoleProject) map { (state, s, extra) => ConsoleProject(state, extra)(s.log); println() }
|
||||
|
|
@ -833,7 +832,7 @@ object Defaults extends BuildCommon {
|
|||
(cs, cp, options, initCommands, cleanup, temp, si, s) =>
|
||||
val cpFiles = data(cp)
|
||||
val fullcp = (cpFiles ++ si.allJars).distinct
|
||||
val loader = sbt.classpath.ClasspathUtilities.makeLoader(fullcp, si, IO.createUniqueDirectory(temp))
|
||||
val loader = sbt.internal.inc.classpath.ClasspathUtilities.makeLoader(fullcp, si, IO.createUniqueDirectory(temp))
|
||||
val compiler = cs.scalac.onArgs(exported(s, "scala"))
|
||||
(new Console(compiler))(cpFiles, options, loader, initCommands, cleanup)()(s.log).foreach(msg => sys.error(msg))
|
||||
println()
|
||||
|
|
@ -850,7 +849,7 @@ object Defaults extends BuildCommon {
|
|||
@deprecated("Use inTask(compile)(compileInputsSettings)", "0.13.0")
|
||||
def compileTaskSettings: Seq[Setting[_]] = inTask(compile)(compileInputsSettings)
|
||||
|
||||
def compileTask: Initialize[Task[inc.Analysis]] = Def.task {
|
||||
def compileTask: Initialize[Task[Analysis]] = Def.task {
|
||||
val setup: Compiler.IncSetup = compileIncSetup.value
|
||||
// TODO - expose bytecode manipulation phase.
|
||||
val analysisResult: Compiler.CompileResult = manipulateBytecode.value
|
||||
|
|
@ -925,7 +924,7 @@ object Defaults extends BuildCommon {
|
|||
def discoverPlugins: Initialize[Task[Set[String]]] = (compile, sbtPlugin, streams) map { (analysis, isPlugin, s) => if (isPlugin) discoverSbtPlugins(analysis, s.log) else Set.empty }
|
||||
|
||||
@deprecated("Use PluginDiscovery.sourceModuleNames[Plugin].", "0.13.2")
|
||||
def discoverSbtPlugins(analysis: inc.Analysis, log: Logger): Set[String] =
|
||||
def discoverSbtPlugins(analysis: Analysis, log: Logger): Set[String] =
|
||||
PluginDiscovery.sourceModuleNames(analysis, classOf[Plugin].getName).toSet
|
||||
|
||||
def copyResourcesTask =
|
||||
|
|
@ -1572,7 +1571,7 @@ object Classpaths {
|
|||
new RawRepository(new ProjectResolver(ProjectResolver.InterProject, m))
|
||||
}
|
||||
|
||||
def analyzed[T](data: T, analysis: inc.Analysis) = Attributed.blank(data).put(Keys.analysis, analysis)
|
||||
def analyzed[T](data: T, analysis: Analysis) = Attributed.blank(data).put(Keys.analysis, analysis)
|
||||
def makeProducts: Initialize[Task[Seq[File]]] = Def.task {
|
||||
val x1 = compile.value
|
||||
val x2 = copyResources.value
|
||||
|
|
@ -1744,7 +1743,7 @@ object Classpaths {
|
|||
def autoPlugins(report: UpdateReport, internalPluginClasspath: Seq[File]): Seq[String] =
|
||||
{
|
||||
val pluginClasspath = report.matching(configurationFilter(CompilerPlugin.name)) ++ internalPluginClasspath
|
||||
val plugins = classpath.ClasspathUtilities.compilerPlugins(pluginClasspath)
|
||||
val plugins = sbt.internal.inc.classpath.ClasspathUtilities.compilerPlugins(pluginClasspath)
|
||||
plugins.map("-Xplugin:" + _.getAbsolutePath).toSeq
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,9 +8,8 @@ import java.net.URL
|
|||
import scala.concurrent.duration.{ FiniteDuration, Duration }
|
||||
import Def.ScopedKey
|
||||
import sbt.internal.util.complete._
|
||||
import inc.Analysis
|
||||
import inc.Locate.DefinesClass
|
||||
import sbt.compiler.MixedAnalyzingCompiler
|
||||
import sbt.internal.inc.Locate.DefinesClass
|
||||
import sbt.internal.inc.{ Analysis, ClasspathOptions, IncOptions, MixedAnalyzingCompiler, ScalaInstance }
|
||||
import std.TaskExtra._
|
||||
import xsbti.compile.{ CompileOrder, GlobalsCache }
|
||||
import scala.xml.{ Node => XNode, NodeSeq }
|
||||
|
|
@ -104,7 +103,7 @@ object Keys {
|
|||
// Command keys
|
||||
val historyPath = SettingKey(BasicKeys.historyPath)
|
||||
val shellPrompt = SettingKey(BasicKeys.shellPrompt)
|
||||
val analysis = AttributeKey[inc.Analysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.", DSetting)
|
||||
val analysis = AttributeKey[Analysis]("analysis", "Analysis of compilation, including dependencies and generated outputs.", DSetting)
|
||||
val watch = SettingKey(BasicKeys.watch)
|
||||
val pollInterval = SettingKey[Int]("poll-interval", "Interval between checks for modified sources by the continuous execution command.", BMinusSetting)
|
||||
val watchSources = TaskKey[Seq[File]]("watch-sources", "Defines the sources in this project for continuous execution to watch for changes.", BMinusSetting)
|
||||
|
|
@ -162,7 +161,7 @@ object Keys {
|
|||
val maxErrors = SettingKey[Int]("max-errors", "The maximum number of errors, such as compile errors, to list.", ASetting)
|
||||
val scalacOptions = TaskKey[Seq[String]]("scalac-options", "Options for the Scala compiler.", BPlusTask)
|
||||
val javacOptions = TaskKey[Seq[String]]("javac-options", "Options for the Java compiler.", BPlusTask)
|
||||
val incOptions = TaskKey[sbt.inc.IncOptions]("inc-options", "Options for the incremental compiler.", BTask)
|
||||
val incOptions = TaskKey[IncOptions]("inc-options", "Options for the incremental compiler.", BTask)
|
||||
val compileOrder = SettingKey[CompileOrder]("compile-order", "Configures the order in which Java and sources within a single compilation are compiled. Valid values are: JavaThenScala, ScalaThenJava, or Mixed.", BPlusSetting)
|
||||
val initialCommands = SettingKey[String]("initial-commands", "Initial commands to execute when starting up the Scala interpreter.", AMinusSetting)
|
||||
val cleanupCommands = SettingKey[String]("cleanup-commands", "Commands to execute before the Scala interpreter exits.", BMinusSetting)
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ import sbt.internal.librarymanagement.{ InlineIvyConfiguration, IvyPaths }
|
|||
import java.io.File
|
||||
import java.net.{ URI, URL }
|
||||
import compiler.{ Eval, EvalImports }
|
||||
import classpath.ClasspathUtilities
|
||||
import scala.annotation.tailrec
|
||||
import collection.mutable
|
||||
import Compiler.Compilers
|
||||
import inc.{ FileValueCache, Locate }
|
||||
import sbt.internal.inc.{ Analysis, ClasspathOptions, FileValueCache, Locate, ModuleUtilities }
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
import Project.{ inScope, makeSettings }
|
||||
import Def.{ isDummy, ScopedKey, ScopeLocal, Setting }
|
||||
import Keys.{ appConfiguration, baseDirectory, configuration, fullResolvers, fullClasspath, pluginData, streams, thisProject, thisProjectRef, update }
|
||||
|
|
@ -872,13 +872,13 @@ object Load {
|
|||
ModuleUtilities.getCheckedObject[Plugin](pluginName, loader)
|
||||
|
||||
@deprecated("No longer used.", "0.13.2")
|
||||
def findPlugins(analysis: inc.Analysis): Seq[String] = discover(analysis, "sbt.Plugin")
|
||||
def findPlugins(analysis: Analysis): Seq[String] = discover(analysis, "sbt.Plugin")
|
||||
|
||||
@deprecated("No longer used.", "0.13.2")
|
||||
def findDefinitions(analysis: inc.Analysis): Seq[String] = discover(analysis, "sbt.Build")
|
||||
def findDefinitions(analysis: Analysis): Seq[String] = discover(analysis, "sbt.Build")
|
||||
|
||||
@deprecated("Use PluginDiscovery.sourceModuleNames", "0.13.2")
|
||||
def discover(analysis: inc.Analysis, subclasses: String*): Seq[String] =
|
||||
def discover(analysis: Analysis, subclasses: String*): Seq[String] =
|
||||
PluginDiscovery.sourceModuleNames(analysis, subclasses: _*)
|
||||
|
||||
def initialSession(structure: sbt.BuildStructure, rootEval: () => Eval, s: State): SessionSettings = {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import sbt.internal.util.{ AttributeKey, AttributeMap, complete, ConsoleOut, Glo
|
|||
import sbt.util.{ Level, Logger }
|
||||
|
||||
import complete.{ DefaultParsers, Parser }
|
||||
import compiler.{ CompilerCache, EvalImports }
|
||||
import sbt.internal.inc.{ CompilerCache, ScalaInstance }
|
||||
import sbt.compiler.EvalImports
|
||||
import Types.{ const, idFun }
|
||||
import Aggregation.AnyKeys
|
||||
import Project.LoadAction
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import java.net.URL
|
|||
import Attributed.data
|
||||
import Build.analyzed
|
||||
import xsbt.api.{ Discovered, Discovery }
|
||||
import sbt.internal.inc.{ Analysis, ModuleUtilities }
|
||||
|
||||
import sbt.io.IO
|
||||
|
||||
|
|
@ -47,7 +48,7 @@ object PluginDiscovery {
|
|||
}
|
||||
|
||||
/** Discovers the sbt-plugin-related top-level modules from the provided source `analysis`. */
|
||||
def discoverSourceAll(analysis: inc.Analysis): DiscoveredNames =
|
||||
def discoverSourceAll(analysis: Analysis): DiscoveredNames =
|
||||
{
|
||||
def discover[T](implicit classTag: reflect.ClassTag[T]): Seq[String] =
|
||||
sourceModuleNames(analysis, classTag.runtimeClass.getName)
|
||||
|
|
@ -91,7 +92,7 @@ object PluginDiscovery {
|
|||
).distinct
|
||||
|
||||
/** Discovers top-level modules in `analysis` that inherit from any of `subclasses`. */
|
||||
def sourceModuleNames(analysis: inc.Analysis, subclasses: String*): Seq[String] =
|
||||
def sourceModuleNames(analysis: Analysis, subclasses: String*): Seq[String] =
|
||||
{
|
||||
val subclassSet = subclasses.toSet
|
||||
val ds = Discovery(subclassSet, Set.empty)(Tests.allDefs(analysis))
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import java.io.File
|
|||
import java.net.{ URL, URLClassLoader }
|
||||
import java.lang.reflect.{ Method, Modifier }
|
||||
import Modifier.{ isPublic, isStatic }
|
||||
import classpath.ClasspathUtilities
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
import sbt.internal.inc.ScalaInstance
|
||||
|
||||
import sbt.io.Path
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ package sbt
|
|||
import Def.Initialize
|
||||
import Keys._
|
||||
import sbt.internal.util.complete.{ Parser, DefaultParsers }
|
||||
import classpath.ClasspathUtilities
|
||||
import sbt.internal.inc.classpath.ClasspathUtilities
|
||||
import sbt.internal.inc.ModuleUtilities
|
||||
import java.lang.reflect.{ InvocationTargetException, Method }
|
||||
import java.util.Properties
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import java.io.File
|
|||
import java.net.URLClassLoader
|
||||
import testing.{ Logger => TLogger, Task => TestTask, _ }
|
||||
import org.scalatools.testing.{ Framework => OldFramework }
|
||||
import classpath.{ ClasspathUtilities, DualLoader, FilteredLoader }
|
||||
import sbt.internal.inc.classpath.{ ClasspathUtilities, DualLoader, FilteredLoader }
|
||||
import sbt.internal.inc.ScalaInstance
|
||||
import scala.annotation.tailrec
|
||||
import sbt.util.Logger
|
||||
import sbt.io.IO
|
||||
|
|
|
|||
Loading…
Reference in New Issue