Open dfintha opened 10 months ago
Calls to command-line utilities (git
, make
, pkg-config
, find
, ...) could be extracted into a separate module with its own unit tests, to check for presence of the GNU and/or LLVM utilities, and their relevant usage.
The result
module is OK by itself, its just a specialization of std::result::Result
and conversion functions for it.
The output
module should be merged into the utilities
module.
In the makefile
module, composition of various build steps/flags/dependencies should be extracted into separate functions, and their output should be tested with unit tests.
Simiar to the makefile
module, composition of commands in the project
module should be extracted into separate functions, and tested.
Also refactor-related: the clap
crate could be used in a more efficient way than manually building its scheme. Its parsing functionality should also be tested.
Helper functions could be moved into their relevant structures, and correlating functionalities could be composed into ones.
BuildScript
could be a structure, which can be used in place of ScriptEnvironment
and execute_script
.get_toolset_executables
and collect_source_files
could be internalized into the Project
structure.
The project currently looks like it evolved organically. A simple, robust architecture should be implemented, functionalities separated into layers, and tests added to each layer, and the in between.
This should be done before #36, the multiplatform support can benefit from these refactors.