Merge pull request #5613 from eed3si9n/wip/bumpzinc

Zinc 1.4.0-M6
This commit is contained in:
eugene yokota 2020-06-14 17:58:22 -04:00 committed by GitHub
commit 5ca27512ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 34 additions and 14 deletions

View File

@ -954,6 +954,7 @@ lazy val mainProj = (project in file("main"))
exclude[IncompatibleTemplateDefProblem]("sbt.internal.server.LanguageServerProtocol"),
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocol"),
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocolInModules"),
exclude[MissingClassProblem]("sbt.internal.ExternalHooks*"),
)
)
.configure(

View File

@ -196,7 +196,13 @@ object Defaults extends BuildCommon {
val ih = app.provider.scalaProvider.launcher.ivyHome
val coursierCache = csrCacheDirectory.value
val javaHome = Paths.get(sys.props("java.home"))
Vector(base.toPath, boot.toPath, coursierCache.toPath, ih.toPath, javaHome)
Map(
"BASE" -> base.toPath,
"SBT_BOOT" -> boot.toPath,
"CSR_CACHE" -> coursierCache.toPath,
"IVY_HOME" -> ih.toPath,
"JAVA_HOME" -> javaHome,
)
},
fileConverter := MappedFileConverter(rootPaths.value, allowMachinePath.value),
fullServerHandlers := {

View File

@ -222,7 +222,7 @@ object Keys {
private[sbt] val externalHooks = taskKey[ExternalHooks]("The external hooks used by zinc.")
val fileConverter = settingKey[FileConverter]("The file converter used to convert between Path and VirtualFile")
val allowMachinePath = settingKey[Boolean]("Allow machine-specific paths during conversion.")
val rootPaths = settingKey[Seq[NioPath]]("The root paths used to abstract machine-specific paths.")
val rootPaths = settingKey[Map[String, NioPath]]("The root paths used to abstract machine-specific paths.")
private[sbt] val uncachedStamper = settingKey[ReadStamps]("The stamper to create timestamp or hash.")
private[sbt] val reusableStamper = settingKey[ReadStamps]("The stamper can be reused across subprojects and sessions.")

View File

@ -5,6 +5,7 @@
* Licensed under Apache License 2.0 (see LICENSE)
*/
/*
package sbt.internal
import java.nio.file.{ Path, Paths }
@ -20,6 +21,7 @@ import sbt.nio.file.{ FileAttributes, FileTreeView, RecursiveGlob }
import sbt.nio.{ FileChanges, FileStamp, FileStamper }
import sbt.util.InterfaceUtil.jo2o
import xsbti.{ VirtualFile, VirtualFileRef }
import xsbti.api.AnalyzedClass
import xsbti.compile._
import xsbti.compile.analysis.Stamp
@ -160,7 +162,9 @@ private[sbt] object ExternalHooks {
}
}.toSet)
}
override def lookupAnalyzedClass(binaryClassName: String): Option[AnalyzedClass] = None
}
new DefaultExternalHooks(Optional.of(lookup), Optional.empty[ClassFileManager])
}
}
*/

View File

@ -18,13 +18,20 @@ import sbt.internal.util.complete.SizeParser
// See also LineReader.scala
object SysProp {
def booleanOpt(name: String): Option[Boolean] =
sys.props.get(name).flatMap { x =>
x.toLowerCase(Locale.ENGLISH) match {
case "1" | "always" | "true" => Some(true)
case "0" | "never" | "false" => Some(false)
case "auto" => None
case _ => None
}
sys.props.get(name) match {
case Some(x) => parseBoolean(x)
case _ =>
sys.env.get(name.toUpperCase(Locale.ENGLISH).replace('.', '_')) match {
case Some(x) => parseBoolean(x)
case _ => None
}
}
private def parseBoolean(value: String): Option[Boolean] =
value.toLowerCase(Locale.ENGLISH) match {
case "1" | "always" | "true" => Some(true)
case "0" | "never" | "false" => Some(false)
case "auto" => None
case _ => None
}
def getOrFalse(name: String): Boolean = booleanOpt(name).getOrElse(false)
@ -71,6 +78,7 @@ object SysProp {
def ci: Boolean = getOrFalse("sbt.ci")
def allowRootDir: Boolean = getOrFalse("sbt.rootdir")
def legacyTestReport: Boolean = getOrFalse("sbt.testing.legacyreport")
def semanticdb: Boolean = getOrFalse("sbt.semanticdb")
def watchMode: String =
sys.props.get("sbt.watch.mode").getOrElse("auto")

View File

@ -9,6 +9,7 @@ package sbt
package plugins
import Keys._
import sbt.internal.SysProp
import sbt.librarymanagement.syntax._
import sbt.librarymanagement.CrossVersion
import Project.inConfig
@ -18,10 +19,10 @@ object SemanticdbPlugin extends AutoPlugin {
override def trigger = allRequirements
override lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
semanticdbEnabled := false,
semanticdbEnabled := SysProp.semanticdb,
semanticdbIncludeInJar := false,
semanticdbOptions := List("-Yrangepos"),
semanticdbVersion := "4.3.7"
semanticdbVersion := "4.3.15"
)
override lazy val projectSettings: Seq[Def.Setting[_]] = Seq(

View File

@ -14,7 +14,7 @@ object Dependencies {
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M6")
private val lmVersion =
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.4.0-M1")
val zincVersion = nightlyVersion.getOrElse("1.4.0-M5")
val zincVersion = nightlyVersion.getOrElse("1.4.0-M6")
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion

View File

@ -6,7 +6,7 @@ TaskKey[Unit]("checkJavaFailures") := {
// First error should be on a specific line/file
val first = ps(0)
assert(first.position.line.get == 3, s"First failure position is not line 3, failure = $first")
val expected = "${0}/src/main/java/bad.java"
val expected = "${BASE}/src/main/java/bad.java"
val sourcePath = first.position.sourcePath.get
assert(sourcePath == expected, s"$sourcePath == $expected was false")
}
@ -19,7 +19,7 @@ TaskKey[Unit]("checkScalaFailures") := {
// First error should be on a specific line/file
val first = ps(0)
assert(first.position.line.get == 2, s"First failure position is not line 2, failure = $first")
val expected = "${0}/src/main/scala/bad.scala"
val expected = "${BASE}/src/main/scala/bad.scala"
val sourcePath = first.position.sourcePath.get
assert(sourcePath == expected, s"$sourcePath == $expected was false")
}