diff --git a/README.md b/README.md index 9112cef4511e..554ea20c7e13 100644 --- a/README.md +++ b/README.md @@ -139,8 +139,6 @@ Note that sbt's incremental compilation is often too coarse for the Scala compil codebase and re-compiles too many files, resulting in long build times (check [sbt#1104](https://github.com/sbt/sbt/issues/1104) for progress on that front). In the meantime you can: - - Enable "Ant mode" in which sbt only re-compiles source files that were modified. - Create a file `local.sbt` containing the line `antStyle := true`. - Use IntelliJ IDEA for incremental compiles (see [IDE Setup](#ide-setup) below) - its incremental compiler is a bit less conservative, but usually correct. diff --git a/build.sbt b/build.sbt index ee80b5af0376..e3bc3a88bfe4 100644 --- a/build.sbt +++ b/build.sbt @@ -32,7 +32,7 @@ * - to modularize the Scala compiler or library further */ -import sbt.TestResult +import sbt.{Global, TestResult} import scala.build._ import VersionUtil._ @@ -44,10 +44,10 @@ val scalaParserCombinatorsDep = scalaDep("org.scala-lang.modules", "scala-par val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest") // Non-Scala dependencies: -val junitDep = "junit" % "junit" % "4.11" +val junitDep = "junit" % "junit" % "4.12" val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % "test" val scalacheckDep = "org.scalacheck" % "scalacheck_2.12" % "1.14.3" % "test" -val jolDep = "org.openjdk.jol" % "jol-core" % "0.5" +val jolDep = "org.openjdk.jol" % "jol-core" % "0.9" val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version") val jlineDep = "jline" % "jline" % versionProps("jline.version") val jansiDep = "org.fusesource.jansi" % "jansi" % "1.12" @@ -82,7 +82,7 @@ lazy val publishSettings : Seq[Setting[_]] = Seq( else Nil }, // Add a "default" Ivy configuration because sbt expects the Scala distribution to have one: - ivyConfigurations += Configuration("default", "Default", true, List(Configurations.Runtime), true), + ivyConfigurations += Configuration.of("Default", "default", "Default", true, Vector(Configurations.Runtime), true), publishMavenStyle := true ) @@ -110,7 +110,213 @@ headerLicense in ThisBuild := Some(HeaderLicense.Custom( |""".stripMargin )) -mimaReferenceVersion in Global := Some("2.12.0") +Global / mimaReferenceVersion := Some("2.12.0") + +import com.typesafe.tools.mima.core._ +val mimaFilterSettings = Seq { + mimaBinaryIssueFilters ++= Seq( + ProblemFilters.exclude[IncompatibleSignatureProblem]("*"), + ProblemFilters.exclude[InaccessibleMethodProblem]("java.lang.Object."), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorBuilder.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorPointer.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorIterator.debug"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.OpenHashMap.nextPositivePowerOfTwo"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.powerOfTwo"), + ProblemFilters.exclude[MissingClassProblem]("scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.getExitValue"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureValue"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureThread"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.nextPositivePowerOfTwo"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedBytesHash"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedArrayHash"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.contains0"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.contains0"), + + ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix$"), + ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.PropertiesTrait.coloredOutputEnabled"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.coloredOutputEnabled"), + + // https://github.com/scala/scala/pull/6101 + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyRef"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyDouble"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyChar"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyUnit"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyShort"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyInt"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyByte"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyLong"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyBoolean"), + ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyFloat"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyRef.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyDouble.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyChar.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyUnit.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyShort.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyInt.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyByte.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyLong.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyBoolean.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyFloat.serialVersionUID"), + + // https://github.com/scala/scala/pull/6138 + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#EmptyMap.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map1.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map2.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map3.serialVersionUID"), + ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map4.serialVersionUID"), + ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.GenTraversableOnce.toList"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.foreachEntry"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.Map$HashCodeAccumulator"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.ListMap.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.foreachEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.product2Hash"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.emptyMapHash"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.HashMap$HashMapKeys"), + ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.HashMap$HashMapValues"), + + // Some static forwarder changes detected after a MiMa upgrade. + // e.g. static method apply(java.lang.Object)java.lang.Object in class scala.Symbol does not have a correspondent in current version + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.Symbol.apply"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.Process.Future"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.Process.Spawn"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.slice"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.drop"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.take"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.toSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.reverse"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.toCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.andThen"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.dropRight"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeRight"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.takeWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.drop"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.take"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.slice"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.head"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.reversed"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.dropWhile"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.tail"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.thisCollection"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Nil.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.List.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Queue.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.iterate"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.range"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.tabulate"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.fill"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Stream.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.LinkedList.empty"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.scalaProps"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.propFilename"), + + // + // scala-relect + // + ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps#SynchronizedBaseTypeSeq.lateMap"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$exists"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$getFlag"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$privateWithin"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$annotations"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats$"), + ProblemFilters.exclude[MissingTypesProblem]("scala.reflect.runtime.JavaUniverse"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.io.ZipArchive.close"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$typeConstructor"), + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized"), + + ProblemFilters.exclude[Problem]("scala.reflect.internal.*"), + + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass"), + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.Yvirtpatmat"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.PlainNioFile"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps.newMappedBaseTypeSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.newMappedBaseTypeSeq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.statistics"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror#JavaAnnotationProxy.transformArgs"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LazyEntry"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.closeZipFile"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LeakyEntry"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.exists"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.getFlag"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.privateWithin"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.annotations"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.isScala213"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.this"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.allDirsByDottedName"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.URLZipArchive.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ManifestResources.close"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.close"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.typeTag"), + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.runtime.JavaMirrors$JavaMirror$typeTagCache$"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.TypeTags.TypeTagImpl"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl"), + + ProblemFilters.exclude[MissingClassProblem]("scala.reflect.macros.Attachments$"), + + ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir"), + ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.typeConstructor"), + + ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.AbstractFile.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.VirtualFile.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive#Entry.unsafeToByteArray"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.unsafeToByteArray"), + + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.seq"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.view"), + ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.NoAbstractFile.view"), + ) +} scalaVersion in Global := versionProps("starr.version") @@ -126,20 +332,17 @@ lazy val instanceSettings = Seq[Setting[_]]( // sbt claims that s.isManagedVersion is false even though s was resolved by Ivy // We create a managed copy to prevent sbt from putting it on the classpath where we don't want it if(s.isManagedVersion) s else { - val jars = s.jars - val libraryJar = jars.find(_.getName contains "-library").get - val compilerJar = jars.find(_.getName contains "-compiler").get - val extraJars = jars.filter(f => (f ne libraryJar) && (f ne compilerJar)) - val s2 = new ScalaInstance(s.version, s.loader, libraryJar, compilerJar, extraJars, Some(s.actualVersion)) + import sbt.internal.inc.ScalaInstance + val s2 = new ScalaInstance(s.version, s.loader, s.loaderLibraryOnly, s.libraryJars, s.compilerJar, s.allJars, Some(s.actualVersion)) assert(s2.isManagedVersion) s2 } }, - // As of sbt 0.13.12 (sbt/sbt#2634) sbt endeavours to align both scalaOrganization and scalaVersion + // sbt endeavours to align both scalaOrganization and scalaVersion // in the Scala artefacts, for example scala-library and scala-compiler. // This doesn't work in the scala/scala build because the version of scala-library and the scalaVersion of // scala-library are correct to be different. So disable overriding. - ivyScala ~= (_ map (_ copy (overrideScalaVersion = false))), + scalaModuleInfo ~= (_ map (_ withOverrideScalaVersion false)), Quiet.silenceScalaBinaryVersionWarning ) @@ -152,6 +355,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories sourceDirectory in Compile := baseDirectory.value, unmanagedSourceDirectories in Compile := List(baseDirectory.value), unmanagedResourceDirectories in Compile += (baseDirectory in ThisBuild).value / "src" / thisProject.value.id, + sourcesInBase := false, scalaSource in Compile := (sourceDirectory in Compile).value, javaSource in Compile := (sourceDirectory in Compile).value, // resources are stored along source files in our current layout @@ -165,25 +369,6 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories // to make sure they are being cleaned properly cleanFiles += (classDirectory in Compile).value, cleanFiles += (target in Compile in doc).value, - // SBT 0.13.17+ doesn't seem to respect `cleanFiles` anymore: https://github.com/sbt/sbt/pull/3834/files#r172686677 - // Let's override `cleanFilesTask`. - cleanFilesTask := { - val filesAndDirs = (Vector(managedDirectory.value, target.value) ++ cleanFiles.value).distinct - - // START: Copy/pasted from SBT - val preserve = cleanKeepFiles.value - val (dirs, fs) = filesAndDirs.filter(_.exists).partition(_.isDirectory) - val preserveSet = preserve.filter(_.exists).toSet - // performance reasons, only the direct items under `filesAndDirs` are allowed to be preserved. - val dirItems = dirs flatMap { _.*("*").get } - (preserveSet diff dirItems.toSet) match { - case xs if xs.isEmpty => () - case xs => sys.error(s"cleanKeepFiles contains directory/file that are not directly under cleanFiles: $xs") - } - val toClean = (dirItems filterNot { preserveSet(_) }) ++ fs - toClean - // END: Copy/pasted from SBT - }, fork in run := true, scalacOptions in Compile += "-Ywarn-unused:imports", scalacOptions in Compile in doc ++= Seq( @@ -196,48 +381,39 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories "-sourcepath", (baseDirectory in ThisBuild).value.toString, "-doc-source-url", s"https://github.com/scala/scala/tree/${versionProperties.value.githubTree}€{FILE_PATH_EXT}#L€{FILE_LINE}" ), - incOptions := (incOptions in LocalProject("root")).value, + setIncOptions, apiURL := Some(url("https://www.scala-lang.org/api/" + versionProperties.value.mavenVersion + "/")), pomIncludeRepository := { _ => false }, pomExtra := { - val base = - - scm:git:git://github.com/scala/scala.git - https://github.com/scala/scala.git - - - GitHub - https://github.com/scala/bug/issues - - - - lamp - LAMP/EPFL - - - Lightbend - Lightbend, Inc. - - - apiURL.value match { - case Some(url) => base ++ - - {url.toString} - - case None => base - } + + scm:git:git://github.com/scala/scala.git + https://github.com/scala/scala.git + + + GitHub + https://github.com/scala/bug/issues + + + + lamp + LAMP/EPFL + + + Lightbend + Lightbend, Inc. + + }, headerLicense := (headerLicense in ThisBuild).value, // Remove auto-generated manifest attributes packageOptions in Compile in packageBin := Seq.empty, packageOptions in Compile in packageSrc := Seq.empty, + // workaround for SBT regression. Real fix coming in https://github.com/scala/scala/pull/8525. + mappings in Compile in packageBin := (mappings in Compile in packageBin).value.filterNot(_._2 == ""), + // Lets us CTRL-C partest without exiting SBT entirely cancelable in Global := true, - // When we fork subprocesses, use the base directory as the working directory. - // This enables `sbt> partest test/files/run/t1.scala` or `sbt> scalac sandbox/test.scala` - baseDirectory in Compile := (baseDirectory in ThisBuild).value, - baseDirectory in Test := (baseDirectory in ThisBuild).value, // Don't pick up source files from the project root. sourcesInBase := false, @@ -245,7 +421,7 @@ lazy val commonSettings = instanceSettings ++ clearSourceAndResourceDirectories // Don't log process output (e.g. of forked `compiler/runMain ...Main`), just pass it // directly to stdout outputStrategy in run := Some(StdoutOutput) -) ++ removePomDependencies +) ++ removePomDependencies ++ setForkedWorkingDirectory /** Extra post-processing for the published POM files. These are needed to create POMs that * are equivalent to the ones from the Ant build. In the long term this should be removed and @@ -362,6 +538,13 @@ def regexFileFilter(s: String): FileFilter = new FileFilter { def accept(f: File) = pat.matcher(f.getAbsolutePath.replace('\\', '/')).matches() } +def setForkedWorkingDirectory: Seq[Setting[_]] = { + // When we fork subprocesses, use the base directory as the working directory. + // This“ enables `sbt> partest test/files/run/t1.scala` or `sbt> scalac sandbox/test.scala` + val setting = (forkOptions in Compile) := (forkOptions in Compile).value.withWorkingDirectory((baseDirectory in ThisBuild).value) + setting ++ inTask(run)(setting) +} + // This project provides the STARR scalaInstance for bootstrapping lazy val bootstrap = project in file("target/bootstrap") @@ -386,7 +569,7 @@ lazy val library = configureAsSubproject(project) // Include *.txt files in source JAR: mappings in Compile in packageSrc ++= { val base = (unmanagedResourceDirectories in Compile).value - base ** "*.txt" pair relativeTo(base) + base ** "*.txt" pair Path.relativeTo(base) }, Osgi.headers += "Import-Package" -> "sun.misc;resolution:=optional, *", Osgi.jarlist := true, @@ -398,7 +581,8 @@ lazy val library = configureAsSubproject(project) // Remove the dependency on "forkjoin" from the POM because it is included in the JAR: pomDependencyExclusions += ((organization.value, "forkjoin")), mimaPreviousArtifacts := mimaReferenceVersion.value.map(organization.value % name.value % _).toSet, - mimaCheckDirection := "both" + mimaCheckDirection := "both", + mimaFilterSettings, ) .settings(filterDocSources("*.scala" -- (regexFileFilter(".*/runtime/.*\\$\\.scala") || regexFileFilter(".*/runtime/ScalaRunTime\\.scala") || @@ -408,6 +592,7 @@ lazy val reflect = configureAsSubproject(project) .settings(generatePropertiesFileSettings) .settings(Osgi.settings) .settings(AutomaticModuleName.settings("scala.reflect")) + .settings(mimaFilterSettings) .settings( name := "scala-reflect", description := "Scala Reflection Library", @@ -425,7 +610,8 @@ lazy val reflect = configureAsSubproject(project) "/project/packaging" -> jar ), mimaPreviousArtifacts := mimaReferenceVersion.value.map(organization.value % name.value % _).toSet, - mimaCheckDirection := "both" + mimaCheckDirection := "both", + mimaFilterSettings, ) .dependsOn(library) @@ -437,11 +623,11 @@ lazy val compilerOptionsExporter = Project("compilerOptionsExporter", file(".") .settings(disablePublishing) .settings( libraryDependencies ++= Seq( - "com.fasterxml.jackson.core" % "jackson-core" % "2.9.5", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.5", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.5", - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.9.5", - "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.5" + "com.fasterxml.jackson.core" % "jackson-core" % "2.9.7", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.9.7", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.9.7", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-yaml" % "2.9.7", + "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.9.7" ) ) @@ -465,7 +651,7 @@ lazy val compiler = configureAsSubproject(project) // (with strings) to deal with mutual recursion products in Compile in packageBin := (products in Compile in packageBin).value ++ - Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key) == Some(asmDep)).get.data) ++ + Seq((dependencyClasspath in Compile).value.find(_.get(moduleID.key).map(id => (id.organization, id.name, id.revision)).contains((asmDep.organization, asmDep.name, asmDep.revision))).get.data) ++ (products in Compile in packageBin in LocalProject("interactive")).value ++ (products in Compile in packageBin in LocalProject("scaladoc")).value ++ (products in Compile in packageBin in LocalProject("repl")).value ++ @@ -480,7 +666,7 @@ lazy val compiler = configureAsSubproject(project) (unmanagedResourceDirectories in Compile in LocalProject("interactive")).value ++ (unmanagedResourceDirectories in Compile in LocalProject("scaladoc")).value ++ (unmanagedResourceDirectories in Compile in LocalProject("repl")).value - base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair relativeTo(base) + base ** ((includeFilter in unmanagedResources in Compile).value || "*.scala" || "*.psd" || "*.ai" || "*.java") pair Path.relativeTo(base) }, // Include the additional projects in the scaladoc JAR: sources in Compile in doc ++= { @@ -700,6 +886,8 @@ lazy val junit = project.in(file("test") / "junit") .settings( fork in Test := true, javaOptions in Test += "-Xss1M", + (forkOptions in Test) := (forkOptions in Test).value.withWorkingDirectory((baseDirectory in ThisBuild).value), + (forkOptions in Test in testOnly) := (forkOptions in Test in testOnly).value.withWorkingDirectory((baseDirectory in ThisBuild).value), libraryDependencies ++= Seq(junitDep, junitInterfaceDep, jolDep), testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v"), unmanagedSourceDirectories in Compile := Nil, @@ -719,7 +907,7 @@ lazy val scalacheck = project.in(file("test") / "scalacheck") testOptions ++= { if ((fork in Test).value) Nil else List(Tests.Cleanup { loader => - ModuleUtilities.getObject("scala.TestCleanup", loader).asInstanceOf[Runnable].run() + sbt.internal.inc.ModuleUtilities.getObject("scala.TestCleanup", loader).asInstanceOf[Runnable].run() }) }, libraryDependencies ++= Seq(scalacheckDep), @@ -765,6 +953,8 @@ def osgiTestProject(p: Project, framework: ModuleID) = p }, Keys.test in Test := (Keys.test in Test).dependsOn(packageBin in Compile).value, testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-v", "-q"), + javaOptions in Test += "-Dscala.bundle.dir=" + (buildDirectory in ThisBuild).value / "osgi", + (forkOptions in Test in test) := (forkOptions in Test in test).value.withWorkingDirectory((baseDirectory in ThisBuild).value), unmanagedSourceDirectories in Test := List((baseDirectory in ThisBuild).value / "test" / "osgi" / "src"), unmanagedResourceDirectories in Compile := (unmanagedSourceDirectories in Test).value, includeFilter in unmanagedResources in Compile := "*.xml", @@ -773,7 +963,7 @@ def osgiTestProject(p: Project, framework: ModuleID) = p val mappings = ((mkPack in dist).value / "lib").listFiles.collect { case f if f.getName.startsWith("scala-") && f.getName.endsWith(".jar") => (f, targetDir / f.getName) } - IO.copy(mappings, overwrite = true) + IO.copy(mappings, CopyOptions() withOverwrite true) targetDir }, cleanFiles += (buildDirectory in ThisBuild).value / "osgi" @@ -820,12 +1010,13 @@ lazy val test = project testFrameworks += new TestFramework("scala.tools.partest.sbt.Framework"), testOptions in IntegrationTest += Tests.Argument("-Dpartest.java_opts=-Xmx1024M -Xms64M"), testOptions in IntegrationTest += Tests.Argument("-Dpartest.scalac_opts=" + (scalacOptions in Compile).value.mkString(" ")), + (forkOptions in IntegrationTest) := (forkOptions in IntegrationTest).value.withWorkingDirectory((baseDirectory in ThisBuild).value), testOptions in IntegrationTest += { val cp = (dependencyClasspath in Test).value val baseDir = (baseDirectory in ThisBuild).value val instrumentedJar = (packagedArtifact in (LocalProject("specLib"), Compile, packageBin)).value._2 Tests.Setup { () => - // Copy instrumented.jar (from specLib)to the location where partest expects it. + // Copy code.jar (resolved in the otherwise unused scope "test") and instrumented.jar (from specLib)to the location where partest expects them IO.copyFile(instrumentedJar, baseDir / "test/files/speclib/instrumented.jar") } }, @@ -839,12 +1030,13 @@ lazy val test = project }, true, Array() ), executeTests in IntegrationTest := { + val log = streams.value.log val result = (executeTests in IntegrationTest).value + val result2 = (executeTests in Test).value if (result.overall != TestResult.Error && result.events.isEmpty) { // workaround for https://github.com/sbt/sbt/issues/2722 - val result = (executeTests in Test).value - (streams.value.log.error("No test events found")) - result.copy(overall = TestResult.Error) + log.error("No test events found") + result2.copy(overall = TestResult.Error) } else result }, @@ -881,13 +1073,13 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di .settings( mappings in Compile in packageBin ++= { val binBaseDir = buildDirectory.value / "pack" - val binMappings = (mkBin in dist).value.pair(relativeTo(binBaseDir), errorIfNone = false) + val binMappings = (mkBin in dist).value.pair(Path.relativeTo(binBaseDir), errorIfNone = false) // With the way the resource files are spread out over the project sources we can't just add // an unmanagedResourceDirectory, so we generate the mappings manually: val docBaseDir = (baseDirectory in ThisBuild).value - val docMappings = (docBaseDir / "doc").*** pair relativeTo(docBaseDir) + val docMappings = (docBaseDir / "doc").allPaths pair Path.relativeTo(docBaseDir) val resBaseDir = (baseDirectory in ThisBuild).value / "src/manual/scala/tools/docutil/resources" - val resMappings = resBaseDir ** ("*.html" | "*.css" | "*.gif" | "*.png") pair (p => relativeTo(resBaseDir)(p).map("doc/tools/" + _)) + val resMappings = resBaseDir ** ("*.html" | "*.css" | "*.gif" | "*.png") pair (p => Path.relativeTo(resBaseDir)(p).map("doc/tools/" + _)) docMappings ++ resMappings ++ binMappings }, resourceGenerators in Compile += Def.task { @@ -900,8 +1092,8 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di runner.value.run("scala.tools.docutil.ManMaker", (fullClasspath in Compile in manual).value.files, Seq(command, htmlOut.getAbsolutePath, manOut.getAbsolutePath), - streams.value.log).foreach(sys.error) - (manOut ** "*.1" pair rebase(manOut, fixedManOut)).foreach { case (in, out) => + streams.value.log).failed foreach (sys error _.getMessage) + (manOut ** "*.1" pair Path.rebase(manOut, fixedManOut)).foreach { case (in, out) => // Generated manpages should always use LF only. There doesn't seem to be a good reason // for generating them with the platform EOL first and then converting them but that's // what the Ant build does. @@ -971,9 +1163,9 @@ lazy val root: Project = (project in file(".")) doc in Compile in scalap ).result map (_ -> "doc") )).value + val log = streams.value.log val failed = results.collect { case (Inc(i), d) => (i, d) } if (failed.nonEmpty) { - val log = streams.value.log def showScopedKey(k: Def.ScopedKey[_]): String = Vector( k.scope.project.toOption.map { @@ -1011,12 +1203,7 @@ lazy val root: Project = (project in file(".")) throw new RuntimeException } }, - antStyle := false, - incOptions := { - incOptions.value - .withNameHashing(!antStyle.value).withAntStyle(antStyle.value) - .withRecompileOnMacroDef(false) // // macros in library+reflect are hard-wired to implementations with `FastTrack`. - } + setIncOptions ) .aggregate(library, reflect, compiler, compilerOptionsExporter, interactive, repl, replJline, replJlineEmbedded, scaladoc, scalap, partestExtras, junit, libraryAll, scalaDist).settings( @@ -1025,6 +1212,11 @@ lazy val root: Project = (project in file(".")) |Check README.md for more information.""".stripMargin ) +def setIncOptions = incOptions := { + incOptions.value + .withRecompileOnMacroDef(Some(Boolean box false).asJava) // macros in library+reflect are hard-wired to implementations with `FastTrack`. +} + // The following subprojects' binaries are required for building "pack": lazy val distDependencies = Seq(replJline, replJlineEmbedded, compiler, library, reflect, scalap, scaladoc) @@ -1053,7 +1245,7 @@ lazy val dist = (project in file("dist")) } val jlineJAR = findJar((dependencyClasspath in Compile).value, jlineDep).get.data val mappings = extraJars.map(f => (f, targetDir / f.getName)) :+ ((jlineJAR, targetDir / "jline.jar")) - IO.copy(mappings, overwrite = true) + IO.copy(mappings, CopyOptions() withOverwrite true) targetDir }, cleanFiles += (buildDirectory in ThisBuild).value / "quick", @@ -1186,6 +1378,7 @@ intellij := { import xml.transform._ val s = streams.value + val compilerScalaInstance = (scalaInstance in LocalProject("compiler")).value val modules: List[(String, Seq[File])] = { // for the sbt build module, the dependencies are fetched from the project's build using sbt-buildinfo @@ -1273,20 +1466,20 @@ intellij := { if (!ipr.exists) { scala.Console.print(s"Could not find src/intellij/scala.ipr. Create new project files from src/intellij/*.SAMPLE (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") { + if (scala.io.StdIn.readLine() == "y") { intellijCreateFromSample((baseDirectory in ThisBuild).value) continue = true } } else { scala.Console.print("Update library classpaths in the current src/intellij/scala.ipr (y/N)? ") scala.Console.flush() - continue = scala.Console.readLine() == "y" + continue = scala.io.StdIn.readLine() == "y" } if (continue) { s.log.info("Updating library classpaths in src/intellij/scala.ipr.") val content = XML.loadFile(ipr) - val newStarr = replaceLibrary(content, "starr", Some("Scala"), starrDep((scalaInstance in LocalProject("compiler")).value.jars)) + val newStarr = replaceLibrary(content, "starr", Some("Scala"), starrDep(compilerScalaInstance.allJars)) val newModules = modules.foldLeft(newStarr)({ case (res, (modName, jars)) => if (jars.isEmpty) res // modules without dependencies @@ -1305,7 +1498,7 @@ intellijFromSample := { val s = streams.value scala.Console.print(s"Create new project files from src/intellij/*.SAMPLE (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") + if (scala.io.StdIn.readLine() == "y") intellijCreateFromSample((baseDirectory in ThisBuild).value) else s.log.info("Aborting.") @@ -1314,7 +1507,7 @@ intellijFromSample := { def intellijCreateFromSample(basedir: File): Unit = { val files = basedir / "src/intellij" * "*.SAMPLE" val copies = files.get.map(f => (f, new File(f.getAbsolutePath.stripSuffix(".SAMPLE")))) - IO.copy(copies, overwrite = true) + IO.copy(copies, CopyOptions() withOverwrite true) } lazy val intellijToSample = taskKey[Unit]("Update src/intellij/*.SAMPLE using the current IntelliJ project files.") @@ -1323,7 +1516,7 @@ intellijToSample := { val s = streams.value scala.Console.print(s"Update src/intellij/*.SAMPLE using the current IntelliJ project files (y/N)? ") scala.Console.flush() - if (scala.Console.readLine() == "y") { + if (scala.io.StdIn.readLine() == "y") { val basedir = (baseDirectory in ThisBuild).value val existing = basedir / "src/intellij" * "*.SAMPLE" IO.delete(existing.get) diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index 8456f91f8643..86d6658648a4 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -5,7 +5,6 @@ import sbt._ /** This object defines keys that should be visible with an unqualified name in all .sbt files and the command line */ object BuildSettings extends AutoPlugin { object autoImport { - lazy val antStyle = settingKey[Boolean]("Use ant-style incremental builds instead of name-hashing") lazy val baseVersion = settingKey[String]("The base version number from which all others are derived") lazy val baseVersionSuffix = settingKey[String]("Identifies the kind of version to build") lazy val mimaReferenceVersion = settingKey[Option[String]]("Scala version number to run MiMa against") diff --git a/project/Osgi.scala b/project/Osgi.scala index 596e33c8642f..c77866145505 100644 --- a/project/Osgi.scala +++ b/project/Osgi.scala @@ -2,7 +2,6 @@ package scala.build import aQute.bnd.osgi.Builder import aQute.bnd.osgi.Constants._ -import java.util.Properties import java.util.jar.Attributes import sbt._ import sbt.Keys._ diff --git a/project/PartestTestListener.scala b/project/PartestTestListener.scala index c7aa00641d7f..83d1e82aefd8 100644 --- a/project/PartestTestListener.scala +++ b/project/PartestTestListener.scala @@ -5,6 +5,7 @@ import java.util.concurrent.TimeUnit import sbt.testing.{SuiteSelector, TestSelector} import sbt.{JUnitXmlTestsListener, TestEvent, TestResult, TestsListener, _} +import sbt.internal.util.EscHelpers.removeEscapeSequences // The default JUnitXMLListener doesn't play well with partest: we end up clobbering the one-and-only partest.xml // file on group of tests run by `testAll`, and the test names in the XML file don't seem to show the path to the @@ -21,9 +22,9 @@ class PartestTestListener(target: File) extends TestsListener { val skipStatus = EnumSet.of(TStatus.Skipped, TStatus.Ignored) override def doInit(): Unit = () - override def doComplete(finalResult: TestResult.Value): Unit = () + override def doComplete(finalResult: TestResult): Unit = () override def endGroup(name: String, t: Throwable): Unit = () - override def endGroup(name: String, result: TestResult.Value): Unit = () + override def endGroup(name: String, result: TestResult): Unit = () override def testEvent(event: TestEvent): Unit = { // E.g "test.files.pos" or "test.scaladoc.run" def groupOf(e: sbt.testing.Event) = { @@ -62,7 +63,7 @@ class PartestTestListener(target: File) extends TestsListener { val writer = new PrintWriter(stringWriter) e.throwable.get.printStackTrace(writer) writer.flush() - ConsoleLogger.removeEscapeSequences(stringWriter.toString) + removeEscapeSequences(stringWriter.toString) } else { "" } @@ -70,13 +71,13 @@ class PartestTestListener(target: File) extends TestsListener { {e.status match { case TStatus.Error if e.throwable.isDefined => - + {trace} case TStatus.Error => case TStatus.Failure if e.throwable.isDefined => - + {trace} case TStatus.Failure => diff --git a/project/PartestUtil.scala b/project/PartestUtil.scala index 40031192e494..423c08eeb1e3 100644 --- a/project/PartestUtil.scala +++ b/project/PartestUtil.scala @@ -10,7 +10,7 @@ object PartestUtil { private def testCaseFinder = (testBase / srcPath).*(AllPassFilter).*(testCaseFilter) private val basePaths = allTestCases.map(_._2.split('/').take(3).mkString("/") + "/").distinct - def allTestCases = testCaseFinder.pair(relativeTo(globalBase)) + def allTestCases = testCaseFinder.pair(io.Path.relativeTo(globalBase)) def basePathExamples = new FixedSetExamples(basePaths) private def equiv(f1: File, f2: File) = f1.getCanonicalFile == f2.getCanonicalFile def parentChain(f: File): Iterator[File] = diff --git a/project/Quiet.scala b/project/Quiet.scala index 8ae08ad5a65a..5e9f37a717a8 100644 --- a/project/Quiet.scala +++ b/project/Quiet.scala @@ -2,32 +2,11 @@ package scala.build import sbt._ import Keys._ +import java.util.function.Supplier object Quiet { // Workaround sbt issue described: // // https://github.com/scala/scala-dev/issues/100 - def silenceScalaBinaryVersionWarning = ivyConfiguration := { - ivyConfiguration.value match { - case c: InlineIvyConfiguration => - val delegate = c.log - val logger = new Logger { - override def trace(t: => Throwable): Unit = delegate.trace(t) - override def log(level: sbt.Level.Value, message: => String): Unit = { - level match { - case sbt.Level.Warn => - val message0 = message - val newLevel = if (message.contains("differs from Scala binary version in project")) - delegate.log(sbt.Level.Debug, message) - else - delegate.log(level, message) - case _ => delegate.log(level, message) - } - } - override def success(message: => String): Unit = delegate.success(message) - } - new InlineIvyConfiguration(c.paths, c.resolvers, c.otherResolvers, c.moduleConfigurations, c.localOnly, c.lock, c.checksums, c.resolutionCacheDir, c.updateOptions, logger) - case x => x - } - } + def silenceScalaBinaryVersionWarning = scalaModuleInfo ~= (x => x.map(_.withCheckExplicit(false))) } diff --git a/project/ScriptCommands.scala b/project/ScriptCommands.scala index ebdf0f04b399..080b0073ad34 100644 --- a/project/ScriptCommands.scala +++ b/project/ScriptCommands.scala @@ -111,14 +111,7 @@ object ScriptCommands { def enableOptimizerCommand = setup("enableOptimizer")(_ => enableOptimizer) private[this] def setup(name: String)(f: Seq[String] => Seq[Setting[_]]) = Command.args(name, name) { case (state, seq) => - // `Project.extract(state).append(f(seq), state)` would be simpler, but it - // takes the project's initial state and discards all changes that were made in the sbt console. - val session = Project.session(state) - val extracted = Project.extract(state) - val settings = f(seq) - val appendSettings = Load.transformSettings(Load.projectScope(extracted.currentRef), extracted.currentRef.build, extracted.rootProject, settings) - val newStructure = Load.reapply(session.mergeSettings ++ appendSettings, extracted.structure)(extracted.showKey) - Project.setProject(session, newStructure, state) + Project.extract(state).appendWithSession(f(seq), state) } val enableOptimizer = Seq( diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala index 99e5285981a8..592a223f7f6e 100644 --- a/project/VersionUtil.scala +++ b/project/VersionUtil.scala @@ -1,10 +1,13 @@ package scala.build -import sbt.{stringToProcess => _, _} +import sbt._ import Keys._ import java.util.{Date, Locale, Properties, TimeZone} import java.io.{File, FileInputStream} import java.text.SimpleDateFormat +import java.time.Instant +import java.time.format.DateTimeFormatter +import java.time.temporal.{TemporalAccessor, TemporalQueries, TemporalQuery} import scala.collection.JavaConverters._ import BuildSettings.autoImport._ @@ -71,8 +74,21 @@ object VersionUtil { val db = new FileRepositoryBuilder().findGitDir.build val head = db.resolve("HEAD") if (head eq null) { - log.info("No git HEAD commit found -- Using current date and 'unknown' SHA") - (new Date, "unknown") + import scala.sys.process._ + try { + // Workaround lack of git worktree support in JGit https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 + val sha = List("git", "rev-parse", "HEAD").!!.trim + val commitDateIso = List("git", "log", "-1", "--format=%cI", "HEAD").!!.trim + val date = java.util.Date.from(DateTimeFormatter.ISO_DATE_TIME.parse(commitDateIso, new TemporalQuery[Instant] { + override def queryFrom(temporal: TemporalAccessor): Instant = Instant.from(temporal) + })) + (date, sha.substring(0, 7)) + } catch { + case ex: Exception => + ex.printStackTrace() + log.info("No git HEAD commit found -- Using current date and 'unknown' SHA") + (new Date, "unknown") + } } else { val commit = new RevWalk(db).parseCommit(head) (new Date(commit.getCommitTime.toLong * 1000L), commit.getName.substring(0, 7)) @@ -109,7 +125,6 @@ object VersionUtil { * suffix is used for releases. All other suffix values are treated as RC / milestone builds. The special suffix * value "SPLIT" is used to split the real suffix off from `baseVersion` instead and then apply the usual logic. */ private lazy val versionPropertiesImpl: Def.Initialize[Versions] = Def.setting { - val log = sLog.value val (date, sha) = (gitProperties.value.date, gitProperties.value.sha) val (base, suffix) = { diff --git a/project/build.properties b/project/build.properties index 8e682c526d5d..a82bb05e1295 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.18 +sbt.version=1.3.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index a3442552e679..15fe7394f6ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -scalacOptions ++= Seq("-unchecked", "-feature"/*, "-deprecation"*/, "-Xlint" /*, "-Xfatal-warnings"*/) +scalacOptions ++= Seq("-unchecked", "-feature"/*, "-deprecation", "-Xlint" , "-Xfatal-warnings"*/) libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.3.2" @@ -18,7 +18,7 @@ buildInfoKeys := Seq[BuildInfoKey](buildClasspath) buildInfoPackage := "scalabuild" -addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.1.18") +addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.6.1") libraryDependencies ++= Seq( "org.eclipse.jgit" % "org.eclipse.jgit" % "4.6.0.201612231935-r", diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 04935e456021..22366532fc04 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.6.1") +addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.7.0") diff --git a/scripts/common b/scripts/common index 75a27aca03bb..ec40463791dc 100644 --- a/scripts/common +++ b/scripts/common @@ -15,7 +15,7 @@ rm -rf "$WORKSPACE/resolutionScratch_" mkdir -p "$WORKSPACE/resolutionScratch_" SBT_CMD=${SBT_CMD-sbt} -SBT_CMD="$SBT_CMD -sbt-version 0.13.18" +SBT_CMD="$SBT_CMD -sbt-version 1.3.7" # repo to publish builds integrationRepoUrl=${integrationRepoUrl-"https://scala-ci.typesafe.com/artifactory/scala-integration/"} diff --git a/scripts/jobs/integrate/windows b/scripts/jobs/integrate/windows index 2ed88c55589d..6eac136fa8af 100755 --- a/scripts/jobs/integrate/windows +++ b/scripts/jobs/integrate/windows @@ -10,8 +10,8 @@ generateRepositoriesConfig SBT="java $JAVA_OPTS -Dsbt.ivy.home=$WORKSPACE/.ivy2 -jar $sbtLauncher -Dsbt.override.build.repos=true -Dsbt.repository.config=$sbtRepositoryConfig" # Build locker with STARR -$SBT --warn "setupPublishCore" generateBuildCharacterPropertiesFile publishLocal +$SBT -warn "setupPublishCore" generateBuildCharacterPropertiesFile publishLocal # Build quick and run the tests parseScalaProperties buildcharacter.properties -$SBT -Dstarr.version=$maven_version_number --warn "setupValidateTest" testAll +$SBT -Dstarr.version=$maven_version_number -warn "setupValidateTest" testAll diff --git a/scripts/jobs/validate/publish-core b/scripts/jobs/validate/publish-core index 1b1f4bed9880..ff9cbc2c9c58 100755 --- a/scripts/jobs/validate/publish-core +++ b/scripts/jobs/validate/publish-core @@ -17,7 +17,7 @@ case $prDryRun in ;; *) echo ">>> Getting Scala version number." - $SBT --warn "setupPublishCore $prRepoUrl" generateBuildCharacterPropertiesFile + $SBT -warn "setupPublishCore $prRepoUrl" generateBuildCharacterPropertiesFile parseScalaProperties buildcharacter.properties # produce maven_version_number echo ">>> Checking availability of Scala ${maven_version_number} in $prRepoUrl." @@ -28,7 +28,7 @@ case $prDryRun in if $libraryAvailable && $reflectAvailable && $compilerAvailable; then echo "Scala core already built!" else - $SBT --warn "setupPublishCore $prRepoUrl" publish + $SBT -warn "setupPublishCore $prRepoUrl" publish fi mv buildcharacter.properties jenkins.properties # parsed by the jenkins job diff --git a/scripts/jobs/validate/test b/scripts/jobs/validate/test index a155df4ce04e..7dd61c837bcc 100755 --- a/scripts/jobs/validate/test +++ b/scripts/jobs/validate/test @@ -18,7 +18,7 @@ case $prDryRun in # and run JUnit tests, ScalaCheck tests, partest, OSGi tests, MiMa and scaladoc $SBT \ -Dstarr.version=$scalaVersion \ - --warn \ + -warn \ "setupValidateTest $prRepoUrl" \ $testExtraArgs \ testAll diff --git a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala index edc427854edf..3d3a6b31881b 100644 --- a/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala +++ b/src/compiler/scala/tools/nsc/classpath/DirectoryClassPath.scala @@ -230,7 +230,7 @@ final class JrtClassPath(fs: java.nio.file.FileSystem) extends ClassPath with No final class CtSymClassPath(ctSym: java.nio.file.Path, release: Int) extends ClassPath with NoSourcePaths with Closeable { import java.nio.file.Path, java.nio.file._ - private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null) + private val fileSystem: FileSystem = FileSystems.newFileSystem(ctSym, null: ClassLoader) private val root: Path = fileSystem.getRootDirectories.iterator().next private val roots = Files.newDirectoryStream(root).iterator().asScala.toList diff --git a/src/intellij/junit.iml.SAMPLE b/src/intellij/junit.iml.SAMPLE index dc0dd9c1199d..f830c904e97c 100644 --- a/src/intellij/junit.iml.SAMPLE +++ b/src/intellij/junit.iml.SAMPLE @@ -1,6 +1,6 @@ - + diff --git a/src/intellij/repl.iml.SAMPLE b/src/intellij/repl.iml.SAMPLE index 07e2923726e5..6c15026a084b 100644 --- a/src/intellij/repl.iml.SAMPLE +++ b/src/intellij/repl.iml.SAMPLE @@ -1,6 +1,6 @@ - + diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index fdad3dbe6895..4d6d15b66380 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -18,8 +18,8 @@ - @@ -154,6 +154,27 @@ + + @@ -208,7 +229,6 @@ - @@ -222,21 +242,21 @@ - - - - - - - - - - - - + + + + + + + + + + + + - - + + @@ -447,7 +467,6 @@ - - + \ No newline at end of file diff --git a/src/library/mima-filters/2.12.0.backwards.excludes b/src/library/mima-filters/2.12.0.backwards.excludes deleted file mode 100644 index 7cc922be8b8a..000000000000 --- a/src/library/mima-filters/2.12.0.backwards.excludes +++ /dev/null @@ -1,11 +0,0 @@ -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.Vector.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorBuilder.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorPointer.debug") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.VectorIterator.debug") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.OpenHashMap.nextPositivePowerOfTwo") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.powerOfTwo") - -ProblemFilters.exclude[MissingClassProblem]("scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.getExitValue") \ No newline at end of file diff --git a/src/library/mima-filters/2.12.0.forwards.excludes b/src/library/mima-filters/2.12.0.forwards.excludes deleted file mode 100644 index cc58a3aa0152..000000000000 --- a/src/library/mima-filters/2.12.0.forwards.excludes +++ /dev/null @@ -1,62 +0,0 @@ -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureValue") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.sys.process.ProcessImpl#CompoundProcess.futureThread") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.mutable.HashTable.nextPositivePowerOfTwo") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedBytesHash") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.wrappedArrayHash") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.contains0") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.contains0") - -ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix$") -ProblemFilters.exclude[MissingClassProblem]("scala.annotation.showAsInfix") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.PropertiesTrait.coloredOutputEnabled") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.Properties.coloredOutputEnabled") - -# https://github.com/scala/scala/pull/6101 -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyRef") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyDouble") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyChar") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyUnit") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyShort") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyInt") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyByte") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyLong") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyBoolean") -ProblemFilters.exclude[MissingTypesProblem]("scala.runtime.LazyFloat") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyRef.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyDouble.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyChar.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyUnit.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyShort.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyInt.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyByte.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyLong.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyBoolean.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.runtime.LazyFloat.serialVersionUID") - -# https://github.com/scala/scala/pull/6138 -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#EmptyMap.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map1.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map2.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map3.serialVersionUID") -ProblemFilters.exclude[MissingFieldProblem]("scala.collection.immutable.Map#Map4.serialVersionUID") -ProblemFilters.exclude[DirectAbstractMethodProblem]("scala.collection.GenTraversableOnce.toList") - - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap.foreachEntry") -ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.Map$HashCodeAccumulator") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.RedBlackTree.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashTrieMap.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.ListMap.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMap1.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.collection.immutable.HashMap#HashMapCollision1.foreachEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.product2Hash") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.util.hashing.MurmurHash3.emptyMapHash") - -ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.HashMap$HashMapKeys") -ProblemFilters.exclude[MissingClassProblem]("scala.collection.immutable.HashMap$HashMapValues") \ No newline at end of file diff --git a/src/library/scala/collection/GenIterableLike.scala b/src/library/scala/collection/GenIterableLike.scala index ab63ebee5a0d..e5d78f089c5b 100644 --- a/src/library/scala/collection/GenIterableLike.scala +++ b/src/library/scala/collection/GenIterableLike.scala @@ -147,3 +147,13 @@ trait GenIterableLike[+A, +Repr] extends Any with GenTraversableLike[A, Repr] { def zipAll[B, A1 >: A, That](that: GenIterable[B], thisElem: A1, thatElem: B)(implicit bf: CBF[Repr, (A1, B), That]): That } + +// Workaround for Scaladoc @usecase position bug scala/issues#11865 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/reflect/mima-filters/2.12.0.backwards.excludes b/src/reflect/mima-filters/2.12.0.backwards.excludes deleted file mode 100644 index dc5e85d4c5be..000000000000 --- a/src/reflect/mima-filters/2.12.0.backwards.excludes +++ /dev/null @@ -1,26 +0,0 @@ -ProblemFilters.exclude[Problem]("scala.reflect.internal.*") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass") -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps#SynchronizedBaseTypeSeq.lateMap") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$exists") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$getFlag") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$privateWithin") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$annotations") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.IOStats$") - -ProblemFilters.exclude[MissingTypesProblem]("scala.reflect.runtime.JavaUniverse") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.io.ZipArchive.close") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs") -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.scala$reflect$runtime$SynchronizedSymbols$SynchronizedSymbol$$super$typeConstructor") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized") diff --git a/src/reflect/mima-filters/2.12.0.forwards.excludes b/src/reflect/mima-filters/2.12.0.forwards.excludes deleted file mode 100644 index e36b1c3f8221..000000000000 --- a/src/reflect/mima-filters/2.12.0.forwards.excludes +++ /dev/null @@ -1,52 +0,0 @@ -ProblemFilters.exclude[Problem]("scala.reflect.internal.*") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.unpickleClass") -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.runtime.SymbolLoaders#TopClassCompleter.this") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.Yvirtpatmat") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.PlainNioFile") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedOps.newMappedBaseTypeSeq") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.newMappedBaseTypeSeq") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.statistics") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror#JavaAnnotationProxy.transformArgs") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LazyEntry") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.closeZipFile") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.FileZipArchive$LeakyEntry") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.exists") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.getFlag") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.privateWithin") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.annotations") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.Settings.isScala213") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.this") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.this") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.allDirsByDottedName") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.io.RootPath$") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.URLZipArchive.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.FileZipArchive.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ManifestResources.close") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive.close") - -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaMirrors#JavaMirror.typeTag") -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.runtime.JavaMirrors$JavaMirror$typeTagCache$") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.TypeTags.TypeTagImpl") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.api.Universe.TypeTagImpl") - -ProblemFilters.exclude[MissingClassProblem]("scala.reflect.macros.Attachments$") - -ProblemFilters.exclude[IncompatibleMethTypeProblem]("scala.reflect.io.ZipArchive.getDir") -ProblemFilters.exclude[IncompatibleResultTypeProblem]("scala.reflect.io.FileZipArchive.allDirs") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedSymbols#SynchronizedSymbol.typeConstructor") - -ProblemFilters.exclude[ReversedMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.scala$reflect$runtime$SynchronizedTypes$$super$defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.SynchronizedTypes.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.runtime.JavaUniverse.defineNormalized") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.AbstractFile.unsafeToByteArray") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.VirtualFile.unsafeToByteArray") -ProblemFilters.exclude[DirectMissingMethodProblem]("scala.reflect.io.ZipArchive#Entry.unsafeToByteArray") \ No newline at end of file diff --git a/test/benchmarks/.gitignore b/test/benchmarks/.gitignore index 78304b6b90e9..2f7896d1d136 100644 --- a/test/benchmarks/.gitignore +++ b/test/benchmarks/.gitignore @@ -1,15 +1 @@ -/project/project/ -/project/target/ -/target/ - -# what appears to be a Scala IDE-generated file -.cache-main - -# standard Eclipse output directory -/bin/ -.idea - -# sbteclipse-generated Eclipse files -/.classpath -/.project -/.settings/ +target/ diff --git a/test/benchmarks/project/build.properties b/test/benchmarks/project/build.properties new file mode 100644 index 000000000000..a82bb05e1295 --- /dev/null +++ b/test/benchmarks/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.3.7 diff --git a/test/benchmarks/project/plugins.sbt b/test/benchmarks/project/plugins.sbt new file mode 100644 index 000000000000..b57429f738ec --- /dev/null +++ b/test/benchmarks/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27") diff --git a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala index c7e51386f81a..27f7ca5bcf38 100644 --- a/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala +++ b/test/junit/scala/tools/nsc/backend/jvm/NestedClassesCollectorTest.scala @@ -101,7 +101,7 @@ class NestedClassesCollectorTest { import java.nio.file._ import scala.collection.JavaConverters._ val zipfile = Paths.get("/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/jre/lib/rt.jar") - val fs = FileSystems.newFileSystem(zipfile, null) + val fs = FileSystems.newFileSystem(zipfile, null: ClassLoader) val root = fs.getRootDirectories.iterator().next() val contents = Files.walk(root).iterator().asScala.toList for (f <- contents if Files.isRegularFile(f) && f.getFileName.toString.endsWith(".class")) { @@ -126,7 +126,7 @@ class NestedClassesCollectorTest { import scala.collection.JavaConverters._ val zipfile = Paths.get(path) println(path) - val fs = FileSystems.newFileSystem(zipfile, null) + val fs = FileSystems.newFileSystem(zipfile, null: ClassLoader) val root = fs.getRootDirectories.iterator().next() val contents = Files.walk(root).iterator().asScala.toList for (f <- contents if Files.isRegularFile(f) && f.getFileName.toString.endsWith(".class")) {