Skip to content

Commit

Permalink
Merge pull request #192 from cunei/wip-milliBis
Browse files Browse the repository at this point in the history
Revert *ModifiedTime() calls to *lastModified*() calls
  • Loading branch information
eed3si9n authored Dec 22, 2017
2 parents badb96e + fa47217 commit 203fce0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
11 changes: 5 additions & 6 deletions core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ final class RichUpdateReport(report: UpdateReport) {
.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 })
// TODO: The list of files may also contain some odd files that do not actually exist like:
// "./target/ivyhome/resolution-cache/com.example/foo/0.4.0/resolved.xml.xml".
// IO.getModifiedTimeOrZero() will just return zero, but the list of files should not contain such
// files to begin with, in principle.
IO.getModifiedTimeOrZero(f))
)
.toMap
UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class GigahorseUrlHandler extends AbstractURLHandler {

val lastModified = lastModifiedTimestamp(response)
if (lastModified > 0) {
IO.setModifiedTime(dest, lastModified)
IO.setModifiedTimeOrFalse(dest, lastModified)
}

if (l != null) {
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ object Dependencies {
val scala211 = "2.11.12"
val scala212 = "2.12.4"

private val ioVersion = "1.1.2"
private val utilVersion = "1.1.1"
private val ioVersion = "1.1.3"
private val utilVersion = "1.1.2"

private val sbtIO = "org.scala-sbt" %% "io" % ioVersion

Expand Down
4 changes: 2 additions & 2 deletions project/Util.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +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.
// TODO: replace lastModified() with sbt.io.IO.getModifiedTimeOrZero(), once the build
// has been upgraded to a version of sbt that includes that call.
if (!f.exists || f.lastModified < lastCompilationTime(analysis) || !containsVersion(f, version)) {
s.log.info("Writing version information to " + f + " :\n" + content)
IO.write(f, content)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.0.0
sbt.version=1.0.4

0 comments on commit 203fce0

Please sign in to comment.