diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index fceab31fb6..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -image: Visual Studio 2017 -build: off - -init: - - git config --global core.autocrlf input - -install: - - SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0 - - SET PATH=%JAVA_HOME%\bin;%PATH% - - SET CI=true - - - ps: | - Add-Type -AssemblyName System.IO.Compression.FileSystem - if (!(Test-Path -Path "C:\sbt" )) { - (new-object System.Net.WebClient).DownloadFile( - 'https://github.com/sbt/sbt/releases/download/v1.3.10/sbt-1.3.10.zip', - 'C:\sbt-bin.zip' - ) - [System.IO.Compression.ZipFile]::ExtractToDirectory("C:\sbt-bin.zip", "C:\sbt") - } - - SET PATH=C:\sbt\sbt\bin;%PATH% - - SET SBT_OPTS=-XX:MaxPermSize=2g -Xmx4g -Dsbt.supershell=never -Dfile.encoding=UTF8 -test_script: - - sbt "crossTestBridges" "zincRoot/test" "zincScriptedJVM2_12/test:run" - -cache: - - '%LOCALAPPDATA%\Coursier\Cache\v1' - - '%USERPROFILE%\.ivy2\cache' - - '%USERPROFILE%\.sbt' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30415f5981..541fe88031 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,9 +15,12 @@ jobs: - os: ubuntu-latest java: 11 jobtype: 1 + - os: windows-latest + java: 8 + jobtype: 2 - os: ubuntu-latest java: 11 - jobtype: 2 + jobtype: 3 runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -34,12 +37,16 @@ jobs: path: ~/.sbt key: ${{ runner.os }}-sbt-cache-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Build and test + shell: bash run: | case ${{ matrix.jobtype }} in 1) bin/run-ci.sh ;; 2) + sbt -v -Dfile.encoding=UTF-8 -J-XX:ReservedCodeCacheSize=512M -Dsbt.supershell=never -J-Xms1024M -J-Xmx2048M -J-server "crossTestBridges" "zincRoot/test" "zincScriptedJVM2_12/test:run" + ;; + 3) sbt -v -Dfile.encoding=UTF-8 -J-XX:ReservedCodeCacheSize=512M -J-Xms1024M -J-Xmx2048M -J-server "runBenchmarks" ;; *) diff --git a/build.sbt b/build.sbt index 675c48f5be..c81192ec08 100644 --- a/build.sbt +++ b/build.sbt @@ -35,7 +35,10 @@ def mimaSettings: Seq[Setting[_]] = Seq( "1.2.2", "1.3.0", ) - val post140: Set[String] = Set() + val post140: Set[String] = Set( + "1.4.0", + "1.5.0", + ) val versions = if (scalaVersion.value.startsWith("2.12.")) pre140 ++ post140 else post140 @@ -85,6 +88,7 @@ ThisBuild / mimaPreviousArtifacts := Set.empty // limit the number of concurrent test so testQuick works Global / concurrentRestrictions += Tags.limit(Tags.Test, 4) ThisBuild / semanticdbVersion := "4.4.6" +ThisBuild / Test / fork := true def baseSettings: Seq[Setting[_]] = Seq( resolvers += Resolver.typesafeIvyRepo("releases"), @@ -299,6 +303,7 @@ lazy val zincPersistCoreAssembly = (projectMatrix in internalPath / "zinc-persis autoScalaLibrary := false, exportJars := true, Compile / packageBin := (zincPersistCore / Compile / assembly).value, + mimaPreviousArtifacts := Set.empty, ) lazy val zincPersistCore = (project in internalPath / "zinc-persist-core") @@ -472,6 +477,7 @@ lazy val compilerInterface = (projectMatrix in internalPath / "compiler-interfac exclude[ReversedMissingMethodProblem]("xsbti.compile.IncrementalCompiler.compileAllJava"), exclude[ReversedMissingMethodProblem]("xsbti.compile.ScalaInstance.loaderCompilerOnly"), exclude[ReversedMissingMethodProblem]("xsbti.compile.ScalaInstance.compilerJars"), + exclude[InheritedNewAbstractMethodProblem]("xsbti.InteractiveConsoleInterface.close"), ), ) .jvmPlatform(autoScalaLibrary = false) diff --git a/internal/zinc-core/src/main/scala/sbt/internal/inc/PickleJar.scala b/internal/zinc-core/src/main/scala/sbt/internal/inc/PickleJar.scala index e850cbfe6f..d2efe188a6 100644 --- a/internal/zinc-core/src/main/scala/sbt/internal/inc/PickleJar.scala +++ b/internal/zinc-core/src/main/scala/sbt/internal/inc/PickleJar.scala @@ -17,6 +17,7 @@ import java.nio.file.{ FileVisitResult, Files, Path, SimpleFileVisitor } import java.nio.file.attribute.BasicFileAttributes import sbt.util.Logger import scala.reflect.io.RootPath +import sbt.internal.io.Retry object PickleJar { // create an empty JAR file in case the subproject has no classes. @@ -32,7 +33,7 @@ object PickleJar { if (!knownProducts.isEmpty) { val pj = RootPath(pickleOut, writable = false) // so it doesn't delete the file try Files.walkFileTree(pj.root, deleteUnknowns(knownProducts, log)) - finally pj.close() + finally Retry(pj.close()) } () } @@ -45,7 +46,9 @@ object PickleJar { // "/foo/bar/wiz.sig" -> "foo/bar/wiz.class" if (!knownProducts.contains(ps.stripPrefix("/").stripSuffix(".sig") + ".class")) { log.debug(s"PickleJar.deleteUnknowns: visitFile deleting $ps") - Files.delete(path) + // retry to work around C:\Users\RUNNER~1\AppData\Local\Temp\sbt_f3e67bfa\dep\target\early\output.jar: + // The process cannot access the file because it is being used by another process. + Retry(Files.delete(path)) } } FileVisitResult.CONTINUE diff --git a/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala b/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala index e1abbd0e14..8ccfe31184 100644 --- a/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala +++ b/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala @@ -811,7 +811,10 @@ case class ProjectStructure( val dropQuotes = if (expected.startsWith("\"")) expected.drop(1).dropRight(1) else expected - assert(problemMessage.contains(dropQuotes), s"'$problemMessage' doesn't contain '$dropQuotes'.") + assert( + problemMessage.contains(dropQuotes), + s"'$problemMessage' doesn't contain '$dropQuotes'." + ) case None => throw new TestFailed( s"Problem not found: $index (there are ${problems.length} problem with severity $severity)." diff --git a/project/HouseRulesPlugin.scala b/project/HouseRulesPlugin.scala index 2a95c7d760..2819de40fb 100644 --- a/project/HouseRulesPlugin.scala +++ b/project/HouseRulesPlugin.scala @@ -32,7 +32,7 @@ object HouseRulesPlugin extends AutoPlugin { scalacOptions += "-Ywarn-value-discard", scalacOptions ++= "-Ywarn-unused-import".ifScala(v => 11 <= v && v <= 12).value.toList ) ++ Seq(Compile, Test).flatMap( - c => scalacOptions in (c, console) --= Seq("-Ywarn-unused-import", "-Xlint") + c => (c / console / scalacOptions) --= Seq("-Ywarn-unused-import", "-Xlint") ) private def scalaPartV = Def setting (CrossVersion partialVersion scalaVersion.value) diff --git a/project/Scripted.scala b/project/Scripted.scala index 3ac317164b..e3e6af6435 100644 --- a/project/Scripted.scala +++ b/project/Scripted.scala @@ -77,7 +77,8 @@ object Scripted { bufferLog: Boolean, compileToJar: Boolean, ): Unit = { - val noJLine = new classpath.FilteredLoader(scriptedSbtInstance.loader, "jline." :: Nil) + val noJLine = + new classpath.FilteredLoader(scriptedSbtInstance.loader, "xsbti." :: "jline." :: Nil) val loader = classpath.ClasspathUtilities.toLoader(scriptedSbtClasspath.files, noJLine) val bridgeClass = Class.forName("sbt.inc.ScriptedMain$", true, loader) val bridge = bridgeClass.getField("MODULE$").get(null).asInstanceOf[ScriptedMain] diff --git a/project/Util.scala b/project/Util.scala index 773fbbae0e..a72dc5ad86 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -38,11 +38,11 @@ object Util { def sampleProjectSettings(ext: String) = Seq( - (scalaSource in Compile) := baseDirectory.value / "src", + (Compile / scalaSource) := baseDirectory.value / "src", genTestResTask := { def resurcesDir = (file("zinc") / "src" / "test" / "resources" / "bin").getAbsoluteFile val target = resurcesDir / s"${name.value}.$ext" - IO.copyFile((packageBin in Compile).value, target) + IO.copyFile((Compile / packageBin).value, target) Seq(target) } ) ++ relaxNon212 diff --git a/project/build.properties b/project/build.properties index dbae93bcfd..f0be67b9f7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.9 +sbt.version=1.5.1 diff --git a/project/plugins.sbt b/project/plugins.sbt index 591b9dfe8a..70155bdccb 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,6 +8,6 @@ addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % "0.6.5") libraryDependencies += "com.github.os72" % "protoc-jar" % "3.11.4" // sync w/ ProtobufConfig / version addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.18") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1") addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.5.2") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.10")