PaulTaykalo / objc-dependency-visualizer

Objective-C and Swift dependency visualizer. It's tool that helps to visualize current state of your project. It's really easy to see how tight your classes are coupled.
MIT License
1.84k stars 98 forks source link

projects containing Swift AND Objective-C? #42

Open haemi opened 7 years ago

haemi commented 7 years ago

is it possible to generate a graph with both, Swift and Objective-C?

PaulTaykalo commented 7 years ago

It's not currenlty supported.

alexwald commented 6 years ago

any plans to support this? or at least have an option to exclude swift classes so the script would actually generate the map? I currently have only a few swift classes in a project and the .rb script generates an empty map.

PaulTaykalo commented 6 years ago

nope. it's not in the any nearest plans

trupin commented 6 years ago

What do you think would be a good approach to do so?

PaulTaykalo commented 6 years ago

@trupin I think the easiest one will be just to generate deps by objc, then by swift and then merge json files with deps. I would start from this and see how it'll go. May be it wil be enough

PaulTaykalo commented 6 years ago

@trupin will actually need an example of the project, if you have something opensourced, not big one which can be used as a reference, it will be gr8

trupin commented 6 years ago

@PaulTaykalo Unfortunately, I'm using your tool to analyze a project from work. Next time I need to analyze an open source project I'll ping you.

PaulTaykalo commented 6 years ago

@trupin yeah, sure. You can still post images without the text with your comments, so I'll get idea so how it

  1. How does it work without additional flags? just -s <PROJECTNAME>
  2. How does it work with dwarf flag? -d -s <PROJECTNAME>
  3. How does it work with swift flag? -w -s <PROJECTNAME>

Also just be sure that this path is pointing to the correct project image

pidjay commented 6 years ago

@PaulTaykalo I also have a project with both Swift and Objective-C, though it's mostly Swift.

To answer your questions, 1. and 3. would both output this line:

var dependencies = {"links":[],"links_count":0,"objects":{}}

with 1. also showing plenty of warning: The file was not recognized as a valid object file for all Swift files.

  1. would output a dependency graph with lots of "ClassName":{"type":"unknown"} and the index.html would look like this (red circles are Swift classes, the connected one are Obj-C):

screen shot 2017-10-29 at 13 43 24

Hope that can help you!

Maryom commented 6 years ago

@pidjay Hello, I have same issues! Did you find a solution?

lisional commented 6 years ago

I may be wrong about this but I just started experiencing with objc-dependency-visualizer this afternoon on a mixed project. I went with the derived data path to generate the graph and it ran successfully, producing a map of all classes ObjC and Swift.

I think that both objc and swift file once compiled output .o files that can be interpreted by this tool in the same way. Not sure if output of this can be trusted yet (haven't dug this far yet) but it may represent something close to reality.