mirror of https://github.com/sbt/sbt.git
Deprecation cleanup
The main project emits a number of deprecation warnings. I've isolated the deprecation warnings related to Watch to the DeprecatedContinuous file. I fixed the deprecation warnings where it was straightforward to do so. After this change, there are three non-watch related changes emitted: 1) Defaults.scala:3760 uses the deprecated InputTask.apply. This seems fixable but I'm not in a hurry 2) oldLoadFailed and oldLastGrep are used by Main. I think this could just be fixed by removing the deprecation warnings and setting them private[sbt] since they will still be available in the shell.
This commit is contained in:
parent
b15b638632
commit
2ab8fed8fd
|
|
@ -651,10 +651,8 @@ object Defaults extends BuildCommon {
|
||||||
cleanKeepGlobs := historyPath.value.map(_.toGlob).toSeq,
|
cleanKeepGlobs := historyPath.value.map(_.toGlob).toSeq,
|
||||||
clean := Def.taskDyn(Clean.task(resolvedScoped.value.scope, full = true)).value,
|
clean := Def.taskDyn(Clean.task(resolvedScoped.value.scope, full = true)).value,
|
||||||
consoleProject := consoleProjectTask.value,
|
consoleProject := consoleProjectTask.value,
|
||||||
watchTransitiveSources := watchTransitiveSourcesTask.value,
|
|
||||||
watch := watchSetting.value,
|
|
||||||
transitiveDynamicInputs := SettingsGraph.task.value,
|
transitiveDynamicInputs := SettingsGraph.task.value,
|
||||||
)
|
) ++ sbt.internal.DeprecatedContinuous.taskDefinitions
|
||||||
|
|
||||||
def generate(generators: SettingKey[Seq[Task[Seq[File]]]]): Initialize[Task[Seq[File]]] =
|
def generate(generators: SettingKey[Seq[Task[Seq[File]]]]): Initialize[Task[Seq[File]]] =
|
||||||
generators { _.join.map(_.flatten) }
|
generators { _.join.map(_.flatten) }
|
||||||
|
|
@ -2574,16 +2572,16 @@ object Classpaths {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ivyConfiguration := InlineIvyConfiguration(
|
ivyConfiguration := InlineIvyConfiguration(
|
||||||
paths = ivyPaths.value,
|
lock = Option(lock(appConfiguration.value)),
|
||||||
|
log = Option(streams.value.log),
|
||||||
|
updateOptions = UpdateOptions(),
|
||||||
|
paths = Option(ivyPaths.value),
|
||||||
resolvers = externalResolvers.value.toVector,
|
resolvers = externalResolvers.value.toVector,
|
||||||
otherResolvers = Vector.empty,
|
otherResolvers = Vector.empty,
|
||||||
moduleConfigurations = Vector.empty,
|
moduleConfigurations = Vector.empty,
|
||||||
lock = Option(lock(appConfiguration.value)),
|
|
||||||
checksums = checksums.value.toVector,
|
checksums = checksums.value.toVector,
|
||||||
managedChecksums = false,
|
managedChecksums = false,
|
||||||
resolutionCacheDir = Some(crossTarget.value / "resolution-cache"),
|
resolutionCacheDir = Some(crossTarget.value / "resolution-cache"),
|
||||||
updateOptions = UpdateOptions(),
|
|
||||||
log = streams.value.log
|
|
||||||
),
|
),
|
||||||
ivySbt := ivySbt0.value,
|
ivySbt := ivySbt0.value,
|
||||||
classifiersModule := classifiersModuleTask.value,
|
classifiersModule := classifiersModuleTask.value,
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ final class xMain extends xsbti.AppMain {
|
||||||
override def scalaProvider(): ScalaProvider = appProvider.scalaProvider
|
override def scalaProvider(): ScalaProvider = appProvider.scalaProvider
|
||||||
override def id(): xsbti.ApplicationID = appProvider.id()
|
override def id(): xsbti.ApplicationID = appProvider.id()
|
||||||
override def loader(): ClassLoader = metaLoader
|
override def loader(): ClassLoader = metaLoader
|
||||||
|
@deprecated("Implements deprecated api", "1.3.0")
|
||||||
override def mainClass(): Class[_ <: AppMain] = appProvider.mainClass()
|
override def mainClass(): Class[_ <: AppMain] = appProvider.mainClass()
|
||||||
override def entryPoint(): Class[_] = appProvider.entryPoint()
|
override def entryPoint(): Class[_] = appProvider.entryPoint()
|
||||||
override def newMain(): AppMain = appProvider.newMain()
|
override def newMain(): AppMain = appProvider.newMain()
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import Keys.{
|
||||||
serverConnectionType,
|
serverConnectionType,
|
||||||
fullServerHandlers,
|
fullServerHandlers,
|
||||||
logLevel,
|
logLevel,
|
||||||
watch
|
|
||||||
}
|
}
|
||||||
import Scope.{ Global, ThisScope }
|
import Scope.{ Global, ThisScope }
|
||||||
import Def.{ Flattened, Initialize, ScopedKey, Setting }
|
import Def.{ Flattened, Initialize, ScopedKey, Setting }
|
||||||
|
|
@ -509,7 +508,6 @@ object Project extends ProjectExtra {
|
||||||
val history = get(historyPath) flatMap idFun
|
val history = get(historyPath) flatMap idFun
|
||||||
val prompt = get(shellPrompt)
|
val prompt = get(shellPrompt)
|
||||||
val trs = (templateResolverInfos in Global get structure.data).toList.flatten
|
val trs = (templateResolverInfos in Global get structure.data).toList.flatten
|
||||||
val watched = get(watch)
|
|
||||||
val startSvr: Option[Boolean] = get(autoStartServer)
|
val startSvr: Option[Boolean] = get(autoStartServer)
|
||||||
val host: Option[String] = get(serverHost)
|
val host: Option[String] = get(serverHost)
|
||||||
val port: Option[Int] = get(serverPort)
|
val port: Option[Int] = get(serverPort)
|
||||||
|
|
@ -524,7 +522,6 @@ object Project extends ProjectExtra {
|
||||||
)
|
)
|
||||||
val newAttrs =
|
val newAttrs =
|
||||||
s.attributes
|
s.attributes
|
||||||
.setCond(Watched.Configuration, watched)
|
|
||||||
.put(historyPath.key, history)
|
.put(historyPath.key, history)
|
||||||
.setCond(autoStartServer.key, startSvr)
|
.setCond(autoStartServer.key, startSvr)
|
||||||
.setCond(serverPort.key, port)
|
.setCond(serverPort.key, port)
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,9 @@ private[internal] trait DeprecatedContinuous {
|
||||||
protected val deprecatedWatchingMessage = sbt.Keys.watchingMessage
|
protected val deprecatedWatchingMessage = sbt.Keys.watchingMessage
|
||||||
protected val deprecatedTriggeredMessage = sbt.Keys.triggeredMessage
|
protected val deprecatedTriggeredMessage = sbt.Keys.triggeredMessage
|
||||||
}
|
}
|
||||||
|
private[sbt] object DeprecatedContinuous {
|
||||||
|
private[sbt] val taskDefinitions = Seq(
|
||||||
|
sbt.Keys.watchTransitiveSources := sbt.Defaults.watchTransitiveSourcesTask.value,
|
||||||
|
sbt.Keys.watch := sbt.Defaults.watchSetting.value,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ object IvyConsole {
|
||||||
depSettings
|
depSettings
|
||||||
)
|
)
|
||||||
|
|
||||||
val newStructure = Load.reapply(session.original ++ append, structure, state.log)
|
val newStructure = Load.reapply(session.original ++ append, structure)
|
||||||
val newState = state.copy(remainingCommands = Exec(Keys.consoleQuick.key.label, None) :: Nil)
|
val newState = state.copy(remainingCommands = Exec(Keys.consoleQuick.key.label, None) :: Nil)
|
||||||
Project.setProject(session, newStructure, newState)
|
Project.setProject(session, newStructure, newState)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,20 @@ import org.apache.logging.log4j.core.{ LogEvent => XLogEvent }
|
||||||
import org.apache.logging.log4j.core.appender.AbstractAppender
|
import org.apache.logging.log4j.core.appender.AbstractAppender
|
||||||
import org.apache.logging.log4j.core.layout.PatternLayout
|
import org.apache.logging.log4j.core.layout.PatternLayout
|
||||||
import org.apache.logging.log4j.core.async.RingBufferLogEvent
|
import org.apache.logging.log4j.core.async.RingBufferLogEvent
|
||||||
|
import org.apache.logging.log4j.core.config.Property
|
||||||
import sbt.util.Level
|
import sbt.util.Level
|
||||||
import sbt.internal.util._
|
import sbt.internal.util._
|
||||||
import sbt.protocol.LogEvent
|
import sbt.protocol.LogEvent
|
||||||
import sbt.internal.util.codec._
|
import sbt.internal.util.codec._
|
||||||
|
|
||||||
class RelayAppender(name: String)
|
class RelayAppender(name: String)
|
||||||
extends AbstractAppender(name, null, PatternLayout.createDefaultLayout(), true) {
|
extends AbstractAppender(
|
||||||
|
name,
|
||||||
|
null,
|
||||||
|
PatternLayout.createDefaultLayout(),
|
||||||
|
true,
|
||||||
|
Property.EMPTY_ARRAY
|
||||||
|
) {
|
||||||
lazy val exchange = StandardMain.exchange
|
lazy val exchange = StandardMain.exchange
|
||||||
|
|
||||||
def append(event: XLogEvent): Unit = {
|
def append(event: XLogEvent): Unit = {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue