Skip to content

Commit

Permalink
Add files
Browse files Browse the repository at this point in the history
  • Loading branch information
lempiji committed Apr 21, 2019
1 parent c35f543 commit 20334a6
Show file tree
Hide file tree
Showing 12 changed files with 8,952 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.dub
docs.json
__dummy.html
docs/
/graphviz
graphviz.so
graphviz.dylib
graphviz.dll
graphviz.a
graphviz.lib
graphviz-test-*
*.exe
*.o
*.obj
*.lst
114 changes: 114 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
# DDeps

Source review support tool.

A tool for creating module dependency graphs. And visualize the differences between the two snapshots.

# Screenshot (Example)
![rx](https://github.com/lempiji/ddeps/blob/master/rx-deps.png)

# Requirements
1. dub
2. Graphviz (for visualize)

# Settings

## For library (example)
```json
"configurations": [
{
"name": "default"
},
{
"name": "diff",
"postGenerateCommands": [
"dub build -c makedeps",
"ddeps --focus=rx --out=deps.dot",
"dot -Tsvg -odeps.svg deps.dot"
]
},
{
"name": "diff-update",
"postGenerateCommands": [
"ddeps --focus=rx --update"
]
},
{
"name": "makedeps",
"dflags": ["-deps=deps.txt"]
}
]
```

## For executable
```json
"configurations": [
{
"name": "default"
},
{
"name": "diff",
"postGenerateCommands": [
"dub build -c makedeps",
"ddeps --out=deps.dot",
"dot -Tsvg -odeps.svg deps.dot"
]
},
{
"name": "diff-update",
"postGenerateCommands": [
"ddeps --update"
]
},
{
"name": "makedeps",
"dflags": ["-deps=deps.txt"]
}
]
```

# Usage

## At first
create lock file

```bash
dub build -c makedeps
dub build -c diff-update
```

## Basic
1. Modify source
2. Update diff
- `dub build -c diff`
3. Do review with the dependency graph diff
- Open the `deps.svg` in browser

## Compare 2 versions

1. checkout a target version
- `git reset --hard XXX` or `git checkout XXXXX`
2. reset to source version
- `git reset --hard HEAD~10` (e.g. 10 versions ago)
3. create `deps-lock.txt`
- `dub build -c makedeps`
- `dub build -c diff-update`
- if `dub.json` / `dub.sdl` has not configure then add these.
4. reset to target version
- `git reset --hard ORIG_HEAD`
5. make diff
- `dub build -c diff`
6. open `deps.svg`


# Arguments

| name | Usage | description | default |
|:-----|:------------|:--|:--|
| input | `-i` or `--input` | deps file name | `deps.txt` |
| output | `-o XXX` or `--output=XXX` | destination file name | write to stdout |
| update | `-u` or `--update` | update lock file | false |
| lock | `-l` or `--lock` | lock file name | `deps-lock.txt` |
| focus | `--focus=XXX` | filtering target by name | `app` |
| depth | `-d` or `--depth` | update lock file | false |
| help | `--help` | show help | |
3,446 changes: 3,446 additions & 0 deletions deps-lock.txt

Large diffs are not rendered by default.

69 changes: 69 additions & 0 deletions deps.dot
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
digraph {
{
"app"
"core.bitop"
"core.checkedint"
"core.exception"
"core.internal.traits"
"core.memory"
"core.stdc.string"
"std.algorithm"
"std.algorithm.comparison"
"std.algorithm.iteration"
"std.algorithm.mutation"
"std.algorithm.searching"
"std.array"
"std.ascii"
"std.container.rbtree"
"std.conv"
"std.encoding"
"std.exception"
"std.file"
"std.format"
"std.functional"
"std.getopt"
"std.internal.memory"
"std.internal.unicode_tables"
"std.meta"
"std.range"
"std.range.primitives"
"std.stdio"
"std.system"
"std.traits"
"std.typecons"
"std.uni"
"std.utf"
}
"app" -> "core.bitop";
"app" -> "core.checkedint";
"app" -> "core.exception";
"app" -> "core.internal.traits";
"app" -> "core.memory";
"app" -> "core.stdc.string";
"app" -> "std.algorithm";
"app" -> "std.algorithm.comparison";
"app" -> "std.algorithm.iteration";
"app" -> "std.algorithm.mutation";
"app" -> "std.algorithm.searching";
"app" -> "std.array";
"app" -> "std.ascii";
"app" -> "std.container.rbtree";
"app" -> "std.conv";
"app" -> "std.encoding";
"app" -> "std.exception";
"app" -> "std.file";
"app" -> "std.format";
"app" -> "std.functional";
"app" -> "std.getopt";
"app" -> "std.internal.memory";
"app" -> "std.internal.unicode_tables";
"app" -> "std.meta";
"app" -> "std.range";
"app" -> "std.range.primitives";
"app" -> "std.stdio";
"app" -> "std.system";
"app" -> "std.traits";
"app" -> "std.typecons";
"app" -> "std.uni";
"app" -> "std.utf";
}
Binary file added deps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 20334a6

Please sign in to comment.