mirror of https://github.com/sbt/sbt.git
Manage .tasty files in Scala 3
This commit is contained in:
parent
08b83d6b31
commit
2d75cbd3b9
|
|
@ -88,6 +88,7 @@ import sbt.util.InterfaceUtil.{ t2, toJavaFunction => f1 }
|
||||||
import sbt.util._
|
import sbt.util._
|
||||||
import sjsonnew._
|
import sjsonnew._
|
||||||
import sjsonnew.support.scalajson.unsafe.Converter
|
import sjsonnew.support.scalajson.unsafe.Converter
|
||||||
|
import xsbti.compile.TastyFiles
|
||||||
import xsbti.{ FileConverter, Position }
|
import xsbti.{ FileConverter, Position }
|
||||||
|
|
||||||
import scala.collection.immutable.ListMap
|
import scala.collection.immutable.ListMap
|
||||||
|
|
@ -681,6 +682,7 @@ object Defaults extends BuildCommon {
|
||||||
// must be a val: duplication detected by object identity
|
// must be a val: duplication detected by object identity
|
||||||
private[this] lazy val compileBaseGlobal: Seq[Setting[_]] = globalDefaults(
|
private[this] lazy val compileBaseGlobal: Seq[Setting[_]] = globalDefaults(
|
||||||
Seq(
|
Seq(
|
||||||
|
auxiliaryClassFiles := Nil,
|
||||||
incOptions := IncOptions.of(),
|
incOptions := IncOptions.of(),
|
||||||
classpathOptions :== ClasspathOptionsUtil.boot,
|
classpathOptions :== ClasspathOptionsUtil.boot,
|
||||||
classpathOptions in console :== ClasspathOptionsUtil.repl,
|
classpathOptions in console :== ClasspathOptionsUtil.repl,
|
||||||
|
|
@ -876,9 +878,14 @@ object Defaults extends BuildCommon {
|
||||||
compileAnalysisTargetRoot.value / compileAnalysisFilename.value
|
compileAnalysisTargetRoot.value / compileAnalysisFilename.value
|
||||||
},
|
},
|
||||||
externalHooks := IncOptions.defaultExternal,
|
externalHooks := IncOptions.defaultExternal,
|
||||||
|
auxiliaryClassFiles ++= {
|
||||||
|
if (ScalaArtifacts.isScala3(scalaVersion.value)) List(TastyFiles.instance)
|
||||||
|
else Nil
|
||||||
|
},
|
||||||
incOptions := {
|
incOptions := {
|
||||||
val old = incOptions.value
|
val old = incOptions.value
|
||||||
old
|
old
|
||||||
|
.withAuxiliaryClassFiles(auxiliaryClassFiles.value.toArray)
|
||||||
.withExternalHooks(externalHooks.value)
|
.withExternalHooks(externalHooks.value)
|
||||||
.withClassfileManagerType(
|
.withClassfileManagerType(
|
||||||
Option(
|
Option(
|
||||||
|
|
|
||||||
|
|
@ -248,6 +248,7 @@ object Keys {
|
||||||
val aggregate = settingKey[Boolean]("Configures task aggregation.").withRank(BMinusSetting)
|
val aggregate = settingKey[Boolean]("Configures task aggregation.").withRank(BMinusSetting)
|
||||||
val sourcePositionMappers = taskKey[Seq[xsbti.Position => Option[xsbti.Position]]]("Maps positions in generated source files to the original source it was generated from").withRank(DTask)
|
val sourcePositionMappers = taskKey[Seq[xsbti.Position => Option[xsbti.Position]]]("Maps positions in generated source files to the original source it was generated from").withRank(DTask)
|
||||||
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 auxiliaryClassFiles = taskKey[Seq[AuxiliaryClassFiles]]("The auxiliary class files that must be managed by Zinc (for instance the TASTy files)")
|
||||||
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 reportAbsolutePath = settingKey[Boolean]("Report absolute paths during compilation.")
|
val reportAbsolutePath = settingKey[Boolean]("Report absolute paths during compilation.")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue