objc-dependency-visualizer icon indicating copy to clipboard operation
objc-dependency-visualizer copied to clipboard

projects containing Swift AND Objective-C?

Open haemi opened this issue 7 years ago • 11 comments

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

haemi avatar May 03 '17 12:05 haemi

It's not currenlty supported.

PaulTaykalo avatar May 04 '17 00:05 PaulTaykalo

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.

alexwald avatar Oct 02 '17 07:10 alexwald

nope. it's not in the any nearest plans

PaulTaykalo avatar Oct 02 '17 07:10 PaulTaykalo

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

trupin avatar Oct 06 '17 21:10 trupin

@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 avatar Oct 07 '17 13:10 PaulTaykalo

@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

PaulTaykalo avatar Oct 11 '17 21:10 PaulTaykalo

@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.

trupin avatar Oct 12 '17 04:10 trupin

@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

PaulTaykalo avatar Oct 12 '17 05:10 PaulTaykalo

@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!

pidjay avatar Oct 29 '17 04:10 pidjay

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

Maryom avatar Mar 06 '18 06:03 Maryom

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.

lisional avatar May 04 '18 03:05 lisional