mirror of https://github.com/sbt/sbt.git
commit
5ca27512ca
|
|
@ -954,6 +954,7 @@ lazy val mainProj = (project in file("main"))
|
||||||
exclude[IncompatibleTemplateDefProblem]("sbt.internal.server.LanguageServerProtocol"),
|
exclude[IncompatibleTemplateDefProblem]("sbt.internal.server.LanguageServerProtocol"),
|
||||||
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocol"),
|
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocol"),
|
||||||
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocolInModules"),
|
exclude[DirectMissingMethodProblem]("sbt.Classpaths.warnInsecureProtocolInModules"),
|
||||||
|
exclude[MissingClassProblem]("sbt.internal.ExternalHooks*"),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.configure(
|
.configure(
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,13 @@ object Defaults extends BuildCommon {
|
||||||
val ih = app.provider.scalaProvider.launcher.ivyHome
|
val ih = app.provider.scalaProvider.launcher.ivyHome
|
||||||
val coursierCache = csrCacheDirectory.value
|
val coursierCache = csrCacheDirectory.value
|
||||||
val javaHome = Paths.get(sys.props("java.home"))
|
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),
|
fileConverter := MappedFileConverter(rootPaths.value, allowMachinePath.value),
|
||||||
fullServerHandlers := {
|
fullServerHandlers := {
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ object Keys {
|
||||||
private[sbt] val externalHooks = taskKey[ExternalHooks]("The external hooks used by zinc.")
|
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 fileConverter = settingKey[FileConverter]("The file converter used to convert between Path and VirtualFile")
|
||||||
val allowMachinePath = settingKey[Boolean]("Allow machine-specific paths during conversion.")
|
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 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.")
|
private[sbt] val reusableStamper = settingKey[ReadStamps]("The stamper can be reused across subprojects and sessions.")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
* Licensed under Apache License 2.0 (see LICENSE)
|
* Licensed under Apache License 2.0 (see LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
package sbt.internal
|
package sbt.internal
|
||||||
|
|
||||||
import java.nio.file.{ Path, Paths }
|
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.nio.{ FileChanges, FileStamp, FileStamper }
|
||||||
import sbt.util.InterfaceUtil.jo2o
|
import sbt.util.InterfaceUtil.jo2o
|
||||||
import xsbti.{ VirtualFile, VirtualFileRef }
|
import xsbti.{ VirtualFile, VirtualFileRef }
|
||||||
|
import xsbti.api.AnalyzedClass
|
||||||
import xsbti.compile._
|
import xsbti.compile._
|
||||||
import xsbti.compile.analysis.Stamp
|
import xsbti.compile.analysis.Stamp
|
||||||
|
|
||||||
|
|
@ -160,7 +162,9 @@ private[sbt] object ExternalHooks {
|
||||||
}
|
}
|
||||||
}.toSet)
|
}.toSet)
|
||||||
}
|
}
|
||||||
|
override def lookupAnalyzedClass(binaryClassName: String): Option[AnalyzedClass] = None
|
||||||
}
|
}
|
||||||
new DefaultExternalHooks(Optional.of(lookup), Optional.empty[ClassFileManager])
|
new DefaultExternalHooks(Optional.of(lookup), Optional.empty[ClassFileManager])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,21 @@ import sbt.internal.util.complete.SizeParser
|
||||||
// See also LineReader.scala
|
// See also LineReader.scala
|
||||||
object SysProp {
|
object SysProp {
|
||||||
def booleanOpt(name: String): Option[Boolean] =
|
def booleanOpt(name: String): Option[Boolean] =
|
||||||
sys.props.get(name).flatMap { x =>
|
sys.props.get(name) match {
|
||||||
x.toLowerCase(Locale.ENGLISH) 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 "1" | "always" | "true" => Some(true)
|
||||||
case "0" | "never" | "false" => Some(false)
|
case "0" | "never" | "false" => Some(false)
|
||||||
case "auto" => None
|
case "auto" => None
|
||||||
case _ => None
|
case _ => None
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
def getOrFalse(name: String): Boolean = booleanOpt(name).getOrElse(false)
|
def getOrFalse(name: String): Boolean = booleanOpt(name).getOrElse(false)
|
||||||
def getOrTrue(name: String): Boolean = booleanOpt(name).getOrElse(true)
|
def getOrTrue(name: String): Boolean = booleanOpt(name).getOrElse(true)
|
||||||
|
|
@ -71,6 +78,7 @@ object SysProp {
|
||||||
def ci: Boolean = getOrFalse("sbt.ci")
|
def ci: Boolean = getOrFalse("sbt.ci")
|
||||||
def allowRootDir: Boolean = getOrFalse("sbt.rootdir")
|
def allowRootDir: Boolean = getOrFalse("sbt.rootdir")
|
||||||
def legacyTestReport: Boolean = getOrFalse("sbt.testing.legacyreport")
|
def legacyTestReport: Boolean = getOrFalse("sbt.testing.legacyreport")
|
||||||
|
def semanticdb: Boolean = getOrFalse("sbt.semanticdb")
|
||||||
|
|
||||||
def watchMode: String =
|
def watchMode: String =
|
||||||
sys.props.get("sbt.watch.mode").getOrElse("auto")
|
sys.props.get("sbt.watch.mode").getOrElse("auto")
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ package sbt
|
||||||
package plugins
|
package plugins
|
||||||
|
|
||||||
import Keys._
|
import Keys._
|
||||||
|
import sbt.internal.SysProp
|
||||||
import sbt.librarymanagement.syntax._
|
import sbt.librarymanagement.syntax._
|
||||||
import sbt.librarymanagement.CrossVersion
|
import sbt.librarymanagement.CrossVersion
|
||||||
import Project.inConfig
|
import Project.inConfig
|
||||||
|
|
@ -18,10 +19,10 @@ object SemanticdbPlugin extends AutoPlugin {
|
||||||
override def trigger = allRequirements
|
override def trigger = allRequirements
|
||||||
|
|
||||||
override lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
|
override lazy val globalSettings: Seq[Def.Setting[_]] = Seq(
|
||||||
semanticdbEnabled := false,
|
semanticdbEnabled := SysProp.semanticdb,
|
||||||
semanticdbIncludeInJar := false,
|
semanticdbIncludeInJar := false,
|
||||||
semanticdbOptions := List("-Yrangepos"),
|
semanticdbOptions := List("-Yrangepos"),
|
||||||
semanticdbVersion := "4.3.7"
|
semanticdbVersion := "4.3.15"
|
||||||
)
|
)
|
||||||
|
|
||||||
override lazy val projectSettings: Seq[Def.Setting[_]] = Seq(
|
override lazy val projectSettings: Seq[Def.Setting[_]] = Seq(
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ object Dependencies {
|
||||||
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M6")
|
private val ioVersion = nightlyVersion.getOrElse("1.4.0-M6")
|
||||||
private val lmVersion =
|
private val lmVersion =
|
||||||
sys.props.get("sbt.build.lm.version").orElse(nightlyVersion).getOrElse("1.4.0-M1")
|
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
|
private val sbtIO = "org.scala-sbt" %% "io" % ioVersion
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ TaskKey[Unit]("checkJavaFailures") := {
|
||||||
// First error should be on a specific line/file
|
// First error should be on a specific line/file
|
||||||
val first = ps(0)
|
val first = ps(0)
|
||||||
assert(first.position.line.get == 3, s"First failure position is not line 3, failure = $first")
|
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
|
val sourcePath = first.position.sourcePath.get
|
||||||
assert(sourcePath == expected, s"$sourcePath == $expected was false")
|
assert(sourcePath == expected, s"$sourcePath == $expected was false")
|
||||||
}
|
}
|
||||||
|
|
@ -19,7 +19,7 @@ TaskKey[Unit]("checkScalaFailures") := {
|
||||||
// First error should be on a specific line/file
|
// First error should be on a specific line/file
|
||||||
val first = ps(0)
|
val first = ps(0)
|
||||||
assert(first.position.line.get == 2, s"First failure position is not line 2, failure = $first")
|
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
|
val sourcePath = first.position.sourcePath.get
|
||||||
assert(sourcePath == expected, s"$sourcePath == $expected was false")
|
assert(sourcePath == expected, s"$sourcePath == $expected was false")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue