Some minor tweaks to get things moving

This commit is contained in:
Eugene Yokota 2022-09-25 01:29:05 -04:00
parent cba7a0efc3
commit 4f85c11e01
2 changed files with 12 additions and 8 deletions

View File

@ -39,11 +39,13 @@ class Eval(
backingDir.foreach { dir =>
Files.createDirectories(dir)
}
private val classpathString = classpath.map(_.toString).mkString(":")
private val outputDir =
backingDir match
case Some(dir) => PlainDirectory(Directory(dir.toString))
case None => VirtualDirectory("output")
private val classpathString = (backingDir.toList ++ classpath)
.map(_.toString)
.mkString(":")
private lazy val driver: EvalDriver = new EvalDriver
private lazy val reporter = mkReporter match
case Some(fn) => fn()
@ -142,9 +144,9 @@ class Eval(
valTypes: Seq[String],
extraHash: String,
): EvalDefinitions =
println(s"""evalDefinitions(definitions = $definitions)
classpath = $classpath
""")
// println(s"""evalDefinitions(definitions = $definitions)
// backingDir = $backingDir,
// """)
require(definitions.nonEmpty, "definitions to evaluate cannot be empty.")
val extraHash0 = extraHash
val ev = new EvalType[Seq[String]]:
@ -382,7 +384,7 @@ object Eval:
tree match
case tpd.ValDef(name, tpt, _)
if isTopLevelModule(tree.symbol.owner) && isAcceptableType(tpt.tpe) =>
vals ::= name.mangledString
vals ::= name.toString
case t: tpd.Template => this((), t.body)
case t: tpd.PackageDef => this((), t.stats)
case t: tpd.TypeDef => this((), t.rhs)

View File

@ -275,7 +275,9 @@ private[sbt] object Load {
Project.showLoadingKey(loaded)
)
}
Project.checkTargets(data) foreach sys.error
// todo: fix this
// Project.checkTargets(data) foreach sys.error
val index = timed("Load.apply: structureIndex", log) {
structureIndex(data, settings, loaded.extra(data), projects)
}
@ -1095,7 +1097,7 @@ private[sbt] object Load {
val allSettings = {
// TODO - This mechanism of applying settings could be off... It's in two places now...
lazy val defaultSbtFiles = configurationSources(p.base)
.map(_.toPath())
.map(_.getAbsoluteFile().toPath())
.map(converter.toVirtualFile)
lazy val sbtFiles: Seq[VirtualFile] = defaultSbtFiles ++ extraSbtFiles
// Filter the AutoPlugin settings we included based on which ones are
@ -1155,7 +1157,7 @@ private[sbt] object Load {
// Default sbt files to read, if needed
lazy val defaultSbtFiles = configurationSources(projectBase)
.map(_.toPath)
.map(_.getAbsoluteFile().toPath)
.map(converter.toVirtualFile)
lazy val sbtFiles = defaultSbtFiles ++ extraSbtFiles