mirror of https://github.com/sbt/sbt.git
Merge pull request #5634 from eed3si9n/wip/missingok
Fixes missingOk under Coursier
This commit is contained in:
commit
9f9bb9daa2
|
|
@ -68,6 +68,55 @@ object LMCoursier {
|
|||
strict: Option[CStrict],
|
||||
depsOverrides: Seq[ModuleID],
|
||||
log: Logger
|
||||
): CoursierConfiguration =
|
||||
coursierConfiguration(
|
||||
rs,
|
||||
interProjectDependencies,
|
||||
extraProjects,
|
||||
fallbackDeps,
|
||||
appConfig,
|
||||
classifiers,
|
||||
profiles,
|
||||
scalaOrg,
|
||||
scalaVer,
|
||||
scalaBinaryVer,
|
||||
autoScalaLib,
|
||||
scalaModInfo,
|
||||
excludeDeps,
|
||||
credentials,
|
||||
createLogger,
|
||||
cacheDirectory,
|
||||
reconciliation,
|
||||
ivyHome,
|
||||
strict,
|
||||
depsOverrides,
|
||||
None,
|
||||
log
|
||||
)
|
||||
|
||||
def coursierConfiguration(
|
||||
rs: Seq[Resolver],
|
||||
interProjectDependencies: Seq[CProject],
|
||||
extraProjects: Seq[CProject],
|
||||
fallbackDeps: Seq[FallbackDependency],
|
||||
appConfig: AppConfiguration,
|
||||
classifiers: Option[Seq[Classifier]],
|
||||
profiles: Set[String],
|
||||
scalaOrg: String,
|
||||
scalaVer: String,
|
||||
scalaBinaryVer: String,
|
||||
autoScalaLib: Boolean,
|
||||
scalaModInfo: Option[ScalaModuleInfo],
|
||||
excludeDeps: Seq[InclExclRule],
|
||||
credentials: Seq[Credentials],
|
||||
createLogger: Option[CacheLogger],
|
||||
cacheDirectory: File,
|
||||
reconciliation: Seq[(ModuleMatchers, Reconciliation)],
|
||||
ivyHome: Option[File],
|
||||
strict: Option[CStrict],
|
||||
depsOverrides: Seq[ModuleID],
|
||||
updateConfig: Option[UpdateConfiguration],
|
||||
log: Logger
|
||||
): CoursierConfiguration = {
|
||||
val coursierExcludeDeps = Inputs
|
||||
.exclusions(
|
||||
|
|
@ -92,6 +141,10 @@ object LMCoursier {
|
|||
val userForceVersions = Inputs.forceVersions(depsOverrides, scalaVer, scalaBinaryVer)
|
||||
Classpaths.warnResolversConflict(rs, log)
|
||||
Classpaths.errorInsecureProtocol(rs, log)
|
||||
val missingOk = updateConfig match {
|
||||
case Some(uc) => uc.missingOk
|
||||
case _ => false
|
||||
}
|
||||
CoursierConfiguration()
|
||||
.withResolvers(rs.toVector)
|
||||
.withInterProjectDependencies(interProjectDependencies.toVector)
|
||||
|
|
@ -115,6 +168,7 @@ object LMCoursier {
|
|||
.withIvyHome(ivyHome)
|
||||
.withStrict(strict)
|
||||
.withForceVersions(userForceVersions.toVector)
|
||||
.withMissingOk(missingOk)
|
||||
}
|
||||
|
||||
def coursierConfigurationTask: Def.Initialize[Task[CoursierConfiguration]] = Def.task {
|
||||
|
|
@ -139,6 +193,7 @@ object LMCoursier {
|
|||
ivyPaths.value.ivyHome,
|
||||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -165,6 +220,7 @@ object LMCoursier {
|
|||
ivyPaths.value.ivyHome,
|
||||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -191,6 +247,7 @@ object LMCoursier {
|
|||
ivyPaths.value.ivyHome,
|
||||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
@ -217,6 +274,7 @@ object LMCoursier {
|
|||
ivyPaths.value.ivyHome,
|
||||
CoursierInputsTasks.strictTask.value,
|
||||
dependencyOverrides.value,
|
||||
Some(updateConfiguration.value),
|
||||
streams.value.log
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
ThisBuild / scalaVersion := "2.13.2"
|
||||
libraryDependencies ++= Seq(
|
||||
"com.chuusai" %% "shapeless" % "2.3.3",
|
||||
// non-existing
|
||||
"org.webjars" % "npm" % "0.0.99"
|
||||
)
|
||||
updateConfiguration := updateConfiguration.value.withMissingOk(true)
|
||||
|
||||
lazy val check = taskKey[Unit]("")
|
||||
|
||||
check := {
|
||||
val updateReport = update.value
|
||||
val updateClassifiersReport = updateClassifiers.value
|
||||
|
||||
val compileReport = updateReport
|
||||
.configuration(Compile)
|
||||
.getOrElse {
|
||||
sys.error("Compile configuration not found in update report")
|
||||
}
|
||||
|
||||
val compileClassifiersReport = updateClassifiersReport
|
||||
.configuration(Compile)
|
||||
.getOrElse {
|
||||
sys.error("Compile configuration not found in update classifiers report")
|
||||
}
|
||||
|
||||
val shapelessModule = compileReport
|
||||
.modules
|
||||
.find(_.module.name == "shapeless_2.13")
|
||||
.getOrElse {
|
||||
sys.error(s"shapeless module not found in ${compileReport.modules.map(_.module)}")
|
||||
}
|
||||
|
||||
val shapelessClassifiersModule = compileClassifiersReport
|
||||
.modules
|
||||
.find(_.module.name == "shapeless_2.13")
|
||||
.getOrElse {
|
||||
sys.error(s"shapeless module not found in ${compileClassifiersReport.modules.map(_.module)}")
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
> check
|
||||
Loading…
Reference in New Issue