Merge pull request #6146 from eatkins/metabuild

Prepend scala instance jars to sbt classpath
This commit is contained in:
eugene yokota 2020-11-20 23:17:42 -05:00 committed by GitHub
commit a84d3329aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 4 deletions

View File

@ -1362,7 +1362,9 @@ def scriptedTask(launch: Boolean): Def.Initialize[InputTask[Unit]] = Def.inputTa
scriptedLaunchOpts.value ++ (if (launch) Some(launchJar) else None),
scalaVersion.value,
version.value,
(scriptedSbtReduxProj / Test / fullClasspathAsJars).value.map(_.data),
(scriptedSbtReduxProj / Test / fullClasspathAsJars).value
.map(_.data)
.filterNot(_.getName.contains("scala-compiler")),
streams.value.log
)
}

View File

@ -2506,14 +2506,15 @@ object Classpaths {
val isMeta = isMetaBuild.value
val force = reresolveSbtArtifacts.value
val app = appConfiguration.value
val sbtCp0 = app.provider.mainClasspath.toList
val sbtCp = sbtCp0 map { Attributed.blank(_) }
def isJansiOrJLine(f: File) = f.getName.contains("jline") || f.getName.contains("jansi")
val scalaInstanceJars = app.provider.scalaProvider.jars.filterNot(isJansiOrJLine)
val sbtCp = (scalaInstanceJars ++ app.provider.mainClasspath).map(Attributed.blank)
val mjars = managedJars(
classpathConfiguration.value,
classpathTypes.value,
update.value
)
if (isMeta && !force) mjars ++ sbtCp
if (isMeta && !force) (mjars ++ sbtCp).distinct
else mjars
},
exportedProducts := ClasspathImpl.trackedExportedProducts(TrackLevel.TrackAlways).value,

View File

@ -0,0 +1,3 @@
import scala.tools.nsc
object Plugin

View File

@ -0,0 +1,2 @@
> show sbtVersion
# we just want to test that the project loads