add the ability to generate callgraphs
This commit is contained in:
4
Makefile
4
Makefile
@ -65,8 +65,10 @@ release:
|
|||||||
github-release release -u go-i2p -r go-i2p -n "${RELEASE_VERSION}" -t "${RELEASE_TAG}" -d "${RELEASE_DESCRIPTION}" -p
|
github-release release -u go-i2p -r go-i2p -n "${RELEASE_VERSION}" -t "${RELEASE_TAG}" -d "${RELEASE_DESCRIPTION}" -p
|
||||||
|
|
||||||
callvis:
|
callvis:
|
||||||
go-callvis -format svg -focus upgrade -group pkg,type -limit github.com/go-i2p/go-i2p github.com/go-i2p/go-i2p
|
go-callvis -file index.html -format svg -group pkg,type github.com/go-i2p/go-i2p/
|
||||||
|
|
||||||
godoc:
|
godoc:
|
||||||
find lib -type d -exec bash -c "ls {}/*.go && godocdown -o ./{}/doc.md ./{}" \;
|
find lib -type d -exec bash -c "ls {}/*.go && godocdown -o ./{}/doc.md ./{}" \;
|
||||||
|
|
||||||
|
gocallvis:
|
||||||
|
find lib -type d -exec bash -c "ls {}/*.go && go-callvis -focus github.com/go-i2p/go-i2p/{} -file ./{}/index.html -format svg -group pkg,type github.com/go-i2p/go-i2p/{}" \;
|
||||||
|
16
callgraph.sh
Executable file
16
callgraph.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
|
dirs=$(find lib/ -type d)
|
||||||
|
for dir in $dirs; do
|
||||||
|
files=$(find "$dir" -maxdepth 1 -type f -name "*.go")
|
||||||
|
#echo "Files in $dir: $files"
|
||||||
|
file=$(echo $files | awk '{print $1}')
|
||||||
|
if [ -z "$file" ]; then
|
||||||
|
echo "no go files, skipping"
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
packageLine=$(grep -E "^package" $file)
|
||||||
|
package=$(echo $packageLine | awk '{print $2}')
|
||||||
|
echo "Generating callgraph for $package"
|
||||||
|
go-callvis -nostd -focus "$package" -group pkg,type -format svg -file $dir/$package.svg "github.com/go-i2p/go-i2p/$dir"
|
||||||
|
done
|
Reference in New Issue
Block a user