{"id":21627541,"url":"https://github.com/billsioros/cereal","last_synced_at":"2025-03-18T20:27:32.322Z","repository":{"id":105137462,"uuid":"163318020","full_name":"billsioros/cereal","owner":"billsioros","description":"A surreal C++ project manager","archived":false,"fork":false,"pushed_at":"2023-12-15T17:43:46.000Z","size":2343,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T22:46:32.121Z","etag":null,"topics":["bash","bash-completion","bash-script","bash-scripting","build-automation","build-system","build-tool","builder","cplusplus","cpp","cpp-builder","generator","makefile","makefile-generation","module","module-loader","module-system","project-management","project-manager"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/billsioros.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}},"created_at":"2018-12-27T17:00:50.000Z","updated_at":"2020-05-08T20:22:40.000Z","dependencies_parsed_at":"2023-12-15T18:51:56.592Z","dependency_job_id":null,"html_url":"https://github.com/billsioros/cereal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billsioros%2Fcereal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billsioros%2Fcereal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billsioros%2Fcereal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billsioros%2Fcereal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billsioros","download_url":"https://codeload.github.com/billsioros/cereal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244300163,"owners_count":20430724,"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":["bash","bash-completion","bash-script","bash-scripting","build-automation","build-system","build-tool","builder","cplusplus","cpp","cpp-builder","generator","makefile","makefile-generation","module","module-loader","module-system","project-management","project-manager"],"created_at":"2024-11-25T01:16:55.430Z","updated_at":"2025-03-18T20:27:32.300Z","avatar_url":"https://github.com/billsioros.png","language":"Shell","readme":"\n![alt text](img/cereal.png)\n\n## Features\n\n* Project management tools\n* Makefile and module generation utilities\n* A macro definition shortcut system\n* Context aware autocompletion\n\n## Installation\n\n```bash\ngit clone https://github.com/billsioros/cereal; cd cereal/; ./install.sh\n```\n\n![alt text](img/install.png)\n\n* Running the installation script with the **--uninstall** option, will walk you through uninstalling **_cereal_**\n\n## Dependencies\n* [python3](https://www.python.org/download/releases/3.0/)\n\n## Programmatic usage\n\n* Firstly, let's run **_cereal_** with the **--config** option, so that a configuration file is generated for our project\n* An input consisting only of whitespace characters results in the field at hand taking its default value\n* The **--config** option can be used in the future to edit the configuration file\n* Bare in mind that, in case you alter your configuration file, updating the makefile is probably going to be required for some changes to take effect\n\n![alt text](img/config.png)\n\n* Let's now create a class named 'Point' using the **--class** option\n\n![alt text](img/class.png)\n\n```cpp\n\n#include \u003cpoint.hpp\u003e\n\nPoint::Point()\n{\n\n}\n\nPoint::Point(const Point\u0026 other)\n{\n\n}\n\nPoint::Point(Point\u0026\u0026 other) noexcept\n{\n\n}\n\nPoint::~Point()\n{\n\n}\n\nPoint\u0026 Point::operator=(const Point\u0026 other)\n{\n\n}\n\nPoint\u0026 Point::operator=(Point\u0026\u0026 other) noexcept\n{\n\n}\n\n```\n\n* Let's add some funtionality to its methods\n\n```cpp\n\n#include \u003cpoint.hpp\u003e\n\n#include \u003cutility\u003e\n#include \u003cfstream\u003e\n\nPoint::Point() : x(0.0f), y(0.0f)\n{\n}\n\nPoint::Point(float x, float y) : x(x), y(y)\n{\n}\n\nPoint::Point(const Point\u0026 other) : x(other.x), y(other.y)\n{\n}\n\nPoint::Point(Point\u0026\u0026 other) noexcept : x(std::move(other.x)), y(std::move(other.y))\n{\n}\n\nPoint\u0026 Point::operator=(const Point\u0026 other)\n{\n    x = other.x; y = other.y; return *this;\n}\n\nPoint\u0026 Point::operator=(Point\u0026\u0026 other) noexcept\n{\n    x = std::move(other.x); y = std::move(other.y); return *this;\n}\n\nstd::ostream\u0026 operator\u003c\u003c(std::ostream\u0026 os, const Point\u0026 point)\n{\n    return os\n    \u003c\u003c \"[ \" \u003c\u003c point.x\n    \u003c\u003c \", \" \u003c\u003c point.y\n    \u003c\u003c \" ]\";\n}\n\n```\n\n* Let's finally create a test unit and place it in the directory we designated as 'test-path' during the configuration stage\n\n```cpp\n\n#include \u003cpoint.hpp\u003e\n\n#include \u003cvector\u003e\n#include \u003ciostream\u003e\n\n#if defined (__ARBITARY__)\n    #include \u003ccstdlib\u003e\n    #include \u003cctime\u003e\n\n    #define rand01 (static_cast\u003cfloat\u003e(std::rand()) / static_cast\u003cfloat\u003e(RAND_MAX))\n    \n    #define frand(min, max) ((max - min) * rand01 + min)\n#endif\n\n#define SIZE (10UL)\n\nint main()\n{\n    std::vector\u003cPoint\u003e points;\n\n    #if defined (__ARBITARY__)\n        std::srand(static_cast\u003cunsigned\u003e(std::time(nullptr)));\n\n        for (std::size_t i = 0UL; i \u003c SIZE; i++)\n            points.emplace_back(frand(-10.0f, 10.0f), frand(-10.0f, 10.0f));\n    #else\n        for (std::size_t i = 0UL; i \u003c SIZE; i++)\n            points.emplace_back(0.0f, 0.0f);\n    #endif\n\n    for (const auto\u0026 point : points)\n        std::cout \u003c\u003c point \u003c\u003c std::endl;\n\n    return 0;\n}\n\n```\n\n* Let's now run **_cereal_** with the **--makefile** option to generate a makefile for our project\n\n![alt text](img/makefile.png)\n\n* Running **_cereal_** with the **--help** option results in the following output\n\n![alt text](img/help.png)\n\n* Let's now run **_cereal_** with the **--shortcuts** option and check if anything has changed\n\n![alt text](img/shortcuts.png)\n\n* As you can see, **_cereal_** has detected the macro **\\_\\_ARBITARY\\_\\_** and created a shortcut for defining it\n* I should mention at this point that **_cereal_** does not bother itself with the macro **SIZE**, as it does not take part in any conditional preprocessing block and thus it is considered a _statement_ rather than an _option_\n\n* The output of the final executable when compiled with and without the '-a' shortcut\n\n![alt text](img/with.png)\n\n![alt text](img/without.png)\n\n* The shortcut system works by expanding a _shortcut_ into its corresponding _value_, so you can easily create new shortcuts whose role is not defining a macro. For example:\n\n```json\n{\n    \"compiler\": \"g++\",\n    \"compiler-flags\": [\n        \"-Wall\",\n        \"-Wextra\",\n        \"-std=c++17\",\n        \"-g3\"\n    ],\n    \"external-libraries\": [],\n    \"include-path\": \"./inc\",\n    \"source-path\": \"./src\",\n    \"test-path\": \"./test\",\n    \"binaries-path\": \"./bin\",\n    \"shortcuts\": {\n        \"-a\": \"--local __ARBITARY__\",\n        \"--reset\": \"--config --makefile\"\n    }\n}\n```\n\n![alt text](img/reset.png)\n\n## License\n\nThe **_cereal_** project is licensed under the [MIT License](https://opensource.org/licenses/MIT)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillsioros%2Fcereal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillsioros%2Fcereal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillsioros%2Fcereal/lists"}