Drogon_ctl is excellent for scaffolding projects, views, and controllers, but the developer must drop back to raw CMake/Make workflows to compile and execute their project (mkdir build && cd build && cmake .. && make).To streamline the developer onboarding experience and provide a cohesive CLI interface similar to cargo build / cargo run (Rust) or dotnet build / dotnet run (C#), I would like to propose adding build and run subcommands directly to drogon_ctl. Proposed Functionality drogon_ctl build Checks for the presence of a build directory in the current working directory. If missing, creates it automatically. Automatically invokes the underlying build system using cross-platform safe executions.
drogon_ctl run Automatically triggers the build process first to ensure the binary is up to date. Finds and executes the generated project binary inside the build folder.
Benefits:
Better Developer Experience (DX): Reduces context switching between the framework's CLI tool and raw terminal commands.
Onboarding: Beginners can go from zero to a running Drogon server using entirely framework-native commands.
I am happy to contribute the implementation for this! Looking at the drogon_ctl source directory, we can implement these as new subcommand handlers. To ensure cross-platform compatibility (Linux, macOS, Windows), we can utilize C++17's for the directory checks/creation and std::system (or a cleaner platform-agnostic process wrapper) to invoke cmake. I would love to get the maintainers' thoughts on this addition before I begin working on the Pull Request. Are there any architectural constraints or specific design patterns you would prefer I follow for this?
Drogon_ctl is excellent for scaffolding projects, views, and controllers, but the developer must drop back to raw CMake/Make workflows to compile and execute their project (mkdir build && cd build && cmake .. && make).To streamline the developer onboarding experience and provide a cohesive CLI interface similar to cargo build / cargo run (Rust) or dotnet build / dotnet run (C#), I would like to propose adding build and run subcommands directly to drogon_ctl. Proposed Functionality drogon_ctl build Checks for the presence of a build directory in the current working directory. If missing, creates it automatically. Automatically invokes the underlying build system using cross-platform safe executions.
drogon_ctl run Automatically triggers the build process first to ensure the binary is up to date. Finds and executes the generated project binary inside the build folder.
Benefits:
Better Developer Experience (DX): Reduces context switching between the framework's CLI tool and raw terminal commands.
Onboarding: Beginners can go from zero to a running Drogon server using entirely framework-native commands.
I am happy to contribute the implementation for this! Looking at the drogon_ctl source directory, we can implement these as new subcommand handlers. To ensure cross-platform compatibility (Linux, macOS, Windows), we can utilize C++17's for the directory checks/creation and std::system (or a cleaner platform-agnostic process wrapper) to invoke cmake. I would love to get the maintainers' thoughts on this addition before I begin working on the Pull Request. Are there any architectural constraints or specific design patterns you would prefer I follow for this?