I`m not sure that I get right the concept of sbt workflow. I have multi-project structure of an arbitrary depth in my build.sbt Now I want to define task which can show me library dependencies of project current subprojects depends on. Or, in common: is there any way to get setting value of another project?
I`m trying to do somthing like this:
val hierarchyDeps = taskKey[Seq[ModuleID]]("")
val hierarchyDepsImpl = Def.task {
loadedBuild.value.allProjectRefs.flatMap { case (projectRef, resolvedProject) =>
(projectRef / libraryDependencies).value
}
}
val cmn = project.in(file("cmn"))
val subA = project.in(file("sub_a")).dependsOn(cmn).settings(hierarchyDeps := hierarchyDepsImpl.value)
val subB = project.in(file("sub_b")).dependsOn(cmn).settings(hierarchyDeps := hierarchyDepsImpl.value)
but getting java.lang.IllegalArgumentException
:
java.lang.IllegalArgumentException: Could not find proxy for val projectRef: sbt.ProjectRef in List(value projectRef, value $anonfun, method $anonfun$hierarchyDepsImpl$1, value hierarchyDepsImpl, object $5879c5c8d08c0b0b007a, package <empty>, package <root>) (currentOwner= value hierarchyDepsImpl )