forked from agda/agda-stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ refactor ] Clean up the dependency graph (agda#1435)
* [ refactor ] Clean up the dependency graph
- Loading branch information
Showing
57 changed files
with
1,753 additions
and
1,098 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
*.hi | ||
*.lagda.el | ||
*.o | ||
*.svg | ||
*.tix | ||
*.vim | ||
*~ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/sh | ||
|
||
### You can call this script like so to generate a dependency graph | ||
### of the `Data.List.Base` module: | ||
### ./graph.sh src/Data/List/Base.agda | ||
|
||
### Allow users to pick the agda executable they want by prefixing | ||
### the call with `AGDA=agda-X.Y.Z` and default to agda in case | ||
### nothing was picked | ||
AGDA=${AGDA:-"agda"} | ||
|
||
### Grab the directory and name of the target agda file | ||
DIR=$(dirname $1) | ||
BASE=$(basename $1 ".agda") | ||
FILE=_build/${DIR}/${BASE} | ||
|
||
### Prepare the directory for the dot & tmp files | ||
mkdir -p _build/$DIR | ||
|
||
### Generate the dot file for the target agda file | ||
${AGDA} -i. -isrc/ --dependency-graph=${FILE}.dot $1 | ||
|
||
### Trim the graph to remove transitive dependencies. Without that the | ||
### graphs get too big too quickly and are impossible to render | ||
tred ${FILE}.dot > ${FILE}2.dot | ||
mv ${FILE}2.dot ${FILE}.dot | ||
|
||
### Generate an svg representation of the graph | ||
dot -Tsvg ${FILE}.dot > ${FILE}.svg | ||
|
||
### Add a symlink to it in the base directory | ||
ln -is ${FILE}.svg ${BASE}.svg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.