#22 Print all libraries and their dependencies

Unlicense
and (1)
2022-05-17
2022-05-17
i-campbell
No
# search for libman object
proj = projects.primary
objects = proj.get_children(recursive=True)
for object in objects:
    if object.is_libman:
        #and print all its libraries
        for libref in iter(object):
            if libref.is_placeholder and isinstance(libref.effective_resolution,str):
                print(libref.name + " " + libref.effective_resolution)
            else:
                print(libref.name)
            #and print all its libraries' dependencies
            dependencies = libref.get_dependencies()
            for dependency in dependencies:
                if dependency.is_placeholder and isinstance(dependency.effective_resolution,str):
                    print("+" + dependency.name + " " + dependency.effective_resolution)
                else:
                    print("+" + dependency.name) 

Discussion


Log in to post a comment.