nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests.sh: force LC_ALL that cause issues with MacOSX
[nit.git]
/
src
/
metrics
/
generate_hierarchies.nit
diff --git
a/src/metrics/generate_hierarchies.nit
b/src/metrics/generate_hierarchies.nit
index
e085e1d
..
455ed83
100644
(file)
--- a/
src/metrics/generate_hierarchies.nit
+++ b/
src/metrics/generate_hierarchies.nit
@@
-30,11
+30,11
@@
end
private class GenerateHierarchyPhase
super Phase
private class GenerateHierarchyPhase
super Phase
- redef fun process_mainmodule(mainmodule)
+ redef fun process_mainmodule(mainmodule, given_mmodules)
do
if not toolcontext.opt_generate_hyperdoc.value and not toolcontext.opt_all.value then return
var model = toolcontext.modelbuilder.model
do
if not toolcontext.opt_generate_hyperdoc.value and not toolcontext.opt_all.value then return
var model = toolcontext.modelbuilder.model
- generate_module_hierarchy(toolcontext, model)
+ generate_module_hierarchy(toolcontext, given_mmodules)
generate_classdef_hierarchy(toolcontext, model)
generate_class_hierarchy(toolcontext, mainmodule)
end
generate_classdef_hierarchy(toolcontext, model)
generate_class_hierarchy(toolcontext, mainmodule)
end
@@
-43,12
+43,18
@@
end
# Create a dot file representing the module hierarchy of a model.
# 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, model: Model)
+fun generate_module_hierarchy(toolcontext: ToolContext, given_mmodules: Collection[MModule])
do
do
+ var model = given_mmodules.first.model
var dot = new MProjectDot(model)
var dot = new MProjectDot(model)
+ # Collect requested projects
+ for m in given_mmodules do
+ var g = m.mgroup
+ if g == null then continue
+ dot.mprojects.add(g.mproject)
+ end
var projectpath = toolcontext.output_dir.join_path("project_hierarchy.dot")
var projectpath = toolcontext.output_dir.join_path("project_hierarchy.dot")
- dot.mprojects.add(model.mprojects.first)
print "generating {projectpath}"
dot.write_to_file(projectpath)
print "generating {projectpath}"
dot.write_to_file(projectpath)
@@
-61,7
+67,7
@@
end
# Create a dot file representing the class hierarchy of a model.
fun generate_class_hierarchy(toolcontext: ToolContext, mmodule: MModule)
do
# Create a dot file representing the class hierarchy of a model.
fun generate_class_hierarchy(toolcontext: ToolContext, mmodule: MModule)
do
- var buf = new Buffer
+ var buf = new FlatBuffer
buf.append("digraph \{\n")
buf.append("node [shape=box];\n")
buf.append("rankdir=BT;\n")
buf.append("digraph \{\n")
buf.append("node [shape=box];\n")
buf.append("rankdir=BT;\n")
@@
-82,7
+88,7
@@
end
# For a simple user of the model, the classdef hierarchy is not really usefull, it is more an internal thing.
fun generate_classdef_hierarchy(toolcontext: ToolContext, model: Model)
do
# For a simple user of the model, the classdef hierarchy is not really usefull, it is more an internal thing.
fun generate_classdef_hierarchy(toolcontext: ToolContext, model: Model)
do
- var buf = new Buffer
+ var buf = new FlatBuffer
buf.append("digraph \{\n")
buf.append("node [shape=box];\n")
buf.append("rankdir=BT;\n")
buf.append("digraph \{\n")
buf.append("node [shape=box];\n")
buf.append("rankdir=BT;\n")