{"id":13803617,"url":"https://github.com/atilaneves/reggae","last_synced_at":"2025-04-09T08:07:16.074Z","repository":{"id":27495836,"uuid":"30976075","full_name":"atilaneves/reggae","owner":"atilaneves","description":"Build system in D, Python, Ruby, Javascript or Lua","archived":false,"fork":false,"pushed_at":"2025-03-19T15:13:04.000Z","size":2627,"stargazers_count":183,"open_issues_count":34,"forks_count":22,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T06:51:22.906Z","etag":null,"topics":["build-system","build-tool","cmake","d","dlang","dlanguage","javascript","lua","make","makefile","makefile-generation","meta-buildtool","ninja","python","ruby","scripting-language","tup"],"latest_commit_sha":null,"homepage":"","language":"D","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atilaneves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-18T17:10:47.000Z","updated_at":"2025-03-19T09:58:13.000Z","dependencies_parsed_at":"2023-10-04T02:50:23.088Z","dependency_job_id":"431db591-23d7-4d28-9c61-e14f3abb6e21","html_url":"https://github.com/atilaneves/reggae","commit_stats":{"total_commits":1907,"total_committers":17,"mean_commits":"112.17647058823529","dds":0.5070791819611956,"last_synced_commit":"286ca85619e2476218fa026442cb6ed658d708be"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atilaneves%2Freggae","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atilaneves%2Freggae/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atilaneves%2Freggae/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atilaneves%2Freggae/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atilaneves","download_url":"https://codeload.github.com/atilaneves/reggae/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247999859,"owners_count":21031046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-system","build-tool","cmake","d","dlang","dlanguage","javascript","lua","make","makefile","makefile-generation","meta-buildtool","ninja","python","ruby","scripting-language","tup"],"created_at":"2024-08-04T01:00:36.211Z","updated_at":"2025-04-09T08:07:16.047Z","avatar_url":"https://github.com/atilaneves.png","language":"D","readme":"Reggae\n=======\n[![Actions Status](https://github.com/atilaneves/reggae/workflows/CI/badge.svg)](https://github.com/atilaneves/reggae/actions)\n[![Coverage](https://codecov.io/gh/atilaneves/reggae/branch/master/graph/badge.svg)](https://codecov.io/gh/atilaneves/reggae)\n\nA (meta) build system with multiple front (D, Python, Ruby,\nJavascript, Lua) and backends (make, ninja, tup, custom).\n\nDetailed API documentation can be found [here](doc/README.md).\n\nWhy?\n----\n\nDo we really need another build system? Yes.\n\nOn the frontend side, take CMake. CMake is pretty awesome. CMake's\nlanguage, on the other hand, is awful.  Many other build systems use\ntheir own proprietary languages that you have to learn to be able to\nuse them. I think that using a good tried-and-true general purpose\nprogramming language is better, with an API that is declarative as\nmuch as possible.\n\nOn the backend, it irks me that wanting to use tup means tying myself\nto it. Wouldn't it be nice to describe the build in my language of\nchoice and be able to choose between tup and ninja as an afterthought?\n\nI also wanted something that makes it easy to integrate different\nlanguages together.  Mixing D and C/C++ is usually a bit painful, for\ninstance. In the future it may include support for other statically\ncompiled languages. PRs welcome!\n\nreggae is really a flexible DAG describing API that happens to be good\nat building software.\n\nFeatures\n--------\n* Multiple frontends: write readable and concise build descriptions in\n[D](http://dlang.org/),\n[Python](https://github.com/atilaneves/reggae-python),\n[Ruby](https://github.com/atilaneves/reggae-ruby),\n[JavaScript](https://github.com/atilaneves/reggae-js)\nor [Lua](https://github.com/atilaneves/reggae-lua). Your choice!\n* Multiple backends: generates build systems for make, ninja, tup, and a custom binary backend\n* Like autotools, no dependency on reggae itself for people who just want to build your software.\nThe `--export` option generates a build system that works in the root of your project without\nhaving to install reggae on the target system\n* Flexible low-level DAG description DSL in each frontend to do anything\n* High-level DSL rules for common build system tasks for C, C++ and D projects\n* Automatic header/module dependency detection for C, C++ and D\n* Automatically runs itself if the build description changes\n* Out-of-tree builds - no need to create binaries in the source tree\n* User-defined variables like CMake in order to choose features before compile-time\n* [dub](http://code.dlang.org/about) integration for D projects\n\nNot all features are available for all backends. Executable D code\ncommands (as opposed to shell commands) are only supported by the\nbinary backend, and due to tup's nature dub support and a few other\nfeatures are not available. When using the tup backend, simple is\nbetter.\n\nThe recommended backend is ninja. If writing build descriptions in D,\nthe binary backend is also recommended.\n\nUsage\n-----\n\nPick a language to write your description in and place a file called\n`reggaefile.{d,py,rb,js,lua}` at the root of your project.\n\nIn one of the scripting languages, a global variable with the type\n`reggae.Build` must exist with any name. Also, the relevant\nlanguage-specific package can be installed using pip, gem, npm or\nluarocks to install the reggae package (reggae-js for npm). This is\nnot required; the reggae binary includes the API for all scripting\nlanguages.\n\nIn D, a function called `reggaeBuild` must exist that returns a\n`Build` object. Normally this function isn't written by hand but by\nusing the [build template mixin](payload/reggae/build.d).\n\nFrom the the build directory, run `reggae [-b \u003cninja|make|tup|binary\u003e]\n/path/to/your/project`. You can now build your project using the\nappropriate command (ninja, make, tup, or ./build respectively).\n\nQuick Start\n---------------------------------\n\nThe API is documented [elsewhere](doc/README.md) and the best examples\ncan be found in the [feature tests](features). To build a simple hello\napp in C/C++ with a build description in Python:\n\n```python\nfrom reggae import *\napp = executable(name=\"hello\", src_dirs=[\".\"], compiler_flags=\"-g -O0\")\nb = Build(app)\n```\n\nOr in D:\n\n```d\nimport reggae;\nalias app = executable!(ExeName(\"hello\"), Sources!([\".\"]), Flags(\"-g -O\"));\nmixin build!app;\n```\n\nThis shows how to use the `executable` high-level convenience rule. For custom behaviour\nthe low-level primitives can be used. In D:\n\n```d\nimport reggae;\nenum mainObj  = Target(\"main.o\",  \"gcc -I$project/src -c $in -o $out\", Target(\"src/main.c\"));\nenum mathsObj = Target(\"maths.o\", \"gcc -c $in -o $out\", Target(\"src/maths.c\"));\nenum app = Target(\"myapp\", \"gcc -o $out $in\", [mainObj, mathsObj]);\nmixin build!(app);\n```\n\nOr in Python:\n\n```python\nfrom reggae import *\nmain_obj = Target(\"main.o\",  \"gcc -I$project/src -c $in -o $out\", Target(\"src/main.c\"))\nmaths_obj = Target(\"maths.o\", \"gcc -c $in -o $out\", Target(\"src/maths.c\"))\napp = Target(\"myapp\", \"gcc -o $out $in\", [mainObj, mathsObj])\nbld = Build(app)\n```\n\nThese wouldn't usually be used for compiling as above, since the high-level rules take care of that.\n\nD projects and dub integration\n---------------\n\nThe easiest dub integration is to run reggae with a directory\ncontaining a dub project as parameter. That will create a build system\nwith a default target that would do the same as \"dub build\" but probably\nfaster. An optional `ut` target corresponds to the unittest executable of\n\"dub test\". For example:\n\n```bash\n# one-time setup (assuming the current working dir is a dub project,\n# i.e., contains a dub.{sdl,json} file):\nmkdir build\ncd build\nreggae ..\n\n# equivalent to \"dub build\":\nninja\n# equivalent to \"dub test -- \u003cargs\u003e\":\nninja ut \u0026\u0026 ./ut \u003cargs\u003e\n# build both default and unittest targets in parallel:\nninja default ut\n```\n\nFor advanced use cases, reggae provides an API to use dub build information\nin a `reggaefile.d` build description file. A simple example for building\nproduction and unittest binaries concurrently is this:\n\n```d\nimport reggae;\nalias main = dubBuild!(CompilerFlags(\"-g -debug\"));\nalias ut = dubBuild!(Configuration(\"unittest\"));\nmixin build!(main, ut);\n```\n\nScripting language limitations\n------------------------------\nBuild written in one of the scripting languages currently:\n\n* Can only detect changes to the main build description file (e.g. `reggaefile.py`),\nbut not any other files that were imported/required\n* Cannot use the binary backend\n* Do not have access to the dub high-level rules\n\nThese limitations are solely due to the features not having been implemented yet.\n\n\nBuilding Reggae\n---------------\n\nTo build reggae, you will need a D compiler. The dmd reference\ncompiler is recommended.  Reggae can build itself. To bootstrap,\neither use dub (dub build) or the\n[included bootstrap script](bootstrap.sh).  Call it without arguments\nfor `make` or with one to choose another backend, such as\n`ninja`. This will create a `reggae` binary in a `bin` directory then\ncall itself to generate the \"real\" build system with the requested\nbackend. The reggae-enabled build includes a unit test binary.\n","funding_links":[],"categories":["Build Tools"],"sub_categories":["Bare metal / kernel development"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatilaneves%2Freggae","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatilaneves%2Freggae","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatilaneves%2Freggae/lists"}