mirror of https://github.com/sbt/sbt.git
Merge pull request #3816 from eed3si9n/wip/bump
Convert lastModified() calls to the more precise getModifiedTime() + modules bump
This commit is contained in:
commit
e40ab026c0
|
|
@ -485,7 +485,11 @@ private[sbt] object Eval {
|
|||
def filesModifiedBytes(fs: Array[File]): Array[Byte] =
|
||||
if (fs eq null) filesModifiedBytes(Array[File]()) else seqBytes(fs)(fileModifiedBytes)
|
||||
def fileModifiedBytes(f: File): Array[Byte] =
|
||||
(if (f.isDirectory) filesModifiedBytes(f listFiles classDirFilter) else bytes(f.lastModified)) ++
|
||||
(if (f.isDirectory) filesModifiedBytes(f listFiles classDirFilter)
|
||||
else
|
||||
bytes(
|
||||
try IO.getModifiedTime(f)
|
||||
catch { case _: java.io.FileNotFoundException => 0L })) ++
|
||||
bytes(f.getAbsolutePath)
|
||||
def fileExistsBytes(f: File): Array[Byte] =
|
||||
bytes(f.exists) ++
|
||||
|
|
|
|||
|
|
@ -2315,7 +2315,7 @@ object Classpaths {
|
|||
case Some(period) =>
|
||||
val fullUpdateOutput = cacheDirectory / "out"
|
||||
val now = System.currentTimeMillis
|
||||
val diff = now - fullUpdateOutput.lastModified()
|
||||
val diff = now - IO.getModifiedTime(fullUpdateOutput)
|
||||
val elapsedDuration = new FiniteDuration(diff, TimeUnit.MILLISECONDS)
|
||||
fullUpdateOutput.exists() && elapsedDuration > period
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import sbt.internal.librarymanagement._
|
|||
import sbt.librarymanagement._
|
||||
import sbt.librarymanagement.syntax._
|
||||
import sbt.util.{ CacheStore, CacheStoreFactory, Logger, Tracked }
|
||||
import sbt.io.IO
|
||||
|
||||
private[sbt] object LibraryManagement {
|
||||
|
||||
|
|
@ -126,7 +127,7 @@ private[sbt] object LibraryManagement {
|
|||
}
|
||||
|
||||
private[this] def fileUptodate(file: File, stamps: Map[File, Long]): Boolean =
|
||||
stamps.get(file).forall(_ == file.lastModified)
|
||||
stamps.get(file).forall(_ == IO.getModifiedTime(file))
|
||||
|
||||
private[sbt] def transitiveScratch(
|
||||
lm: DependencyResolution,
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ object Dependencies {
|
|||
val baseScalaVersion = scala212
|
||||
|
||||
// sbt modules
|
||||
private val ioVersion = "1.1.1"
|
||||
private val utilVersion = "1.1.0"
|
||||
private val lmVersion = "1.1.0"
|
||||
private val zincVersion = "1.1.0-RC1"
|
||||
private val ioVersion = "1.1.2"
|
||||
private val utilVersion = "1.1.1"
|
||||
private val lmVersion = "1.1.1"
|
||||
private val zincVersion = "1.1.0-RC3"
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@ object SiteMap {
|
|||
// generates a string suitable for a sitemap file representing the last modified time of the given File
|
||||
private[this] def lastModifiedString(f: File): String = {
|
||||
val formatter = new java.text.SimpleDateFormat("yyyy-MM-dd")
|
||||
// TODO: replace lastModified() with sbt.io.Milli.getModifiedTime(), once the build
|
||||
// has been upgraded to a version of sbt that includes sbt.io.Milli.
|
||||
formatter.format(new java.util.Date(f.lastModified))
|
||||
}
|
||||
// writes the provided XML node to `output` and then gzips it to `gzipped` if `gzip` is true
|
||||
|
|
|
|||
|
|
@ -105,6 +105,8 @@ object Util {
|
|||
val timestamp = formatter.format(new Date)
|
||||
val content = versionLine(version) + "\ntimestamp=" + timestamp
|
||||
val f = dir / "xsbt.version.properties"
|
||||
// TODO: replace lastModified() with sbt.io.Milli.getModifiedTime(), once the build
|
||||
// has been upgraded to a version of sbt that includes sbt.io.Milli.
|
||||
if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) {
|
||||
s.log.info("Writing version information to " + f + " :\n" + content)
|
||||
IO.write(f, content)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
scalaVersion := "2.12.3"
|
||||
scalacOptions ++= Seq("-feature", "-language:postfixOps")
|
||||
|
||||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.17")
|
||||
// addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.0")
|
||||
// addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.2")
|
||||
// addSbtPlugin("com.typesafe.sbt" % "sbt-javaversioncheck" % "0.1.0")
|
||||
// addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.2.0")
|
||||
|
||||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.1")
|
||||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.4")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.2")
|
||||
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.14")
|
||||
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")
|
||||
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0")
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ final class ClientCapabilities private () extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: ClientCapabilities => true
|
||||
case _: ClientCapabilities => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ abstract class CommandMessage() extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: CommandMessage => true
|
||||
case _: CommandMessage => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ abstract class EventMessage() extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: EventMessage => true
|
||||
case _: EventMessage => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ abstract class SettingQueryResponse() extends sbt.protocol.EventMessage() with S
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: SettingQueryResponse => true
|
||||
case _: SettingQueryResponse => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ $ copy-file changes/ThreadRunError.scala src/main/scala/Run.scala
|
|||
$ copy-file changes/RunExplicitSuccess.scala src/main/scala/Run.scala
|
||||
> run
|
||||
|
||||
# https://github.com/sbt/sbt/issues/3543
|
||||
# # explicitly calling System.exit(1) should fail the 'run' task
|
||||
# $ copy-file changes/RunExplicitFailure.scala src/main/scala/Run.scala
|
||||
# -> run
|
||||
# explicitly calling System.exit(1) should fail the 'run' task
|
||||
$ copy-file changes/RunExplicitFailure.scala src/main/scala/Run.scala
|
||||
-> run
|
||||
|
|
@ -10,7 +10,7 @@ final class TestInitEvent private () extends sbt.protocol.testing.TestMessage()
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: TestInitEvent => true
|
||||
case _: TestInitEvent => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ abstract class TestMessage() extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: TestMessage => true
|
||||
case _: TestMessage => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue