mirror of https://github.com/sbt/sbt.git
Warn in case of source dependencies where sbt-coursier isn't enabled
This commit is contained in:
parent
8e4fb146d8
commit
399e84efd5
|
|
@ -102,10 +102,17 @@ object InputsTasks {
|
|||
|
||||
val projectRefs = Structure.allRecursiveInterDependencies(state, projectRef)
|
||||
|
||||
val t = coursierProject.forAllProjects(state, projectRefs).map(_.values.toVector)
|
||||
val t = coursierProject.forAllProjectsOpt(state, projectRefs)
|
||||
|
||||
Def.task {
|
||||
val projects = t.value
|
||||
val projects = t.value.toVector.flatMap {
|
||||
case (ref, None) =>
|
||||
if (ref.build != projectRef.build)
|
||||
state.log.warn(s"Cannot get coursier info for project under ${ref.build}, is sbt-coursier also added to it?")
|
||||
Nil
|
||||
case (_, Some(p)) =>
|
||||
Seq(p)
|
||||
}
|
||||
val projectModules = projects.map(_.module).toSet
|
||||
|
||||
// this includes org.scala-sbt:global-plugins referenced from meta-builds in particular
|
||||
|
|
|
|||
|
|
@ -54,5 +54,21 @@ object Structure {
|
|||
val tasks = projects.flatMap(p => key.in(p).get(structure(state).data).map(_.map(it => (p, it))))
|
||||
std.TaskExtra.joinTasks(tasks).join.map(_.toMap)
|
||||
}
|
||||
|
||||
// ^^ things from sbt-structure ^^
|
||||
|
||||
def forAllProjectsOpt(state: State, projects: Seq[ProjectRef]): sbt.Task[Map[ProjectRef, Option[T]]] = {
|
||||
val settings = structure(state).data
|
||||
val tasks = projects.map { p =>
|
||||
val taskOpt = key.in(p).get(settings)
|
||||
taskOpt match {
|
||||
case None =>
|
||||
Def.task(p -> Option.empty[T]).evaluate(settings)
|
||||
case Some(t) =>
|
||||
t.map(p -> Option(_))
|
||||
}
|
||||
}
|
||||
std.TaskExtra.joinTasks(tasks).join.map(_.toMap)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue