minor cleanup and using missingOk instead of external property

This commit is contained in:
andrea 2018-10-24 11:49:51 +01:00
parent 3b7b2ffbb7
commit 2e6870d17e
3 changed files with 7 additions and 13 deletions

View File

@ -307,8 +307,7 @@ addCommandAlias("scriptedCoursier", Seq(
"lmScriptedTest/clean",
"""set ThisBuild / scriptedTestLMImpl := "coursier"""",
"""set ThisBuild / scriptedLaunchOpts += "-Ddependency.resolution=coursier" """,
// excluding sbt-plugins test, artifacts are downloaded but sbt do not pick up the plugin
"lmScriptedTest/scripted lmScriptedTest/simple lmScriptedTest/with-trasnsitive").mkString(";",";",""))
"lmScriptedTest/scripted").mkString(";",";",""))
def customCommands: Seq[Setting[_]] = Seq(
commands += Command.command("release") { state =>

View File

@ -42,12 +42,6 @@
"type": "Int",
"default": "100",
"since": "0.0.1"
},
{
"name": "ignoreArtifactErrors",
"type": "Boolean",
"default": "false",
"since": "0.0.1"
}
]
}

View File

@ -18,8 +18,8 @@ case class CoursierModuleDescriptor(
directDependencies: Vector[ModuleID],
scalaModuleInfo: Option[ScalaModuleInfo],
moduleSettings: ModuleSettings,
configurations: Seq[String],
extraInputHash: Long,
configurations: Seq[String]
) extends ModuleDescriptor
case class CoursierModuleSettings() extends ModuleSettings
@ -100,8 +100,8 @@ private[sbt] class CoursierDependencyResolution(coursierConfiguration: CoursierC
moduleSetting.dependencies,
moduleSetting.scalaModuleInfo,
CoursierModuleSettings(),
extraInputHash,
moduleSetting.configurations.map(_.name)
moduleSetting.configurations.map(_.name),
extraInputHash
)
}
@ -138,6 +138,7 @@ private[sbt] class CoursierDependencyResolution(coursierConfiguration: CoursierC
// not sure what DependencyResolutionInterface.moduleDescriptor is for, we're handled ivy stuff anyway...
val module0 = module match {
case c: CoursierModuleDescriptor => c
// This shouldn't happen at best of my understanding
case i: IvySbt#Module =>
moduleDescriptor(
i.moduleSettings match {
@ -198,7 +199,7 @@ private[sbt] class CoursierDependencyResolution(coursierConfiguration: CoursierC
resolution.conflicts.isEmpty) {
updateReport()
} else if (resolution.isDone &&
(!resolution.errors.isEmpty && coursierConfiguration.ignoreArtifactErrors)
(!resolution.errors.isEmpty && configuration.missingOk)
&& resolution.conflicts.isEmpty) {
log.warn(s"""Failed to download artifacts: ${resolution.errors
.map(_._2)
@ -313,7 +314,7 @@ private[sbt] class CoursierDependencyResolution(coursierConfiguration: CoursierC
// Key is the name of the configuration (i.e. `compile`) and the values are the name itself plus the
// names of the configurations that this one depends on.
private def extractConfigurationTree: ConfigurationDependencyTree = {
private val extractConfigurationTree: ConfigurationDependencyTree = {
(Configurations.default ++
Configurations.defaultInternal ++
Seq(ScalaTool, CompilerPlugin, Component))