On Friday, 17 June 2016 at 04:54:37 UTC, Jason White wrote:
Why the build script can't have a command line interface?

It could, but now the build script is a more complicated and for little gain.

It's only as complicated to implement required features and not more complicated. If the command line interface is not needed, it can be omitted, example:
---
import button;
auto Build = ...
mixin mainBuild!Build; //no CLI
---

Adding command line options on top of that to configure the build would be painful.

$ rdmd build.d configure [options]

Well, if one wants to go really complex, a prebuilt binary can be provided to help with that, but it's not always needed I think.

It would be simpler and cleaner to write a D program to generate the JSON build description for Button to consume. Then you can add a command line interface to configure how the build description is generated. This is how the Lua build descriptions work[1].

---
import button;
auto Build = ...
mixin mainBuildJSON!Build;
---
Should be possible to work like lua script.
              • R... ketmar via Digitalmars-d-announce
              • R... drug via Digitalmars-d-announce
              • R... Jacob Carlborg via Digitalmars-d-announce
              • R... sarn via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
              • R... Stefan Koch via Digitalmars-d-announce
              • R... Andrei Alexandrescu via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
            • Re: B... Kagamin via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
              • R... Kagamin via Digitalmars-d-announce
            • Re: B... Dicebot via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
              • R... Dicebot via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
              • R... Dicebot via Digitalmars-d-announce
              • R... Rory McGuire via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
              • R... Rory McGuire via Digitalmars-d-announce
              • R... Jason White via Digitalmars-d-announce
  • Re: Button: A fast, correct... H. S. Teoh via Digitalmars-d-announce

Reply via email to