mirror of https://github.com/sbt/sbt.git
Merge pull request #227 from alexarchambault/topic/plugin-minor-fix
Small fix
This commit is contained in:
commit
15d2afb264
|
|
@ -41,8 +41,15 @@ object CoursierPlugin extends AutoPlugin {
|
||||||
coursierFallbackDependencies <<= Tasks.coursierFallbackDependenciesTask,
|
coursierFallbackDependencies <<= Tasks.coursierFallbackDependenciesTask,
|
||||||
coursierCache := Cache.default,
|
coursierCache := Cache.default,
|
||||||
update <<= Tasks.updateTask(withClassifiers = false),
|
update <<= Tasks.updateTask(withClassifiers = false),
|
||||||
updateClassifiers <<= Tasks.updateTask(withClassifiers = true, ignoreArtifactErrors = true),
|
updateClassifiers <<= Tasks.updateTask(
|
||||||
updateSbtClassifiers in Defaults.TaskGlobal <<= Tasks.updateTask(withClassifiers = true, sbtClassifiers = true),
|
withClassifiers = true,
|
||||||
|
ignoreArtifactErrors = true
|
||||||
|
),
|
||||||
|
updateSbtClassifiers in Defaults.TaskGlobal <<= Tasks.updateTask(
|
||||||
|
withClassifiers = true,
|
||||||
|
sbtClassifiers = true,
|
||||||
|
ignoreArtifactErrors = true
|
||||||
|
),
|
||||||
coursierProject <<= Tasks.coursierProjectTask,
|
coursierProject <<= Tasks.coursierProjectTask,
|
||||||
coursierProjects <<= Tasks.coursierProjectsTask,
|
coursierProjects <<= Tasks.coursierProjectsTask,
|
||||||
coursierPublications <<= Tasks.coursierPublicationsTask,
|
coursierPublications <<= Tasks.coursierPublicationsTask,
|
||||||
|
|
|
||||||
|
|
@ -554,21 +554,36 @@ object Tasks {
|
||||||
.sortBy(_._1)
|
.sortBy(_._1)
|
||||||
|
|
||||||
for ((type0, errors) <- groupedArtifactErrors) {
|
for ((type0, errors) <- groupedArtifactErrors) {
|
||||||
log.error(s"${errors.size} $type0")
|
def msg = s"${errors.size} $type0"
|
||||||
|
if (ignoreArtifactErrors)
|
||||||
|
log.warn(msg)
|
||||||
|
else
|
||||||
|
log.error(msg)
|
||||||
|
|
||||||
if (!ignoreArtifactErrors || verbosityLevel >= 1)
|
if (!ignoreArtifactErrors || verbosityLevel >= 1) {
|
||||||
for (err <- errors)
|
if (ignoreArtifactErrors)
|
||||||
log.error(" " + err)
|
for (err <- errors)
|
||||||
|
log.warn(" " + err)
|
||||||
|
else
|
||||||
|
for (err <- errors)
|
||||||
|
log.error(" " + err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreArtifactErrors)
|
if (!ignoreArtifactErrors)
|
||||||
throw new Exception(s"Encountered ${artifactErrors.length} errors (see above messages)")
|
throw new Exception(s"Encountered ${artifactErrors.length} errors (see above messages)")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// can be non empty only if ignoreArtifactErrors is true
|
||||||
|
val erroredArtifacts = artifactFilesOrErrors.collect {
|
||||||
|
case (artifact, -\/(_)) =>
|
||||||
|
artifact
|
||||||
|
}.toSet
|
||||||
|
|
||||||
def artifactFileOpt(artifact: Artifact) = {
|
def artifactFileOpt(artifact: Artifact) = {
|
||||||
val res = artifactFiles.get(artifact)
|
val res = artifactFiles.get(artifact)
|
||||||
|
|
||||||
if (res.isEmpty)
|
if (res.isEmpty && !erroredArtifacts(artifact))
|
||||||
log.error(s"${artifact.url} not downloaded (should not happen)")
|
log.error(s"${artifact.url} not downloaded (should not happen)")
|
||||||
|
|
||||||
res
|
res
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue