dfintha / barge

A simple tool to build small, Assembly/C/C++/FORTRAN projects without writing custom makefiles. Written in Rust, ironically.
MIT License
1 stars 0 forks source link

Refactor the project architecture and add tests #41

Open dfintha opened 10 months ago

dfintha commented 10 months ago

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.

dfintha commented 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.

dfintha commented 10 months ago

The result module is OK by itself, its just a specialization of std::result::Result and conversion functions for it.

dfintha commented 10 months ago

The output module should be merged into the utilities module.

dfintha commented 10 months ago

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.

dfintha commented 10 months ago

Simiar to the makefile module, composition of commands in the project module should be extracted into separate functions, and tested.

dfintha commented 10 months ago

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.

dfintha commented 10 months ago

Helper functions could be moved into their relevant structures, and correlating functionalities could be composed into ones.