Rename StampedFile to Stamped

This commit is contained in:
Ethan Atkins
2019-02-02 12:22:57 -08:00
parent d39bb96c41
commit 0bdc30b60b
10 changed files with 53 additions and 53 deletions
+1 -1
View File
@@ -274,7 +274,7 @@ object Defaults extends BuildCommon {
fileTreeViewConfig := FileManagement.defaultFileTreeView.value,
fileTreeView := state.value
.get(BasicKeys.globalFileTreeView)
.getOrElse(FileTreeView.DEFAULT.asDataView(StampedFile.converter)),
.getOrElse(FileTreeView.DEFAULT.asDataView(Stamped.converter)),
externalHooks := {
val view = fileTreeView.value
compileOptions =>
+2 -2
View File
@@ -93,14 +93,14 @@ object Keys {
@deprecated("This is no longer used for continuous execution", "1.3.0")
val watch = SettingKey(BasicKeys.watch)
val suppressSbtShellNotification = settingKey[Boolean]("""True to suppress the "Executing in batch mode.." message.""").withRank(CSetting)
val fileTreeView = taskKey[FileTreeDataView[StampedFile]]("A view of the file system")
val fileTreeView = taskKey[FileTreeDataView[Stamped]]("A view of the file system")
val pollInterval = settingKey[FiniteDuration]("Interval between checks for modified sources by the continuous execution command.").withRank(BMinusSetting)
val pollingDirectories = settingKey[Seq[Watched.WatchSource]]("Directories that cannot be cached and must always be rescanned. Typically these will be NFS mounted or something similar.").withRank(DSetting)
val watchAntiEntropy = settingKey[FiniteDuration]("Duration for which the watch EventMonitor will ignore events for a file after that file has triggered a build.").withRank(BMinusSetting)
val watchConfig = taskKey[WatchConfig]("The configuration for continuous execution.").withRank(BMinusSetting)
val watchLogger = taskKey[Logger]("A logger that reports watch events.").withRank(DSetting)
val watchHandleInput = settingKey[InputStream => Watched.Action]("Function that is periodically invoked to determine if the continous build should be stopped or if a build should be triggered. It will usually read from stdin to respond to user commands.").withRank(BMinusSetting)
val watchOnEvent = taskKey[Event[StampedFile] => Watched.Action]("Determines how to handle a file event").withRank(BMinusSetting)
val watchOnEvent = taskKey[Event[Stamped] => Watched.Action]("Determines how to handle a file event").withRank(BMinusSetting)
val watchOnTermination = taskKey[(Watched.Action, String, State) => State]("Transforms the input state after the continuous build completes.").withRank(BMinusSetting)
val watchService = settingKey[() => WatchService]("Service to use to monitor file system changes.").withRank(BMinusSetting)
val watchProjectSources = taskKey[Seq[Watched.WatchSource]]("Defines the sources for the sbt meta project to watch to trigger a reload.").withRank(CSetting)
+1 -1
View File
@@ -862,7 +862,7 @@ object BuiltinCommands {
()
}
val (_, config: FileTreeViewConfig) = extracted.runTask(Keys.fileTreeViewConfig, s)
val view: FileTreeDataView[StampedFile] = config.newDataView()
val view: FileTreeDataView[Stamped] = config.newDataView()
val newState = s.addExitHook(cleanup())
cleanup()
newState
@@ -9,7 +9,7 @@ package sbt.internal
import java.nio.file.Paths
import java.util.Optional
import sbt.StampedFile
import sbt.Stamped
import sbt.internal.inc.ExternalLookup
import sbt.io.syntax.File
import sbt.io.{ FileTreeRepository, FileTreeDataView, TypedPath }
@@ -20,17 +20,17 @@ import scala.collection.mutable
private[sbt] object ExternalHooks {
private val javaHome = Option(System.getProperty("java.home")).map(Paths.get(_))
def apply(options: CompileOptions, view: FileTreeDataView[StampedFile]): DefaultExternalHooks = {
def apply(options: CompileOptions, view: FileTreeDataView[Stamped]): DefaultExternalHooks = {
import scala.collection.JavaConverters._
val sources = options.sources()
val cachedSources = new java.util.HashMap[File, Stamp]
val converter: File => Stamp = f => StampedFile.sourceConverter(TypedPath(f.toPath)).stamp
val converter: File => Stamp = f => Stamped.sourceConverter(TypedPath(f.toPath)).stamp
sources.foreach {
case sf: StampedFile => cachedSources.put(sf, sf.stamp)
case f: File => cachedSources.put(f, converter(f))
case sf: Stamped => cachedSources.put(sf, sf.stamp)
case f: File => cachedSources.put(f, converter(f))
}
view match {
case r: FileTreeRepository[StampedFile] =>
case r: FileTreeRepository[Stamped] =>
r.register(options.classesDirectory.toPath, Integer.MAX_VALUE)
options.classpath.foreach { f =>
r.register(f.toPath, Integer.MAX_VALUE)
@@ -51,7 +51,7 @@ private[sbt] object FileManagement {
val view = fileTreeView.value
val include = filter.toTask.value
val ex = excludes.toTask.value
val sourceFilter: Entry[StampedFile] => Boolean = (entry: Entry[StampedFile]) => {
val sourceFilter: Entry[Stamped] => Boolean = (entry: Entry[Stamped]) => {
entry.value match {
case Right(sf) => include.accept(sf) && !ex.accept(sf)
case _ => false