dependency-graph icon indicating copy to clipboard operation
dependency-graph copied to clipboard

Fails to locate local swift packages

Open markst opened this issue 2 years ago • 5 comments

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.

markst avatar Aug 28 '23 01:08 markst

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

simonbs avatar Aug 30 '23 06:08 simonbs

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

markst avatar Jan 11 '24 08:01 markst

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
}

markst avatar Jan 11 '24 08:01 markst

Not sure if it's related but I'm getting the following error: Error: The element XCLocalSwiftPackageReference is not supported.

vince1393 avatar Jan 24 '25 19:01 vince1393