Skip to content

[REFACTOR] Refactor BinaryBuilder to support multi-language builds via interface #73

@thomas-vilte

Description

@thomas-vilte

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:

  1. Builder Interface: We will define a Builder interface that abstracts the build command generation and execution.
  2. Concrete Implementations:
    • GoBuilder: Encapsulates the existing go build logic.
    • RustBuilder: Implements cargo build logic for Rust support.
  3. 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) or Cargo.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    goPull requests that update go codegood first issueGood for newcomersrefactorCode restructuring or cleaning without functional changestech-debt

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions