mirror of https://github.com/sbt/sbt.git
Merge pull request #191 from eed3si9n/wip/bump
Convert lastModified() calls to the more precise getModifiedTime() + bump modules and plugins
This commit is contained in:
commit
bf94f3badf
|
|
@ -55,6 +55,7 @@ lazy val lmRoot = (project in file("."))
|
|||
},
|
||||
bintrayPackage := "librarymanagement",
|
||||
scalafmtOnCompile := true,
|
||||
scalafmtOnCompile in Sbt := false,
|
||||
scalafmtVersion := "1.2.0",
|
||||
git.baseVersion := baseVersion,
|
||||
version := {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ abstract class CrossVersion() extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: CrossVersion => true
|
||||
case _: CrossVersion => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ final class Disabled private () extends sbt.librarymanagement.CrossVersion() wit
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Disabled => true
|
||||
case _: Disabled => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ final class Patch private () extends sbt.librarymanagement.CrossVersion() with S
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: Patch => true
|
||||
case _: Patch => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ abstract class SshAuthentication() extends Serializable {
|
|||
|
||||
|
||||
override def equals(o: Any): Boolean = o match {
|
||||
case x: SshAuthentication => true
|
||||
case _: SshAuthentication => true
|
||||
case _ => false
|
||||
}
|
||||
override def hashCode: Int = {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package sbt
|
|||
package librarymanagement
|
||||
|
||||
import java.io.File
|
||||
import java.io.FileNotFoundException
|
||||
import sbt.io.IO
|
||||
|
||||
/**
|
||||
* Provides extra methods for filtering the contents of an `UpdateReport`
|
||||
|
|
@ -10,7 +12,18 @@ import java.io.File
|
|||
final class RichUpdateReport(report: UpdateReport) {
|
||||
private[sbt] def recomputeStamps(): UpdateReport = {
|
||||
val files = report.cachedDescriptor +: allFiles
|
||||
val stamps = files.map(f => (f, f.lastModified)).toMap
|
||||
val stamps = files
|
||||
.map(
|
||||
f =>
|
||||
(f,
|
||||
// TODO: this used to be a lastModified(), without error checking.
|
||||
// On occasion, "files" contains files like "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml",
|
||||
// which do not actually exist, so getModifiedTime() correctly throws an exception. For the moment, the behavior of
|
||||
// lastModified() is reproduced, but the non-existent file should really not be there to begin with. so, FIXME.
|
||||
try IO.getModifiedTime(f)
|
||||
catch { case _: FileNotFoundException => 0L })
|
||||
)
|
||||
.toMap
|
||||
UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ class GigahorseUrlHandler extends AbstractURLHandler {
|
|||
|
||||
val lastModified = lastModifiedTimestamp(response)
|
||||
if (lastModified > 0) {
|
||||
dest.setLastModified(lastModified)
|
||||
IO.setModifiedTime(dest, lastModified)
|
||||
}
|
||||
|
||||
if (l != null) {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ object Dependencies {
|
|||
val scala211 = "2.11.12"
|
||||
val scala212 = "2.12.4"
|
||||
|
||||
private val ioVersion = "1.0.2"
|
||||
private val utilVersion = "1.0.3"
|
||||
private val ioVersion = "1.1.2"
|
||||
private val utilVersion = "1.1.1"
|
||||
|
||||
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,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,6 +1,4 @@
|
|||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.3")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.0")
|
||||
addSbtPlugin("com.lucidchart" % "sbt-scalafmt" % "1.10")
|
||||
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.17")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.4")
|
||||
addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.2")
|
||||
|
||||
scalacOptions += "-language:postfixOps"
|
||||
|
|
|
|||
Loading…
Reference in New Issue