-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Context
We currently rely on a hardcoded build process within BinaryBuilder that strictly supports Go. This tight coupling prevents us from building projects written in other languages, specifically Rust, and makes the codebase difficult to extend for future language support. We need to decouple the build logic from the execution flow to support a multi-language environment.
Technical Details
We will refactor the existing BinaryBuilder to use a strategy pattern. The specific changes include:
- Builder Interface: We will define a
Builderinterface that abstracts the build command generation and execution. - Concrete Implementations:
GoBuilder: Encapsulates the existinggo buildlogic.RustBuilder: Implementscargo buildlogic for Rust support.
- Auto-detection: We will implement a detection mechanism that inspects the project root. It will instantiate the correct builder by checking for the presence of
go.mod(for Go) orCargo.toml(for Rust).
Impact
This refactoring allows us to support Rust projects immediately and paves the way for adding other languages in the future without modifying the core orchestration logic. It significantly reduces technical debt by separating language-specific build details from the main application flow.