Home > Software engineering >  How to read --- and \--- in the dependencies output?
How to read --- and \--- in the dependencies output?

Time:12-23

When I run the dependencies task, I see a dependency graph wherein some entries are preceded by --- and some entries are preceded by \---. What do each of these two symbols mean?

As an example, when I run gradle :app:dependencies --configuration debugCompileClasspath for an Android application, I see an entry as follows:

 --- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10
|     --- org.jetbrains.kotlin:kotlin-stdlib:1.6.10
|    |     --- org.jetbrains:annotations:13.0
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10

CodePudding user response:

--- marks the beginning of an expansion of the list on inner dependencies for the entry next to it. In your case, it starts the list of the dependencies for org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10. As you can see, the next line is a bit indented, that's the first dependency of the parent org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10.

\--- marks the end of the expansion of the list that was opened on that depth. In your case, \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10 is the last dependency from org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10's list. And that dependency has only one inner dependency which is org.jetbrains.kotlin:kotlin-stdlib:1.6.10.

A lot of dependencies but I lack a better word. I hope I don't confuse you even more :D

CodePudding user response:

This is character-based artwork indicating an increased level of nesting; the symbols themselves don't mean anything beyond their visual appearance. A nested item is a transitive dependency of the item it's nested under.

Example

Taking your example:

 --- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10
|     --- org.jetbrains.kotlin:kotlin-stdlib:1.6.10
|    |     --- org.jetbrains:annotations:13.0
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10
|    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10
|         \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.10

In this example, both kotlin-stdlib and kotlin-stdlib-jdk7 are transitive dependencies of kotlin-stdlib-jdk8. Likewise, both annotations & kotlin-stdlib-common are transitive dependencies of kotlin-stdlib. kotlin-stdlib is a transitive dependency of kotlin-stdlib-jdk7.

In standard HTML list form, this rendering would be identical to:

  • org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10
    • org.jetbrains.kotlin:kotlin-stdlib:1.6.10
      • org.jetbrains:annotations:13.0
      • org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10
    • org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10
      • org.jetbrains.kotlin:kotlin-stdlib:1.6.10

The following is a different textual rendering of the list, using drawing-based characters rather than purely ASCII ones, that may make things clearer:

┌─── org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.10
│    │
│    ├─── org.jetbrains.kotlin:kotlin-stdlib:1.6.10
│    │    │
│    │    ├─── org.jetbrains:annotations:13.0
│    │    │
│    │    └─── org.jetbrains.kotlin:kotlin-stdlib-common:1.6.10
│    │
│    └─── org.jetbrains.kotlin:kotlin.stdlib-jdk7:1.6.10
│         │
│         └─── org.jetbrains.kotlin:kotlin-stdlib:1.6.10

In this example, instead of ├─── to indicate a nested item with further items below, Gradle uses ---; instead of └─── to indicate the last nested item, it uses \---.

  • Related