class: center, middle # tup Build System --- # Why not make? > I think automated file-level dependency detection is a baseline requirement for build systems. > Even if it is possible for a human to correctly list the dependencies for a single build, > it really isn't possible to maintain as files are added/deleted/moved around. > > **Mike Shal** --
> Rules are easy.
> Dependencies are hard. > > **Dwight Shih** --
[tup](http://gittup.org/tup/) automatically determines file based dependencies by using a FUSE filesystem to track reads and writes. Available for Linux, OS X and Microsoft Windows. --- # Anatomy of a Rule ``` : [foreach] inputs [|order inputs] |> command |> outputs [|extra outputs] [
] [{bin}] ``` - order inputs are files/groups generated by other rules, used to control order of rule execution - group aggregates output from multiple rules to be used as an order input - bin aggregates output from multiple rules to be used as inputs to a rule. --- # Example Tupfile ``` : foreach *.csv |> java -jar saxon9he.jar process_csv.xsl process_csv.xsl input="%f" > %o |> %B.xml : foreach *.xml |> java -jar saxon9he.jar "%f" transform.xsl > "%o" |> %B.html .gitignore %f filename from inputs %b like %f, but without directory information %B like %f, but without file extension %e input filename extension %o output file(s) %O like %o, but without file extension %g string that a glob (*) matched foreach wildcards apply to filename only - not directories ``` --- # Demo * Stores information in SQLite database in .tup directory * Regenerates on dependency change * Regenerates on PATH change --- # Dependency Graph ``` tup graph . | dot -Tpng > dependency.png ```