├── docs ├── .gitignore ├── _sass │ ├── _base.scss │ ├── _layout.scss │ └── _syntax-highlighting.scss ├── Gemfile ├── assets │ ├── img │ │ └── build.png │ └── css │ │ └── main.scss ├── _includes │ ├── scripts.html │ ├── footer.html │ ├── head.html │ ├── sidebar.html │ └── header.html ├── _layouts │ ├── default.html │ └── doc.html ├── _config.yml ├── _docs │ ├── commands │ │ ├── help.md │ │ ├── init.md │ │ ├── graph.md │ │ ├── convert.md │ │ └── build.md │ ├── install.md │ ├── index.md │ └── tutorial.md ├── deploy ├── index.html └── Gemfile.lock ├── examples └── basic │ ├── foo.c │ ├── bar.c │ ├── foo.h │ ├── BUILD.lua │ └── button.json ├── .gitignore ├── source ├── util │ ├── package.d │ └── change.d └── button │ ├── watcher │ ├── kqueue.d │ ├── fsevents.d │ ├── windows.d │ ├── package.d │ └── inotify.d │ ├── cli │ ├── package.d │ ├── gc.d │ ├── help.d │ ├── status.d │ ├── clean.d │ ├── convert.d │ ├── init.d │ ├── graph.d │ ├── build.d │ └── options.d │ ├── handlers │ ├── tracer │ │ ├── package.d │ │ └── strace.d │ ├── package.d │ ├── recursive.d │ ├── gcc.d │ ├── dmd.d │ └── base.d │ ├── context.d │ ├── exceptions.d │ ├── edgedata.d │ ├── edge.d │ ├── app.d │ ├── events.d │ ├── textcolor.d │ ├── deps.d │ ├── loggers │ └── console.d │ ├── handler.d │ ├── command.d │ ├── rule.d │ ├── task.d │ └── resource.d ├── .travis.yml ├── dub.sdl ├── LICENSE └── README.md /docs/.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle 2 | /_site 3 | -------------------------------------------------------------------------------- /docs/_sass/_base.scss: -------------------------------------------------------------------------------- 1 | .text-muted { 2 | #color: #777; 3 | } 4 | -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | gem 'github-pages', group: :jekyll_plugins 3 | -------------------------------------------------------------------------------- /examples/basic/foo.c: -------------------------------------------------------------------------------- 1 | #include "foo.h" 2 | 3 | int foo() 4 | { 5 | return 1; 6 | } 7 | -------------------------------------------------------------------------------- /examples/basic/bar.c: -------------------------------------------------------------------------------- 1 | #include "foo.h" 2 | 3 | int main() 4 | { 5 | return foo(); 6 | } 7 | -------------------------------------------------------------------------------- /docs/assets/img/build.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jasonwhite/button/HEAD/docs/assets/img/build.png -------------------------------------------------------------------------------- /examples/basic/foo.h: -------------------------------------------------------------------------------- 1 | #ifndef FOO_H 2 | #define FOO_H 3 | 4 | int foo(); 5 | 6 | #endif // FOO_H 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .dub 2 | docs.json 3 | *.o 4 | *.swp 5 | /button 6 | /button-test-library 7 | dub.selections.json 8 | __test__library__ 9 | __pycache__/ 10 | .*.state 11 | *.bb.json 12 | -------------------------------------------------------------------------------- /docs/_includes/scripts.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /source/util/package.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | */ 6 | module util; 7 | 8 | public import util.sqlite3; 9 | public import util.change; 10 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 |
5 | {% include header.html %} 6 | {{ content }} 7 | {% include footer.html %} 8 | {% include scripts.html %} 9 | 10 | 11 | -------------------------------------------------------------------------------- /docs/assets/css/main.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | @charset "utf-8"; 4 | 5 | // Width of the content area 6 | $content-width: 1100px; 7 | $baseurl: {{ site.baseurl }}; 8 | 9 | // Import partials from `sass_dir` (defaults to `_sass`) 10 | @import "base", "layout", "syntax-highlighting"; 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | 4 | language: d 5 | 6 | d: 7 | - dmd 8 | 9 | # Ruby is needed to build the Jekyll docs 10 | before_install: 11 | - sudo apt-get -qq update 12 | - sudo apt-get install -y ruby 13 | 14 | after_success: 15 | - cd docs && ./deploy 16 | -------------------------------------------------------------------------------- /examples/basic/BUILD.lua: -------------------------------------------------------------------------------- 1 | --[[ 2 | Copyright 2016 Jason White. MIT license. 3 | 4 | Description: 5 | Generates the build description for a simple "foobar" program. 6 | ]] 7 | 8 | local cc = require "rules.cc" 9 | 10 | cc.binary { 11 | name = "foobar", 12 | srcs = glob "*.c", 13 | } 14 | -------------------------------------------------------------------------------- /source/button/watcher/kqueue.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | */ 6 | module button.watcher.kqueue; 7 | 8 | version (Windows): 9 | 10 | // TODO: Use kqueue to watch for file system changes. 11 | static assert(false, "Not implemented yet"); 12 | -------------------------------------------------------------------------------- /source/button/watcher/fsevents.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | */ 6 | module button.watcher.fsevents; 7 | 8 | 9 | version (OSX): 10 | 11 | // TODO: Use FSEvents to watch for file system changes. 12 | static assert(false, "Not implemented yet"); 13 | -------------------------------------------------------------------------------- /source/button/watcher/windows.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | */ 6 | module button.watcher.windows; 7 | 8 | version (Windows): 9 | 10 | // TODO: Use ReadDirectoryChangesW to watch for file system changes. 11 | static assert(false, "Not implemented yet"); 12 | -------------------------------------------------------------------------------- /dub.sdl: -------------------------------------------------------------------------------- 1 | name "button" 2 | description "A build system that aims to be correct, scalable, and robust." 3 | copyright "Copyright © 2016, Jason White" 4 | authors "Jason White" 5 | license "MIT" 6 | 7 | dependency "fio" version=">=0.0.9" 8 | dependency "darg" version=">=0.0.4" 9 | 10 | sourcePaths "source/button" "source/util" 11 | 12 | libs "sqlite3" platform="posix" 13 | -------------------------------------------------------------------------------- /docs/_includes/footer.html: -------------------------------------------------------------------------------- 1 | 13 | -------------------------------------------------------------------------------- /source/button/cli/package.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | */ 6 | module button.cli; 7 | 8 | public import button.cli.options; 9 | public import button.cli.build; 10 | public import button.cli.graph; 11 | public import button.cli.help; 12 | public import button.cli.status; 13 | public import button.cli.clean; 14 | public import button.cli.init; 15 | public import button.cli.gc; 16 | public import button.cli.convert; 17 | -------------------------------------------------------------------------------- /examples/basic/button.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": ["foo.c", "foo.h"], 4 | "task": [["gcc", "-c", "foo.c", "-o", "foo.o"]], 5 | "outputs": ["foo.o"] 6 | }, 7 | { 8 | "inputs": ["bar.c", "foo.h"], 9 | "task": [["gcc", "-c", "bar.c", "-o", "bar.o"]], 10 | "outputs": ["bar.o"] 11 | }, 12 | { 13 | "inputs": ["foo.o", "bar.o"], 14 | "task": [["gcc", "foo.o", "bar.o", "-o", "foobar"]], 15 | "outputs": ["foobar"] 16 | } 17 | ] 18 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: Button 2 | description: > 3 | A recursive, universal build system. 4 | baseurl: "/button" 5 | url: "https://jasonwhite.github.io" # the base hostname & protocol for your site 6 | github: "https://github.com/jasonwhite/button" 7 | 8 | permalink: /:path/:basename 9 | 10 | collections: 11 | docs: 12 | output: true 13 | 14 | defaults: 15 | - scope: 16 | path: "" 17 | type: docs 18 | values: 19 | layout: doc 20 | category: intro 21 | 22 | markdown: kramdown 23 | -------------------------------------------------------------------------------- /docs/_docs/commands/help.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "button help" 3 | category: commands 4 | --- 5 | 6 | Prints help. 7 | 8 | ## Examples 9 | 10 | To get general help: 11 | 12 | $ button help 13 | 14 | To get help on a specific command: 15 | 16 | $ button help build 17 | 18 | Alternatively, the `--help` argument can be specified for a particular command: 19 | 20 | $ button build --help 21 | 22 | ## Positional Arguments 23 | 24 | * `command` 25 | 26 | The command to get help on. If not specified, prints general help. 27 | -------------------------------------------------------------------------------- /source/button/handlers/tracer/package.d: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright: Copyright Jason White, 2016 3 | * License: MIT 4 | * Authors: Jason White 5 | * 6 | * Description: 7 | * Traces system calls in the process for precise dependency detection at the 8 | * cost of speed. This should be the fallback for a command if there is no 9 | * specialized handler for running it. 10 | */ 11 | module button.handlers.tracer; 12 | 13 | version (linux) 14 | { 15 | // Use strace on Linux. 16 | public import button.handlers.tracer.strace; 17 | } 18 | else 19 | { 20 | static assert(false, "Not implemented yet."); 21 | } 22 | -------------------------------------------------------------------------------- /docs/_layouts/doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {% include head.html %} 4 | 5 | {% include header.html %} 6 |A universal build system to build your software at the push of a 9 | button.
10 | 11 |Button is currently only supported on Linux, but 16 | there are plans to also support OS X and Windows soonish.
17 |There is no need to exhaustively list dependencies (such as C++ 22 | header files). Dependencies for any language can be determined 23 | automatically.
24 |Outputs removed from the build are automatically removed from 28 | disk. Changes are determined by file contents, not just by 29 | timestamps. Combined with implicit dependency detection, correct 30 | incremental builds can be ensured.
31 |Any build task can also be a build system. This simple feature is 35 | incredibly powerful. As part of the build, you can generate your build 36 | description with, say, a high-level scripting language like Lua.
37 |Dependencies can be watched to automatically trigger a build when 43 | they change. This can help speed up the edit-compile-test 44 | development cycle.
45 |A graph of the task graph can be displayed. This helps give you 49 | an immediate and intuitive understanding of the structure of your 50 | build.
51 |This is not a language-specific build system. While there are 55 | convenient abstractions for building common languages, there are no 56 | restrictions on building projects not covered by those 57 | abstractions.
58 |