Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/billsioros/cereal
A surreal C++ project manager
https://github.com/billsioros/cereal
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
Last synced: 13 days ago
JSON representation
A surreal C++ project manager
- Host: GitHub
- URL: https://github.com/billsioros/cereal
- Owner: billsioros
- License: mit
- Created: 2018-12-27T17:00:50.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:43:46.000Z (about 1 year ago)
- Last Synced: 2024-11-25T01:16:53.200Z (2 months ago)
- 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
- Language: Shell
- Homepage:
- Size: 2.23 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![alt text](img/cereal.png)
## Features
* Project management tools
* Makefile and module generation utilities
* A macro definition shortcut system
* Context aware autocompletion## Installation
```bash
git clone https://github.com/billsioros/cereal; cd cereal/; ./install.sh
```![alt text](img/install.png)
* Running the installation script with the **--uninstall** option, will walk you through uninstalling **_cereal_**
## Dependencies
* [python3](https://www.python.org/download/releases/3.0/)## Programmatic usage
* Firstly, let's run **_cereal_** with the **--config** option, so that a configuration file is generated for our project
* An input consisting only of whitespace characters results in the field at hand taking its default value
* The **--config** option can be used in the future to edit the configuration file
* 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![alt text](img/config.png)
* Let's now create a class named 'Point' using the **--class** option
![alt text](img/class.png)
```cpp
#include
Point::Point()
{}
Point::Point(const Point& other)
{}
Point::Point(Point&& other) noexcept
{}
Point::~Point()
{}
Point& Point::operator=(const Point& other)
{}
Point& Point::operator=(Point&& other) noexcept
{}
```
* Let's add some funtionality to its methods
```cpp
#include
#include
#includePoint::Point() : x(0.0f), y(0.0f)
{
}Point::Point(float x, float y) : x(x), y(y)
{
}Point::Point(const Point& other) : x(other.x), y(other.y)
{
}Point::Point(Point&& other) noexcept : x(std::move(other.x)), y(std::move(other.y))
{
}Point& Point::operator=(const Point& other)
{
x = other.x; y = other.y; return *this;
}Point& Point::operator=(Point&& other) noexcept
{
x = std::move(other.x); y = std::move(other.y); return *this;
}std::ostream& operator<<(std::ostream& os, const Point& point)
{
return os
<< "[ " << point.x
<< ", " << point.y
<< " ]";
}```
* Let's finally create a test unit and place it in the directory we designated as 'test-path' during the configuration stage
```cpp
#include
#include
#include#if defined (__ARBITARY__)
#include
#include#define rand01 (static_cast(std::rand()) / static_cast(RAND_MAX))
#define frand(min, max) ((max - min) * rand01 + min)
#endif#define SIZE (10UL)
int main()
{
std::vector points;#if defined (__ARBITARY__)
std::srand(static_cast(std::time(nullptr)));for (std::size_t i = 0UL; i < SIZE; i++)
points.emplace_back(frand(-10.0f, 10.0f), frand(-10.0f, 10.0f));
#else
for (std::size_t i = 0UL; i < SIZE; i++)
points.emplace_back(0.0f, 0.0f);
#endiffor (const auto& point : points)
std::cout << point << std::endl;return 0;
}```
* Let's now run **_cereal_** with the **--makefile** option to generate a makefile for our project
![alt text](img/makefile.png)
* Running **_cereal_** with the **--help** option results in the following output
![alt text](img/help.png)
* Let's now run **_cereal_** with the **--shortcuts** option and check if anything has changed
![alt text](img/shortcuts.png)
* As you can see, **_cereal_** has detected the macro **\_\_ARBITARY\_\_** and created a shortcut for defining it
* 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_* The output of the final executable when compiled with and without the '-a' shortcut
![alt text](img/with.png)
![alt text](img/without.png)
* 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:
```json
{
"compiler": "g++",
"compiler-flags": [
"-Wall",
"-Wextra",
"-std=c++17",
"-g3"
],
"external-libraries": [],
"include-path": "./inc",
"source-path": "./src",
"test-path": "./test",
"binaries-path": "./bin",
"shortcuts": {
"-a": "--local __ARBITARY__",
"--reset": "--config --makefile"
}
}
```![alt text](img/reset.png)
## License
The **_cereal_** project is licensed under the [MIT License](https://opensource.org/licenses/MIT)