mirror of https://github.com/sbt/sbt.git
Review comments for https://github.com/sbt/sbt/pull/2633
This commit is contained in:
parent
982a7c8724
commit
e8b951c0d1
|
|
@ -1,3 +1,2 @@
|
|||
target/
|
||||
__pycache__
|
||||
.idea
|
||||
|
|
|
|||
|
|
@ -534,8 +534,8 @@ object Project extends ProjectExtra {
|
|||
printScopes("Delegates", delegates(structure, scope, key)) +
|
||||
printScopes("Related", related, 10)
|
||||
}
|
||||
def settingGraph(structure: BuildStructure, basedir: File, scoped: ScopedKey[_], maxGraphWidth: Int)(implicit display: Show[ScopedKey[_]]): SettingGraph =
|
||||
SettingGraph(structure, basedir, scoped, 0, maxGraphWidth)
|
||||
def settingGraph(structure: BuildStructure, basedir: File, scoped: ScopedKey[_])(implicit display: Show[ScopedKey[_]]): SettingGraph =
|
||||
SettingGraph(structure, basedir, scoped, 0)
|
||||
def graphSettings(structure: BuildStructure, basedir: File)(implicit display: Show[ScopedKey[_]]): Unit = {
|
||||
def graph(actual: Boolean, name: String) = graphSettings(structure, actual, name, new File(basedir, name + ".dot"))
|
||||
graph(true, "actual_dependencies")
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ object Inspect {
|
|||
Project.details(structure, actual, sk.scope, sk.key)
|
||||
case DependencyTreeMode =>
|
||||
val basedir = new File(Project.session(s).current.build)
|
||||
Project.settingGraph(structure, basedir, sk, get(sbt.Keys.asciiGraphWidth)).dependsAscii
|
||||
Project.settingGraph(structure, basedir, sk).dependsAscii(get(sbt.Keys.asciiGraphWidth))
|
||||
case UsesMode =>
|
||||
Project.showUses(Project.usedBy(structure, true, sk.key))
|
||||
case DefinitionsMode =>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import Predef.{ any2stringadd => _, _ }
|
|||
import sbt.io.IO
|
||||
|
||||
object SettingGraph {
|
||||
def apply(structure: BuildStructure, basedir: File, scoped: ScopedKey[_], generation: Int, graphMaxWidth: Int)(implicit display: Show[ScopedKey[_]]): SettingGraph =
|
||||
def apply(structure: BuildStructure, basedir: File, scoped: ScopedKey[_], generation: Int)(implicit display: Show[ScopedKey[_]]): SettingGraph =
|
||||
{
|
||||
val cMap = flattenLocals(compiled(structure.settings, false)(structure.delegates, structure.scopeLocal, display))
|
||||
def loop(scoped: ScopedKey[_], generation: Int): SettingGraph =
|
||||
|
|
@ -28,8 +28,7 @@ object SettingGraph {
|
|||
SettingGraph(display(scoped), definedIn,
|
||||
Project.scopedKeyData(structure, scope, key),
|
||||
key.description, basedir,
|
||||
depends map { (x: ScopedKey[_]) => loop(x, generation + 1) },
|
||||
graphMaxWidth)
|
||||
depends map { (x: ScopedKey[_]) => loop(x, generation + 1) })
|
||||
}
|
||||
loop(scoped, generation)
|
||||
}
|
||||
|
|
@ -41,8 +40,7 @@ case class SettingGraph(
|
|||
data: Option[ScopedKeyData[_]],
|
||||
description: Option[String],
|
||||
basedir: File,
|
||||
depends: Set[SettingGraph],
|
||||
graphMaxWidth: Int
|
||||
depends: Set[SettingGraph]
|
||||
) {
|
||||
def dataString: String =
|
||||
data map { d =>
|
||||
|
|
@ -52,11 +50,11 @@ case class SettingGraph(
|
|||
} getOrElse { d.typeName }
|
||||
} getOrElse { "" }
|
||||
|
||||
def dependsAscii: String = Graph.toAscii(
|
||||
def dependsAscii(defaultWidth: Int): String = Graph.toAscii(
|
||||
this,
|
||||
(x: SettingGraph) => x.depends.toSeq.sortBy(_.name),
|
||||
(x: SettingGraph) => "%s = %s" format (x.definedIn getOrElse { "" }, x.dataString),
|
||||
graphMaxWidth
|
||||
defaultWidth
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue