always reresolve sbt artifacts when using Coursier

Ref #4589

This requires sbt server tests to resolve sbt off of local.
This commit is contained in:
Eugene Yokota 2019-04-27 12:52:55 -04:00
parent 96ad731e8c
commit f999f6a62e
3 changed files with 15 additions and 15 deletions

View File

@ -10,7 +10,7 @@ env:
# WHITESOURCE_PASSWORD=
- secure: d3bu2KNwsVHwfhbGgO+gmRfDKBJhfICdCJFGWKf2w3Gv86AJZX9nuTYRxz0KtdvEHO5Xw8WTBZLPb2thSJqhw9OCm4J8TBAVqCP0ruUj4+aqBUFy4bVexQ6WKE6nWHs4JPzPk8c6uC1LG3hMuzlC8RGETXtL/n81Ef1u7NjyXjs=
matrix:
- SBT_CMD=";mimaReportBinaryIssues ;scalafmtCheckAll ;headerCheck ;test:headerCheck ;whitesourceOnPush ;test:compile ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests; doc"
- SBT_CMD=";mimaReportBinaryIssues ;scalafmtCheckAll ;headerCheck ;test:headerCheck ;whitesourceOnPush ;test:compile; publishLocal ;mainSettingsProj/test ;safeUnitTests ;otherUnitTests; doc"
- SBT_CMD="scripted actions/*"
- SBT_CMD="scripted apiinfo/* compiler-project/* ivy-deps-management/*"
- SBT_CMD="scripted dependency-management/*1of4"

View File

@ -1916,6 +1916,7 @@ object Classpaths {
managedClasspath := {
val isMeta = isMetaBuild.value
val force = reresolveSbtArtifacts.value
val csr = useCoursier.value
val app = appConfiguration.value
val sbtCp0 = app.provider.mainClasspath.toList
val sbtCp = sbtCp0 map { Attributed.blank(_) }
@ -1924,7 +1925,7 @@ object Classpaths {
classpathTypes.value,
update.value
)
if (isMeta && !force) sbtCp ++ mjars
if (isMeta && !force && !csr) mjars ++ sbtCp
else mjars
},
exportedProducts := trackedExportedProducts(TrackLevel.TrackAlways).value,
@ -2448,19 +2449,18 @@ object Classpaths {
val isMeta = isMetaBuild.value
val force = reresolveSbtArtifacts.value
val excludes = excludeDependencies.value
val sbtModules = Vector(
"sbt",
"zinc_2.12",
"librarymanagement-core_2.12",
"librarymanagement-ivy_2.12",
"util-logging_2.12",
"util-position_2.12",
"io_2.12"
val csr = useCoursier.value
val o = sbtdeps.organization
val sbtModulesExcludes = Vector[ExclusionRule](
o % "sbt",
o %% "scripted-plugin",
o %% "librarymanagement-core",
o %% "librarymanagement-ivy",
o %% "util-logging",
o %% "util-position",
o %% "io"
)
val sbtModulesExcludes = sbtModules map { nm: String =>
ExclusionRule(organization = sbtdeps.organization, name = nm)
}
if (isMeta && !force) excludes.toVector ++ sbtModulesExcludes
if (isMeta && !force && !csr) excludes.toVector ++ sbtModulesExcludes
else excludes
},
dependencyOverrides ++= {

View File

@ -14,7 +14,7 @@ import xsbti._
import scala.sys.process.Process
object RunFromSourceMain {
private val sbtVersion = "1.1.4" // TestBuildInfo.version
private val sbtVersion = TestBuildInfo.version
private val scalaVersion = "2.12.6"
def fork(workingDirectory: File): Process = {