1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

graph.pl includes .mm files, and unpaired .h ; reveals more cycles...

... There is now a new big blob of 40 and a smaller one of 4
This commit is contained in:
Paul Licameli 2019-07-13 11:47:50 -04:00
parent 9dfa8f205c
commit 6541e808be

View File

@ -19,19 +19,23 @@ my $links = 1;
my $dir = "../src"; my $dir = "../src";
my %names; # string to string my %names; # string to string
foreach my $file (`find $dir -name '*.cpp'`) { {
my $short = $file; foreach my $file (`find $dir -name '*.cpp' -o -name '*.h' -o -name '*.mm'`) {
chop $short; my $short = $file;
$short =~ s|.cpp$||; chop $short;
my $shorter = ($short =~ s|^.*/||r); $short =~ s|\.cpp$||;
$names{$shorter} = $short; $short =~ s|\.h$||;
$short =~ s|\.mm$||;
my $shorter = ($short =~ s|^.*/||r);
$names{$shorter} = $short;
}
} }
#my $linkroot = "https://github.com/audacity/audacity/tree/master/src"; #my $linkroot = "https://github.com/audacity/audacity/tree/master/src";
my $linkroot = "file://" . File::Spec->rel2abs( $dir ); my $linkroot = "file://" . File::Spec->rel2abs( $dir );
print STDERR "Found ", scalar( keys %names ), " .cpp file(s)\n" if $traceLevel >= 1; print STDERR "Found ", scalar( keys %names ), " filename(s)\n" if $traceLevel >= 1;
# Step 2: collect inclusions in each .cpp/.h pair, and folder information, # Step 2: collect inclusions in each .cpp/.h pair, and folder information,
# and build a graph # and build a graph
@ -79,7 +83,7 @@ while( my ($shorter, $short) = each(%names) ) {
chop; chop;
my @components = split '/'; my @components = split '/';
my $include = $components[-1]; my $include = $components[-1];
# omit self-arcs and arcs to .h files without corresponding .cpp # omit self-arcs and arcs to .h files external to the project
if (($shorter ne $include) && (exists $names{$include})) { if (($shorter ne $include) && (exists $names{$include})) {
$graph{$shorter}{$include} = (), ++$arcs; $graph{$shorter}{$include} = (), ++$arcs;
} }