core :: Sys :: generate_module_hierarchy
Importation relation is represented with arrow Nesting relation is represented with nested boxes
# Create a dot file representing the module hierarchy of a model.
# Importation relation is represented with arrow
# Nesting relation is represented with nested boxes
fun generate_module_hierarchy(toolcontext: ToolContext, given_mmodules: Collection[MModule])
do
var model = given_mmodules.first.model
var dot = new MPackageDot(model)
# Collect requested packages
for m in given_mmodules do
var g = m.mgroup
if g == null then continue
dot.mpackages.add(g.mpackage)
end
var packagepath = toolcontext.output_dir.join_path("package_hierarchy.dot")
print "generating package_hierarchy.dot"
dot.write_to_file(packagepath)
var modulepath = toolcontext.output_dir.join_path("module_hierarchy.dot")
dot.mpackages.add_all(model.mpackages)
print "generating module_hierarchy.dot"
dot.write_to_file(modulepath)
end
src/metrics/generate_hierarchies.nit:41,1--63,3