From 8fb23b4fe56c92ee52170739ed4ea7570020e241 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Mon, 18 Dec 2017 16:25:32 +0000 Subject: [PATCH 1/6] Add 1.1.1 to mimaPreviousArtifacts, & backfill --- build.sbt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 65b5c0ad2..c40786055 100644 --- a/build.sbt +++ b/build.sbt @@ -30,7 +30,13 @@ def commonSettings: Seq[Setting[_]] = Seq( ) val mimaSettings = Def settings ( - mimaPreviousArtifacts := Set(organization.value %% moduleName.value % "1.0.0"), + mimaPreviousArtifacts := Set( + "1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4", + "1.1.0", "1.1.1", + ) map (version => + organization.value %% moduleName.value % version + cross (if (crossPaths.value) CrossVersion.binary else CrossVersion.disabled) + ), mimaBinaryIssueFilters ++= { import com.typesafe.tools.mima.core._ import com.typesafe.tools.mima.core.ProblemFilters._ From abf370adc305b2d29fcc733f6338eb42008af7f8 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Tue, 19 Dec 2017 13:23:44 +0000 Subject: [PATCH 2/6] Upgrade to sbt-houserules 0.3.5 --- build.sbt | 2 -- project/plugins.sbt | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index c40786055..3b35213c5 100644 --- a/build.sbt +++ b/build.sbt @@ -60,9 +60,7 @@ lazy val lmRoot = (project in file(".")) Some(ScmInfo(url(s"https://github.com/$slug"), s"git@github.com:$slug.git")) }, bintrayPackage := "librarymanagement", - scalafmtOnCompile := true, scalafmtOnCompile in Sbt := false, - scalafmtVersion := "1.2.0", git.baseVersion := baseVersion, version := { val v = version.value diff --git a/project/plugins.sbt b/project/plugins.sbt index 7a0426d32..8e2abce43 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.4") +addSbtPlugin("org.scala-sbt" % "sbt-houserules" % "0.3.5") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.3.2") scalacOptions += "-language:postfixOps" From 42f23e62aa46b811e4fbf03b14a8365c5da9cf92 Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Mon, 18 Dec 2017 17:24:22 +0100 Subject: [PATCH 3/6] Revert *ModifiedTime() calls to *lastModified*() calls There are just too many instances in which sbt's code relies on the `lastModified`/`setLastModified` semantics, so instead of moving to `get`/`setModifiedTime`, we use new IO calls that offer the new timestamp precision, but retain the old semantics. --- .../sbt/librarymanagement/RichUpdateReport.scala | 11 +++++------ .../ivyint/GigahorseUrlHandler.scala | 2 +- project/Util.scala | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala index d8e5ca795..3d7eb933c 100644 --- a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala +++ b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala @@ -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.lastModified() will just return zero, but the list of files should not contain such + // files to begin with, in principle. + IO.lastModified(f) ) .toMap UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index 32bbaf516..1a25a3202 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -149,7 +149,7 @@ class GigahorseUrlHandler extends AbstractURLHandler { val lastModified = lastModifiedTimestamp(response) if (lastModified > 0) { - IO.setModifiedTime(dest, lastModified) + IO.setLastModified(dest, lastModified) } if (l != null) { diff --git a/project/Util.scala b/project/Util.scala index 2ef855762..5c63dd1de 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -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.lastModified(), 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) From 72dd0064c3791ad4a6a2ba1904d8cf12322aede3 Mon Sep 17 00:00:00 2001 From: Antonio Cunei Date: Fri, 22 Dec 2017 00:24:48 +0100 Subject: [PATCH 4/6] Change modifiedTime definitions --- .../main/scala/sbt/librarymanagement/RichUpdateReport.scala | 4 ++-- .../librarymanagement/ivyint/GigahorseUrlHandler.scala | 2 +- project/Util.scala | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala index 3d7eb933c..97f672faa 100644 --- a/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala +++ b/core/src/main/scala/sbt/librarymanagement/RichUpdateReport.scala @@ -18,9 +18,9 @@ final class RichUpdateReport(report: UpdateReport) { (f, // 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.lastModified() will just return zero, but the list of files should not contain such + // IO.getModifiedTimeOrZero() will just return zero, but the list of files should not contain such // files to begin with, in principle. - IO.lastModified(f) + IO.getModifiedTimeOrZero(f)) ) .toMap UpdateReport(report.cachedDescriptor, report.configurations, report.stats, stamps) diff --git a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala index 1a25a3202..b8da74aab 100644 --- a/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala +++ b/ivy/src/main/scala/sbt/internal/librarymanagement/ivyint/GigahorseUrlHandler.scala @@ -149,7 +149,7 @@ class GigahorseUrlHandler extends AbstractURLHandler { val lastModified = lastModifiedTimestamp(response) if (lastModified > 0) { - IO.setLastModified(dest, lastModified) + IO.setModifiedTimeOrFalse(dest, lastModified) } if (l != null) { diff --git a/project/Util.scala b/project/Util.scala index 5c63dd1de..3b1ead60a 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -26,7 +26,7 @@ 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.IO.lastModified(), once the build + // 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) From b53c37b54f9f94703f2efb2e4f60da2d4532d3ab Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 22 Dec 2017 08:35:11 -0500 Subject: [PATCH 5/6] IO 1.1.3 and Util 1.1.2 --- project/Dependencies.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 1a71abf72..3d4a59e93 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -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 From fa472179f5aa7deb07e0126cca4e7a9c07bf268b Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Fri, 22 Dec 2017 08:35:26 -0500 Subject: [PATCH 6/6] sbt 1.0.4 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 94005e587..394cb75cf 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.0.0 +sbt.version=1.0.4