Closed benbjohnson closed 6 years ago
@titanous I added a sample DSL based on Flynn's host/Tupfile
. Let me know what you think about the syntax and approach.
This looks great!
depends
take multiple arguments to declare multiple inputs?%o
, etc)go build -o main.go
looks wrong.Will depends take multiple arguments to declare multiple inputs?
Yes, it'll take 0..n targets that are dependencies.
Will there be some kind of exec argument interpolation? (like Tup's %o, etc)
Yes, I'm debating the interpolation style. The %
qualifier means that you only get one character to name the variable (e.g. %o
). What about making them like environment variables? e.g. $BAKE_TARGET
. Or something with a more template style: e.g. #{TARGET}
or {{TARGET}}
go build -o main.go looks wrong
Yep. That was some poor copy-n-pasting. :)
What about making them like environment variables? e.g.
$BAKE_TARGET
. Or something with a more template style: e.g.#{TARGET}
or{{TARGET}}
I like the more explicit style if there are a lot of options. If there are only a small handful, one letter is shorter and fine.
Overview
The
Bakefile
language will be built as a simple, Lua DSL. Because Lua does not require parenthesis for methods and table literals can be defined using{...}
, we can make a DSL that feels declarative.The scope of this first cut will simply be to support targets and their execution. For target definition, we'll use a
target NAME, { COMMANDS }
command at the top level. Inside a target, it can execute commands using theexec CMD
command.Sample