From 3f590d8e1388c2077d0a8da2911a6ee30f48a3de Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 11 Apr 2017 13:28:49 +0100 Subject: [PATCH] Drop most remaining deprecations --- main-actions/src/main/scala/sbt/Tests.scala | 5 - .../src/main/scala/sbt/BasicCommands.scala | 2 - main/src/main/scala/sbt/BuildPaths.scala | 6 -- main/src/main/scala/sbt/Defaults.scala | 95 ------------------- main/src/main/scala/sbt/EvaluateTask.scala | 40 -------- main/src/main/scala/sbt/Keys.scala | 14 --- main/src/main/scala/sbt/Main.scala | 18 ---- main/src/main/scala/sbt/MainLoop.scala | 6 -- main/src/main/scala/sbt/Opts.scala | 2 - main/src/main/scala/sbt/internal/Act.scala | 3 - .../main/scala/sbt/internal/Aggregation.scala | 7 +- .../scala/sbt/internal/BuildStructure.scala | 4 - .../main/scala/sbt/internal/BuildUtil.scala | 3 - .../scala/sbt/internal/CommandStrings.scala | 5 - .../sbt/internal/EvaluateConfigurations.scala | 4 - main/src/main/scala/sbt/internal/Load.scala | 44 +-------- main/src/main/scala/sbt/internal/Output.scala | 7 -- 17 files changed, 3 insertions(+), 262 deletions(-) diff --git a/main-actions/src/main/scala/sbt/Tests.scala b/main-actions/src/main/scala/sbt/Tests.scala index 844c1aae6..e178b95b7 100644 --- a/main-actions/src/main/scala/sbt/Tests.scala +++ b/main-actions/src/main/scala/sbt/Tests.scala @@ -311,11 +311,6 @@ object Tests { val mains = discovered collect { case (df, di) if di.hasMain => df.name } (tests, mains.toSet) } - - @deprecated("Tests.showResults() has been superseded with TestResultLogger and setting 'testResultLogger'.", "0.13.5") - def showResults(log: Logger, results: Output, noTestsMessage: => String): Unit = - TestResultLogger.Default.copy(printNoTests = TestResultLogger.const(_ info noTestsMessage)) - .run(log, results, "") } final class TestsFailedException extends RuntimeException("Tests unsuccessful") with FeedbackProvidedException diff --git a/main-command/src/main/scala/sbt/BasicCommands.scala b/main-command/src/main/scala/sbt/BasicCommands.scala index 02df0d640..d1fdf7892 100644 --- a/main-command/src/main/scala/sbt/BasicCommands.scala +++ b/main-command/src/main/scala/sbt/BasicCommands.scala @@ -61,8 +61,6 @@ object BasicCommands { System.out.println(message) s } - @deprecated("Use Help.moreMessage", "0.13.0") - def moreHelp(more: Seq[String]): String = Help.moreMessage(more) def completionsCommand = Command.make(CompletionsCommand, CompletionsBrief, CompletionsDetailed)(completionsParser) def completionsParser(state: State) = diff --git a/main/src/main/scala/sbt/BuildPaths.scala b/main/src/main/scala/sbt/BuildPaths.scala index a187d01c4..cc9bfb43f 100644 --- a/main/src/main/scala/sbt/BuildPaths.scala +++ b/main/src/main/scala/sbt/BuildPaths.scala @@ -8,7 +8,6 @@ import KeyRanks.DSetting import sbt.io.{ GlobFilter, Path } import sbt.internal.util.AttributeKey -import sbt.util.Logger object BuildPaths { val globalBaseDirectory = AttributeKey[File]("global-base-directory", "The base directory for global sbt configuration and staging.", DSetting) @@ -73,11 +72,6 @@ object BuildPaths { def projectStandard(base: File) = base / "project" - @deprecated("Use projectStandard. The alternative project directory location has been removed.", "0.13.0") - def projectHidden(base: File) = projectStandard(base) - @deprecated("Use projectStandard. The alternative project directory location has been removed.", "0.13.0") - def selectProjectDir(base: File, log: Logger) = projectStandard(base) - final val PluginsDirectoryName = "plugins" final val DefaultTargetName = "target" final val ConfigDirectoryName = ".sbt" diff --git a/main/src/main/scala/sbt/Defaults.scala b/main/src/main/scala/sbt/Defaults.scala index 4a7bd4644..be611c96a 100755 --- a/main/src/main/scala/sbt/Defaults.scala +++ b/main/src/main/scala/sbt/Defaults.scala @@ -382,14 +382,6 @@ object Defaults extends BuildCommon { def generate(generators: SettingKey[Seq[Task[Seq[File]]]]): Initialize[Task[Seq[File]]] = generators { _.join.map(_.flatten) } - @deprecated("Use the new .all() API", "0.13.0") - def inAllConfigurations[T](key: TaskKey[T]): Initialize[Task[Seq[T]]] = (state, thisProjectRef) flatMap { (state, ref) => - val structure = Project structure state - val configurations = Project.getProject(ref, structure).toList.flatMap(_.configurations) - configurations.flatMap { conf => - key in (ref, conf) get structure.data - } join - } def watchTransitiveSourcesTask: Initialize[Task[Seq[File]]] = { import ScopeFilter.Make.{ inDependencies => inDeps, _ } val selectDeps = ScopeFilter(inAggregates(ThisProject) || inDeps(ThisProject)) @@ -425,8 +417,6 @@ object Defaults extends BuildCommon { } } - @deprecated("Use scalaInstanceTask.", "0.13.0") - def scalaInstanceSetting = scalaInstanceTask def scalaInstanceTask: Initialize[Task[ScalaInstance]] = Def.taskDyn { // if this logic changes, ensure that `unmanagedScalaInstanceOnly` and `update` are changed // appropriately to avoid cycles @@ -529,15 +519,6 @@ object Defaults extends BuildCommon { derive(testGrouping := singleTestGroupDefault.value) )) - @deprecated("Doesn't provide for closing the underlying resources.", "0.13.1") - def testLogger(manager: Streams, baseKey: Scoped)(tdef: TestDefinition): Logger = - { - val scope = baseKey.scope - val extra = scope.extra match { case Select(x) => x; case _ => AttributeMap.empty } - val key = ScopedKey(scope.copy(extra = Select(testExtra(extra, tdef))), baseKey.key) - manager(key).log - } - private[this] def closeableTestLogger(manager: Streams, baseKey: Scoped, buffered: Boolean)(tdef: TestDefinition): TestLogger.PerTest = { val scope = baseKey.scope @@ -749,13 +730,6 @@ object Defaults extends BuildCommon { def packageDocMappings = doc map { Path.allSubpaths(_).toSeq } def packageSrcMappings = concatMappings(resourceMappings, sourceMappings) - @deprecated("Use `packageBinMappings` instead", "0.12.0") - def packageBinTask = packageBinMappings - @deprecated("Use `packageDocMappings` instead", "0.12.0") - def packageDocTask = packageDocMappings - @deprecated("Use `packageSrcMappings` instead", "0.12.0") - def packageSrcTask = packageSrcMappings - private type Mappings = Initialize[Task[Seq[(File, String)]]] def concatMappings(as: Mappings, bs: Mappings) = (as zipWith bs)((a, b) => (a, b) map { case (a, b) => a ++ b }) @@ -807,13 +781,6 @@ object Defaults extends BuildCommon { case None => scope :: Nil } - @deprecated("Use `Util.pairID` instead", "0.12.0") - def pairID = Util.pairID - - @deprecated("Use `packageTaskSettings` instead", "0.12.0") - def packageTasks(key: TaskKey[File], mappingsTask: Initialize[Task[Seq[(File, String)]]]) = - packageTaskSettings(key, mappingsTask) - def packageTaskSettings(key: TaskKey[File], mappingsTask: Initialize[Task[Seq[(File, String)]]]) = inTask(key)(Seq( key in TaskGlobal := packageTask.value, @@ -968,9 +935,6 @@ object Defaults extends BuildCommon { def bgStopTask: Initialize[InputTask[Unit]] = foreachJobTask { (manager, handle) => manager.stop(handle) } def bgWaitForTask: Initialize[InputTask[Unit]] = foreachJobTask { (manager, handle) => manager.waitFor(handle) } - @deprecated("Use `docTaskSettings` instead", "0.12.0") - def docSetting(key: TaskKey[File]) = docTaskSettings(key) - def docTaskSettings(key: TaskKey[File] = doc): Seq[Setting[_]] = inTask(key)(Seq( apiMappings ++= { if (autoAPIMappings.value) APIMappings.extract(dependencyClasspath.value, streams.value.log).toMap else Map.empty[File, URL] }, fileInputOptions := Seq("-doc-root-content", "-diagrams-dot-path"), @@ -1041,9 +1005,6 @@ object Defaults extends BuildCommon { finally w.close() // workaround for #937 } - @deprecated("Use inTask(compile)(compileInputsSettings)", "0.13.0") - def compileTaskSettings: Seq[Setting[_]] = inTask(compile)(compileInputsSettings) - def compileTask: Initialize[Task[CompileAnalysis]] = Def.task { val setup: Setup = compileIncSetup.value // TODO - expose bytecode manipulation phase. @@ -1185,39 +1146,6 @@ object Defaults extends BuildCommon { recurse ?? Nil } - @deprecated("Use the new .all() API", "0.13.0") - def inDependencies[T](key: SettingKey[T], default: ProjectRef => T, includeRoot: Boolean = true, classpath: Boolean = true, aggregate: Boolean = false): Initialize[Seq[T]] = - forDependencies[T, T](ref => (key in ref) ?? default(ref), includeRoot, classpath, aggregate) - - @deprecated("Use the new .all() API", "0.13.0") - def forDependencies[T, V](init: ProjectRef => Initialize[V], includeRoot: Boolean = true, classpath: Boolean = true, aggregate: Boolean = false): Initialize[Seq[V]] = - Def.bind((loadedBuild, thisProjectRef).identity) { - case (lb, base) => - transitiveDependencies(base, lb, includeRoot, classpath, aggregate) map init join; - } - - def transitiveDependencies(base: ProjectRef, structure: LoadedBuild, includeRoot: Boolean, classpath: Boolean = true, aggregate: Boolean = false): Seq[ProjectRef] = - { - def tdeps(enabled: Boolean, f: ProjectRef => Seq[ProjectRef]): Seq[ProjectRef] = - { - val full = if (enabled) Dag.topologicalSort(base)(f) else Nil - if (includeRoot) full else full dropRight 1 - } - def fullCp = tdeps(classpath, getDependencies(structure, classpath = true, aggregate = false)) - def fullAgg = tdeps(aggregate, getDependencies(structure, classpath = false, aggregate = true)) - (classpath, aggregate) match { - case (true, true) => (fullCp ++ fullAgg).distinct - case (true, false) => fullCp - case _ => fullAgg - } - } - - def getDependencies(structure: LoadedBuild, classpath: Boolean = true, aggregate: Boolean = false): ProjectRef => Seq[ProjectRef] = - ref => Project.getProject(ref, structure).toList flatMap { p => - (if (classpath) p.dependencies.map(_.project) else Nil) ++ - (if (aggregate) p.aggregate else Nil) - } - val CompletionsID = "completions" def noAggregation: Seq[Scoped] = Seq(run, runMain, bgRun, bgRunMain, console, consoleQuick, consoleProject) @@ -1943,13 +1871,6 @@ object Classpaths { def deliverConfig(outputDirectory: File, status: String = "release", logging: UpdateLogging = UpdateLogging.DownloadOnly) = new DeliverConfiguration(deliverPattern(outputDirectory), status, None, logging) - @deprecated("Previous semantics allowed overwriting cached files, which was unsafe. Please specify overwrite parameter.", "0.13.2") - def publishConfig( - artifacts: Map[Artifact, File], ivyFile: Option[File], checksums: Seq[String], - resolverName: String, logging: UpdateLogging - ): PublishConfiguration = - publishConfig(artifacts, ivyFile, checksums, resolverName, logging, overwrite = true) - def publishConfig( artifacts: Map[Artifact, File], ivyFile: Option[File], checksums: Seq[String], resolverName: String = "local", logging: UpdateLogging = UpdateLogging.DownloadOnly, @@ -2199,12 +2120,6 @@ object Classpaths { def modifyForPlugin(plugin: Boolean, dep: ModuleID): ModuleID = if (plugin) dep.withConfigurations(Some(Provided.name)) else dep - @deprecated("Explicitly specify the organization using the other variant.", "0.13.0") - def autoLibraryDependency(auto: Boolean, plugin: Boolean, version: String): Seq[ModuleID] = - if (auto) - modifyForPlugin(plugin, ScalaArtifacts.libraryDependency(version)) :: Nil - else - Nil def autoLibraryDependency(auto: Boolean, plugin: Boolean, org: String, version: String): Seq[ModuleID] = if (auto) modifyForPlugin(plugin, ModuleID(org, ScalaArtifacts.LibraryID, version)) :: Nil @@ -2233,8 +2148,6 @@ object Classpaths { def findUnmanagedJars(config: Configuration, base: File, filter: FileFilter, excl: FileFilter): Classpath = (base * (filter -- excl) +++ (base / config.name).descendantsExcept(filter, excl)).classpath - @deprecated("Specify the classpath that includes internal dependencies", "0.13.0") - def autoPlugins(report: UpdateReport): Seq[String] = autoPlugins(report, Nil) def autoPlugins(report: UpdateReport, internalPluginClasspath: Seq[File]): Seq[String] = { val pluginClasspath = report.matching(configurationFilter(CompilerPlugin.name)) ++ internalPluginClasspath @@ -2259,14 +2172,6 @@ object Classpaths { } ) - @deprecated("Doesn't properly handle non-standard Scala organizations.", "0.13.0") - def substituteScalaFiles(scalaInstance: ScalaInstance, report: UpdateReport): UpdateReport = - substituteScalaFiles(scalaInstance, ScalaArtifacts.Organization, report) - - @deprecated("Directly provide the jar files per Scala version.", "0.13.0") - def substituteScalaFiles(scalaInstance: ScalaInstance, scalaOrg: String, report: UpdateReport): UpdateReport = - substituteScalaFiles(scalaOrg, report)(const(scalaInstance.allJars)) - def substituteScalaFiles(scalaOrg: String, report: UpdateReport)(scalaJars: String => Seq[File]): UpdateReport = report.substitute { (configuration, module, arts) => if (module.organization == scalaOrg) { diff --git a/main/src/main/scala/sbt/EvaluateTask.scala b/main/src/main/scala/sbt/EvaluateTask.scala index fbedaad30..bed9ee8ee 100644 --- a/main/src/main/scala/sbt/EvaluateTask.scala +++ b/main/src/main/scala/sbt/EvaluateTask.scala @@ -27,9 +27,6 @@ import scala.Console.RED import std.Transform.DummyTaskMap import TaskName._ -@deprecated("Use EvaluateTaskConfig instead.", "0.13.5") -final case class EvaluateConfig(cancelable: Boolean, restrictions: Seq[Tags.Rule], checkCycles: Boolean = false, progress: ExecuteProgress[Task] = EvaluateTask.defaultProgress) - /** * An API that allows you to cancel executing tasks upon some signal. * @@ -108,17 +105,6 @@ sealed trait EvaluateTaskConfig { } object EvaluateTaskConfig { - @deprecated("Use the alternative that specifies minForcegcInterval", "0.13.9") - def apply( - restrictions: Seq[Tags.Rule], - checkCycles: Boolean, - progressReporter: ExecuteProgress[Task], - cancelStrategy: TaskCancellationStrategy, - forceGarbageCollection: Boolean - ): EvaluateTaskConfig = - apply(restrictions, checkCycles, progressReporter, cancelStrategy, forceGarbageCollection, - GCUtil.defaultMinForcegcInterval) - /** Raw constructor for EvaluateTaskConfig. */ def apply( restrictions: Seq[Tags.Rule], @@ -168,32 +154,6 @@ object EvaluateTask { val SystemProcessors = Runtime.getRuntime.availableProcessors - @deprecated("Use extractedTaskConfig.", "0.13.0") - def defaultConfig(state: State): EvaluateConfig = - { - val extracted = Project.extract(state) - extractedConfig(extracted, extracted.structure, state) - } - - @deprecated("Use extractedTaskConfig.", "0.13.0") - def defaultConfig(extracted: Extracted, structure: BuildStructure) = - EvaluateConfig(false, restrictions(extracted, structure), progress = defaultProgress) - - @deprecated("Use other extractedTaskConfig", "0.13.2") - def extractedConfig(extracted: Extracted, structure: BuildStructure): EvaluateConfig = - { - val workers = restrictions(extracted, structure) - val canCancel = cancelable(extracted, structure) - EvaluateConfig(cancelable = canCancel, restrictions = workers, progress = defaultProgress) - } - @deprecated("Use other extractedTaskConfig", "0.13.5") - def extractedConfig(extracted: Extracted, structure: BuildStructure, state: State): EvaluateConfig = - { - val workers = restrictions(extracted, structure) - val canCancel = cancelable(extracted, structure) - val progress = executeProgress(extracted, structure, state) - EvaluateConfig(cancelable = canCancel, restrictions = workers, progress = progress) - } def extractedTaskConfig(extracted: Extracted, structure: BuildStructure, state: State): EvaluateTaskConfig = { val rs = restrictions(extracted, structure) diff --git a/main/src/main/scala/sbt/Keys.scala b/main/src/main/scala/sbt/Keys.scala index 0559fc834..975f576d3 100644 --- a/main/src/main/scala/sbt/Keys.scala +++ b/main/src/main/scala/sbt/Keys.scala @@ -439,13 +439,6 @@ object Keys { val state = Def.stateKey val streamsManager = Def.streamsManagerKey - @deprecated("Implementation detail.", "0.13.1") - val isDummyTask = Def.isDummyTask - @deprecated("Implementation detail.", "0.13.1") - val dummyState = Def.dummyState - @deprecated("Implementation detail.", "0.13.2") - val dummyStreamsManager = Def.dummyStreamsManager - val stateStreams = AttributeKey[Streams]("streams-manager", "Streams manager, which provides streams for different contexts. Setting this on State will override the default Streams implementation.") val resolvedScoped = Def.resolvedScoped val pluginData = TaskKey[PluginData]("plugin-data", "Information from the plugin build needed in the main build definition.", DTask) @@ -464,11 +457,4 @@ object Keys { type Streams = std.Streams[ScopedKey[_]] type TaskStreams = std.TaskStreams[ScopedKey[_]] - - @deprecated("Implementation detail.", "0.13.1") - def dummy[T: Manifest](name: String, description: String): (TaskKey[T], Task[T]) = Def.dummy(name, description) - @deprecated("Implementation detail.", "0.13.1") - def dummyTask[T](name: String): Task[T] = Def.dummyTask(name) - @deprecated("Implementation detail.", "0.13.1") - def isDummy(t: Task[_]): Boolean = Def.isDummy(t) } diff --git a/main/src/main/scala/sbt/Main.scala b/main/src/main/scala/sbt/Main.scala index e1cdbf2b0..cf12acadc 100644 --- a/main/src/main/scala/sbt/Main.scala +++ b/main/src/main/scala/sbt/Main.scala @@ -349,9 +349,6 @@ object BuiltinCommands { s } - @deprecated("Use Inspect.output", "0.13.0") - def inspectOutput(s: State, option: Inspect.Mode, sk: Def.ScopedKey[_]): String = Inspect.output(s, option, sk) - def lastGrep = Command(LastGrepCommand, lastGrepBrief, lastGrepDetailed)(lastGrepParser) { case (s, (pattern, Some(sks))) => val (str, _, display) = extractLast(s) @@ -373,18 +370,6 @@ object BuiltinCommands { SettingCompletions.settingParser(structure.data, structure.index.keyMap, currentProject) } - @deprecated("Use Inspect.parser", "0.13.0") - def inspectParser: State => Parser[(Inspect.Mode, Def.ScopedKey[_])] = Inspect.parser - - @deprecated("Use Inspect.spacedModeParser", "0.13.0") - val spacedModeParser: State => Parser[Inspect.Mode] = Inspect.spacedModeParser - - @deprecated("Use Inspect.allKeyParser", "0.13.0") - def allKeyParser(s: State): Parser[AttributeKey[_]] = Inspect.allKeyParser(s) - - @deprecated("Use Inspect.spacedKeyParser", "0.13.0") - val spacedKeyParser: State => Parser[Def.ScopedKey[_]] = Inspect.spacedKeyParser - val spacedAggregatedParser = (s: State) => Act.requireSession(s, token(Space) ~> Act.aggregatedKeyParser(s)) val aggregatedKeyValueParser: State => Parser[Option[AnyKeys]] = (s: State) => spacedAggregatedParser(s).map(x => Act.keyValues(s)(x)).? @@ -521,9 +506,6 @@ object BuiltinCommands { def loadFailed: Command = Command(LoadFailed)(loadProjectParser)(doLoadFailed) - @deprecated("No longer used.", "0.13.2") - def handleLoadFailed(s: State): State = doLoadFailed(s, "") - @tailrec private[this] def doLoadFailed(s: State, loadArg: String): State = { diff --git a/main/src/main/scala/sbt/MainLoop.scala b/main/src/main/scala/sbt/MainLoop.scala index d4be1d232..7785af3fc 100644 --- a/main/src/main/scala/sbt/MainLoop.scala +++ b/main/src/main/scala/sbt/MainLoop.scala @@ -135,11 +135,5 @@ object MainLoop { newState } - @deprecated("Use State.handleError", "0.13.0") - def handleException(e: Throwable, s: State): State = s.handleError(e) - - @deprecated("Use State.handleError", "0.13.0") - def handleException(t: Throwable, s: State, log: Logger): State = State.handleException(t, s, log) - def logFullException(e: Throwable, log: Logger): Unit = State.logFullException(e, log) } diff --git a/main/src/main/scala/sbt/Opts.scala b/main/src/main/scala/sbt/Opts.scala index 2c53c770d..665871e79 100644 --- a/main/src/main/scala/sbt/Opts.scala +++ b/main/src/main/scala/sbt/Opts.scala @@ -62,8 +62,6 @@ object DefaultOptions { def addResolvers: Setting[_] = Keys.resolvers ++= { resolvers(Keys.isSnapshot.value) } def addPluginResolvers: Setting[_] = Keys.resolvers ++= pluginResolvers(Keys.sbtPlugin.value, Keys.isSnapshot.value) - @deprecated("Use `credentials(State)` instead to make use of configuration path dynamically configured via `Keys.globalSettingsDirectory`; relying on ~/.ivy2 is not recommended anymore.", "0.12.0") - def credentials: Credentials = Credentials(userHome / ".ivy2" / ".credentials") def credentials(state: State): Credentials = Credentials(getGlobalSettingsDirectory(state, getGlobalBase(state)) / ".credentials") def addCredentials: Setting[_] = Keys.credentials += { credentials(Keys.state.value) } diff --git a/main/src/main/scala/sbt/internal/Act.scala b/main/src/main/scala/sbt/internal/Act.scala index 77a337edc..0c15887fe 100644 --- a/main/src/main/scala/sbt/internal/Act.scala +++ b/main/src/main/scala/sbt/internal/Act.scala @@ -280,9 +280,6 @@ object Act { (MultiTaskCommand ^^^ MultiAction)) <~ Space ) ?? SingleAction - @deprecated("No longer used.", "0.13.2") - def showParser = token((ShowCommand ~ Space) ^^^ true) ?? false - def scopedKeyParser(state: State): Parser[ScopedKey[_]] = scopedKeyParser(Project extract state) def scopedKeyParser(extracted: Extracted): Parser[ScopedKey[_]] = scopedKeyParser(extracted.structure, extracted.currentRef) def scopedKeyParser(structure: BuildStructure, currentRef: ProjectRef): Parser[ScopedKey[_]] = diff --git a/main/src/main/scala/sbt/internal/Aggregation.scala b/main/src/main/scala/sbt/internal/Aggregation.scala index f9c538189..7caab888b 100644 --- a/main/src/main/scala/sbt/internal/Aggregation.scala +++ b/main/src/main/scala/sbt/internal/Aggregation.scala @@ -7,9 +7,8 @@ package internal import Def.ScopedKey import Keys.{ showSuccess, showTiming, timingFormat } import sbt.internal.util.complete.Parser -import sbt.internal.util.{ Dag, HList, Relation, Settings, Util } +import sbt.internal.util.{ Dag, HList, Settings, Util } import sbt.util.{ Logger, Show } -import java.net.URI import Parser.{ seq, failure, success } import std.Transform.DummyTaskMap @@ -194,8 +193,4 @@ object Aggregation { def aggregationEnabled(key: ScopedKey[_], data: Settings[Scope]): Boolean = Keys.aggregate in Scope.fillTaskAxis(key.scope, key.key) get data getOrElse true - - @deprecated("Use BuildUtil.aggregationRelation", "0.13.0") - def relation(units: Map[URI, LoadedBuildUnit]): Relation[ProjectRef, ProjectRef] = - BuildUtil.aggregationRelation(units) } diff --git a/main/src/main/scala/sbt/internal/BuildStructure.scala b/main/src/main/scala/sbt/internal/BuildStructure.scala index c39ad10ac..d5449821f 100644 --- a/main/src/main/scala/sbt/internal/BuildStructure.scala +++ b/main/src/main/scala/sbt/internal/BuildStructure.scala @@ -147,10 +147,6 @@ final class DetectedPlugins(val autoPlugins: Seq[DetectedAutoPlugin], val builds else None }.partition(nonTopLevelPlugin) - /** A function to select the right [[AutoPlugin]]s from [[autoPlugins]] for a [[Project]]. */ - @deprecated("Use deducePluginsFromProject", "0.13.8") - lazy val deducePlugins: (Plugins, Logger) => Seq[AutoPlugin] = Plugins.deducer(autoPlugins.toList map { _.value }) - /** Selects the right [[AutoPlugin]]s from a [[Project]]. */ def deducePluginsFromProject(p: Project, log: Logger): Seq[AutoPlugin] = { diff --git a/main/src/main/scala/sbt/internal/BuildUtil.scala b/main/src/main/scala/sbt/internal/BuildUtil.scala index e6f293520..32a284ae3 100644 --- a/main/src/main/scala/sbt/internal/BuildUtil.scala +++ b/main/src/main/scala/sbt/internal/BuildUtil.scala @@ -76,9 +76,6 @@ object BuildUtil { def getImports(unit: BuildUnit): Seq[String] = unit.plugins.detected.imports ++ unit.definitions.dslDefinitions.imports - @deprecated("Use getImports(Seq[String]).", "0.13.2") - def getImports(pluginNames: Seq[String], buildNames: Seq[String]): Seq[String] = getImports(pluginNames ++ buildNames) - /** `import sbt._, Keys._`, and wildcard import `._` for all names. */ def getImports(names: Seq[String]): Seq[String] = baseImports ++ importAllRoot(names) diff --git a/main/src/main/scala/sbt/internal/CommandStrings.scala b/main/src/main/scala/sbt/internal/CommandStrings.scala index 0f6ed2a0f..d061f296e 100644 --- a/main/src/main/scala/sbt/internal/CommandStrings.scala +++ b/main/src/main/scala/sbt/internal/CommandStrings.scala @@ -24,11 +24,6 @@ object CommandStrings { Evaluates the given Scala expression and prints the result and type.""" - @deprecated("Misnomer: was only for `show`. Use showBrief.", "0.13.2") - def actBrief = showBrief - @deprecated("Misnomer: was only for `show`. Use showDetailed.", "0.13.2") - def actDetailed = showDetailed - def actHelp = showHelp ++ multiTaskHelp def multiTaskHelp = Help(MultiTaskCommand, (multiTaskSyntax, multiTaskBrief), multiTaskDetailed) diff --git a/main/src/main/scala/sbt/internal/EvaluateConfigurations.scala b/main/src/main/scala/sbt/internal/EvaluateConfigurations.scala index 3341dc179..be9800db2 100644 --- a/main/src/main/scala/sbt/internal/EvaluateConfigurations.scala +++ b/main/src/main/scala/sbt/internal/EvaluateConfigurations.scala @@ -143,10 +143,6 @@ private[sbt] object EvaluateConfigurations { /** move a project to be relative to this file after we've evaluated it. */ private[this] def resolveBase(f: File, p: Project) = p.copy(base = IO.resolve(f, p.base)) - @deprecated("Will no longer be public.", "0.13.6") - def flatten(mksettings: Seq[ClassLoader => Seq[Setting[_]]]): ClassLoader => Seq[Setting[_]] = - loader => mksettings.flatMap(_ apply loader) - def addOffset(offset: Int, lines: Seq[(String, Int)]): Seq[(String, Int)] = lines.map { case (s, i) => (s, i + offset) } diff --git a/main/src/main/scala/sbt/internal/Load.scala b/main/src/main/scala/sbt/internal/Load.scala index 829c9732e..5556c9c93 100755 --- a/main/src/main/scala/sbt/internal/Load.scala +++ b/main/src/main/scala/sbt/internal/Load.scala @@ -8,11 +8,11 @@ import sbt.librarymanagement.{ Configuration, Configurations, Resolver, UpdateOp import sbt.internal.librarymanagement.{ DefaultFileToStore, InlineIvyConfiguration, IvyPaths } import java.io.File -import java.net.{ URI, URL } +import java.net.URI import compiler.Eval import scala.annotation.tailrec import collection.mutable -import sbt.internal.inc.{ Analysis, ClasspathOptionsUtil, ModuleUtilities } +import sbt.internal.inc.ClasspathOptionsUtil import sbt.internal.inc.classpath.ClasspathUtilities import Project.inScope import Def.{ isDummy, ScopedKey, ScopeLocal, Setting } @@ -322,11 +322,6 @@ private[sbt] object Load { } } - @deprecated("This method is no longer used", "0.13.6") - def configurations(srcs: Seq[File], eval: () => Eval, imports: Seq[String]): ClassLoader => LoadedSbtFile = - if (srcs.isEmpty) const(LoadedSbtFile.empty) - else EvaluateConfigurations(eval(), srcs, imports) - def load(file: File, s: State, config: LoadBuildConfiguration): PartBuild = load(file, builtinLoader(s, config.copy(pluginManagement = config.pluginManagement.shift, extraBuilds = Nil)), config.extraBuilds.toList) @@ -931,28 +926,9 @@ private[sbt] object Load { config.evalPluginDef(Project.structure(pluginState), pluginState) } - @deprecated("Use ModuleUtilities.getCheckedObjects[BuildDef].", "0.13.2") - def loadDefinitions(loader: ClassLoader, defs: Seq[String]): Seq[BuildDef] = - defs map { definition => loadDefinition(loader, definition) } - - @deprecated("Use ModuleUtilities.getCheckedObject[BuildDef].", "0.13.2") - def loadDefinition(loader: ClassLoader, definition: String): BuildDef = - ModuleUtilities.getObject(definition, loader).asInstanceOf[BuildDef] - def loadPlugins(dir: File, data: PluginData, loader: ClassLoader): LoadedPlugins = new LoadedPlugins(dir, data, loader, PluginDiscovery.discoverAll(data, loader)) - @deprecated("Use PluginDiscovery.onClasspath", "0.13.2") - def onClasspath(classpath: Seq[File])(url: URL): Boolean = - PluginDiscovery.onClasspath(classpath)(url) - - @deprecated("No longer used.", "0.13.2") - def findDefinitions(analysis: Analysis): Seq[String] = discover(analysis, "sbt.internal.BuildDef") - - @deprecated("Use PluginDiscovery.sourceModuleNames", "0.13.2") - def discover(analysis: Analysis, subclasses: String*): Seq[String] = - PluginDiscovery.sourceModuleNames(analysis, subclasses: _*) - def initialSession(structure: BuildStructure, rootEval: () => Eval, s: State): SessionSettings = { val session = s get Keys.sessionSettings val currentProject = session map (_.currentProject) getOrElse Map.empty @@ -977,19 +953,6 @@ private[sbt] object Load { def defaultEvalOptions: Seq[String] = Nil - @deprecated("Use BuildUtil.baseImports", "0.13.0") - def baseImports = BuildUtil.baseImports - @deprecated("Use BuildUtil.checkCycles", "0.13.0") - def checkCycles(units: Map[URI, LoadedBuildUnit]): Unit = BuildUtil.checkCycles(units) - @deprecated("Use BuildUtil.importAll", "0.13.0") - def importAll(values: Seq[String]): Seq[String] = BuildUtil.importAll(values) - @deprecated("Use BuildUtil.importAllRoot", "0.13.0") - def importAllRoot(values: Seq[String]): Seq[String] = BuildUtil.importAllRoot(values) - @deprecated("Use BuildUtil.rootedNames", "0.13.0") - def rootedName(s: String): String = BuildUtil.rootedName(s) - @deprecated("Use BuildUtil.getImports", "0.13.0") - def getImports(unit: BuildUnit): Seq[String] = BuildUtil.getImports(unit) - def referenced[PR <: ProjectReference](definitions: Seq[ProjectDefinition[PR]]): Seq[PR] = definitions flatMap { _.referenced } final class EvaluatedConfigurations(val eval: Eval, val settings: Seq[Setting[_]]) @@ -1013,9 +976,6 @@ private[sbt] object Load { } } - @deprecated("Use BuildUtil.apply", "0.13.0") - def buildUtil(root: URI, units: Map[URI, LoadedBuildUnit], keyIndex: KeyIndex, data: Settings[Scope]): BuildUtil[ResolvedProject] = BuildUtil(root, units, keyIndex, data) - /** Debugging method to time how long it takes to run various compilation tasks. */ private[sbt] def timed[T](label: String, log: Logger)(t: => T): T = { val start = System.nanoTime diff --git a/main/src/main/scala/sbt/internal/Output.scala b/main/src/main/scala/sbt/internal/Output.scala index 77582384e..6adb51b2f 100644 --- a/main/src/main/scala/sbt/internal/Output.scala +++ b/main/src/main/scala/sbt/internal/Output.scala @@ -20,10 +20,6 @@ import sbt.io.IO object Output { final val DefaultTail = "> " - @deprecated("Explicitly provide None for the stream ID.", "0.13.0") - def last(keys: Values[_], streams: Streams, printLines: Seq[String] => Unit)(implicit display: Show[ScopedKey[_]]): Unit = - last(keys, streams, printLines, None)(display) - def last(keys: Values[_], streams: Streams, printLines: Seq[String] => Unit, sid: Option[String])(implicit display: Show[ScopedKey[_]]): Unit = printLines(flatLines(lastLines(keys, streams, sid))(idFun)) @@ -57,9 +53,6 @@ object Output { outputs.filterNot(_.value.isEmpty) } - @deprecated("Explicitly provide None for the stream ID.", "0.13.0") - def lastLines(key: ScopedKey[_], mgr: Streams): Seq[String] = lastLines(key, mgr, None) - def lastLines(key: ScopedKey[_], mgr: Streams, sid: Option[String]): Seq[String] = mgr.use(key) { s => // Workaround for #1155 - Keys.streams are always scoped by the task they're included in