simonbs / dependency-graph

🕸️ dependency-graph is a command-line tool that can visualize the dependencies of packages.
MIT License
268 stars 11 forks source link

Fails to locate local swift packages #24

Open markst opened 1 year ago

markst commented 1 year ago

What happened?

Error: App depends on Media Player but the dependency was not found in the graph.

What are the steps to reproduce?

Use local Swift Packages with dependencies on other local packages

What is the expected behavior?

Dependency graph should interpret local package nodes.

simonbs commented 1 year ago

@markst Thanks for opening the issue. Can you provide a sample Package.swift file to reproduce this?

markst commented 9 months ago

I've put together a project to reproduce: DependencyDemo.zip

markst commented 9 months ago

Does seem that it may be due to the location of the package being nested with a directory. For instance if I move the package up a level:

image

my output is as follows:

digraph g {
  layout=dot
  rankdir=LR

  subgraph cluster_package_MyLibrary {
    label="MyLibrary"
    packageProduct_MyLibrary [label="MyLibrary", shape=ellipse]
    target_MyLibrary [label="MyLibrary", shape=box]
    target_MyLibraryTests [label="MyLibraryTests", shape=box]
  }

  subgraph cluster_project_DependencyDemoxcodeproj {
    label="DependencyDemo.xcodeproj"
    target_DependencyDemo [label="DependencyDemo", shape=box]
  }

  packageProduct_MyLibrary -> target_MyLibrary
  target_MyLibraryTests -> target_MyLibrary
  target_DependencyDemo -> packageProduct_MyLibrary
}