in ,

atilaneves / reggae, Hacker News

atilaneves / reggae, Hacker News

          Build system in D, Python, Ruby, Javascript or Lua           




A (meta) build system with multiple front (D, Python, Ruby, Javascript, Lua) and backends (make, ninja, tup, custom). This is alpha software, only tested on Linux and likely to have breaking changes made.

Detailed API documentation can be foundhere.


FeaturesMultiple frontends: write readable and concise build descriptions in D),

  • Python,RubyBuild Status,JavaScriptorLua. Your choice!
  • Multiple backends: generates build systems for make, ninja, tup, and a custom binary backend
  • Like autotools, no dependency on reggae itself for people who just want to build your software. The – the export
  • option generates a build system that works in the root of your project without having to install reggae on the target system

  • Flexible low-level DAG description DSL in each frontend to do anything
  • High-level DSL rules for common build system tasks for C, C and D projects
  • ******************************** (dub) **************** integration for D projects

    Not all features are available for all backends. Executable D code commands (as opposed to shell commands) are only supported by the binary backend, and due to tup’s nature dub support and a few other features are not available. When using the tup backend, simple is better.

    The recommended backend is ninja. If writing build descriptions in D, the binary backend is also recommended.

    ************************************************************************************ Usage

    Pick a language to write your description in and place a file called reggaefile. {d, py, rb, js, lua}

  • at the root of your project.

    In one of the scripting languages, a global variable with the type reggae.Build must exist with any name. Also, the relevant language-specific package can be installed using pip, gem, npm or luarocks to install the reggae package (reggae-js for npm). This is not required; the reggae binary includes the API for all scripting languages.

    In D, a function with return typeBuildmust exist with any name. Normally this function isn’t written by hand but by using thebuild template mixin (****************.

    From the the build directory, runreggae -b / path / to / your / project. You can now build your project using the appropriate command (ninja, make, tup, or ./build respectively).

    **************************************************** (Quick Start)

    The API is documentedelsewhereand the best examples can be found in thefeature testsTo build a simple hello app in C / C with a build description in Python:

    fromreggae  (import*app=executable ( name=

    This shows how to use theexecutable high-level convenience rule. For custom behavior the low-level primitives can be used. In D:

    importreggae;  enummainObj=Target (
    , **********************************************
    "gcc -I $ project / src -c $ in -o $ out", Target (****************************  src / main.c************************************));  enummathsObj=Target (
    , **********************************************
    "gcc -c $ in -o $ out", Target (**********************  "src / maths.c (**************" ));  enumapp=Target (


    Or in Python:

    fromreggae  (import*main_obj=Target (

    main.o , ********************************************

    **************************************)) maths_obj=Target (


    maths.o , ********************************************

    These wouldn't usually be used for compiling as above, since the high-level rules take care of that.


    build description file. A simple example for building production and unittest binaries concurrently is this:

    This is equivalent to the automatically generated reggaefile if none is present.

    ************ (Can only detect changes to the main build description file (eg) ************************************ ( ), but not any other files that were imported / required

  • These limitations. are solely due to the features not having been implemented yet.

    ******************************************Building Reggae

    To build reggae, you will need a D compiler. The dmd reference compiler is recommended. Reggae can build itself. To bootstrap, either use dub (dub build) or theninja


  • (****************************************
    (Read More) **************

    What do you think?

    Leave a Reply

    Your email address will not be published.

    GIPHY App Key not set. Please check settings

    Fashionable Problems, Hacker News

    Tottenham Hotspur 0-2 Chelsea, Premier League: Post-match reaction, ratings – We Ain't Got No History,

    Tottenham Hotspur 0-2 Chelsea, Premier League: Post-match reaction, ratings – We Ain't Got No History,