This tool has been merged into Button and is now unnecessary. The only thing left to do is bring the tests over.
A tool that wraps commands in order to figure out file dependencies in an ad hoc manner. If running under Button, dependencies are reported to the parent build system. Dependencies can also be output in JSON format for integration with other tools.
Suppose we have a D source file foo.d
:
module foo;
import bar;
and a source file bar.d
:
module bar;
import baz;
Note that foo.d
imports bar.d
and bar.d
imports baz.d
.
In order to compile foo.d
, we run:
button-deps dmd -c foo.d
Here, button-deps
will use some tricks to figure out the transitive closure of
dependencies that dmd -c foo.d
has. In this case, button-deps
will report
foo.d
, bar.d
, and baz.d
as dependencies.
For tools that are not yet fully supported or cannot be supported, strace
is
used to determine dependencies by analysing how files are opened. While slower
than ad hoc support for other tools, strace
provides accurate dependency
tracking.
For example, suppose we have a shell script test.sh
:
cat foo
echo "Hello world!" > bar
cp bar baz
If we run this shell script, like so:
$ button-deps bash test.sh
test.sh
and foo
will be reported as inputs, while bar
and baz
will be
reported as outputs.
-
Get the dependencies:
-
Get the source:
git clone https://github.com/jasonwhite/button-deps.git
-
Build it:
dub build