Skip to content

skipbit/scrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

102 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

scrap πŸ”§

Build codecov License: MIT C++23

A Modern C++ Package Manager and Build System

Quick Start β€’ Features β€’ Installation β€’ Documentation β€’ Contributing


🎯 What is scrap?

scrap is a modern development tool for C++ that brings the simplicity and power of Rust's Cargo to the C++ ecosystem. It provides a unified interface for project management, dependency handling, and build orchestration - all without the traditional complexity of C++ development.

Why scrap?

C++ development has traditionally suffered from:

  • πŸ”§ Complex build systems - CMake, Make, Bazel, Meson... each with its own learning curve
  • πŸ“¦ No standard package manager - Unlike Rust, Go, or Node.js, C++ lacks a unified ecosystem
  • πŸ–₯️ System-dependent toolchains - "It works on my machine" is too common
  • πŸ“š High barrier to entry - Setting up a C++ project shouldn't require a PhD

scrap solves these problems by providing:

  • πŸš€ Zero-configuration project setup - Get started in seconds, not hours
  • πŸ“ Standardized project structure - Convention over configuration
  • πŸ”„ Reproducible builds - Same toolchain, same results, everywhere
  • πŸ“¦ Modern package management - GitHub-based ecosystem for sharing libraries
  • πŸ› οΈ Integrated toolchain management - No more system dependency hell

πŸš€ Quick Start

# Create a new C++ application
scrap new my-app

# Create a new C++ library
scrap new my-lib --type=lib

# Build your project
cd my-app
scrap build

# Run your application
scrap run

# Clean build artifacts
scrap clean

That's it! No CMakeLists.txt, no Makefiles, no complex setup. scrap handles everything.

✨ Features

πŸ“ Simple Configuration

Projects are configured with a simple scrap.toml file:

[package]
name = "my-app"
version = "0.1.0"
type = "app"
std = "23"

[[bin]]
name = "my-app"
src = "src/main.cpp"

[dependencies]
fmt = "10.2.1"
boost = { version = "1.84.0", features = ["filesystem", "asio"] }

🎨 Project Templates

Get started quickly with built-in templates:

# Use the default app template
scrap new my-project

# Use a specific template
scrap new my-game --template=game-engine

# Use a GitHub template
scrap new my-tool --template=github:user/template-repo

πŸ”§ Integrated Toolchain Management (Coming Soon)

# Install a specific toolchain
scrap toolchain install llvm@18.0.0

# List available toolchains
scrap toolchain list

# Select a toolchain for your project
scrap toolchain select gcc@13.2.0

πŸ“¦ Modern Package Management (Planned)

# Add a dependency
scrap add fmt

# Search for packages
scrap search boost

# Update dependencies
scrap update

πŸ“‹ Project Status

scrap is in early alpha development (v0.0.1). Currently implemented:

βœ… Core Features

  • Project creation (scrap new)
  • Template system with variable substitution
  • Basic command structure (build, run, clean)
  • Configuration file parsing (scrap.toml)

🚧 In Progress

  • Git-based template repository integration
  • Build system implementation
  • Toolchain management

πŸ“… Planned

  • Package registry and dependency management
  • Cross-compilation support
  • IDE integrations
  • CI/CD templates

πŸ› οΈ Installation

Prerequisites

  • C++23 compatible compiler (GCC 13+, Clang 16+, MSVC 2022+)
  • CMake 3.20 or higher
  • Git

Building from Source

# Clone the repository
git clone https://github.com/skipbit/scrap.git
cd scrap

# Configure and build
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release
cmake --build build/release --parallel

# The executable will be at build/release/bin/scrap

Install (Unix-like systems)

sudo cp build/release/bin/scrap /usr/local/bin/

πŸ“– Documentation

Detailed documentation is being developed. For now:

🌐 Ecosystem

scrap is building a comprehensive C++ ecosystem:

Related Repositories

Vision

Our goal is to create a Homebrew-like ecosystem for C++ development, where:

  • Libraries are easily discoverable and installable
  • Toolchains are managed independently from the system
  • Projects are reproducible across different environments
  • The community can easily contribute and share packages

🀝 Contributing

We welcome contributions! scrap is built with:

  • Clean Architecture - Domain-driven design with clear separation of concerns
  • Modern C++23 - Leveraging the latest language features
  • SOLID Principles - Extensible and maintainable codebase

How to Contribute

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Follow our coding style guide
  4. Commit your changes
  5. Push to your branch
  6. Open a Pull Request

Development Setup

# Clone with submodules
git clone --recursive https://github.com/skipbit/scrap.git

# Build in debug mode
cmake -S . -B build/debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTS=ON
cmake --build build/debug --parallel

# Run tests
cmake --build build/debug --target test

# Or run tests directly
./build/debug/test/scrap_test

Testing

The project uses Catch2 v3.7.1 for unit testing. Tests are automatically built when BUILD_TESTS=ON.

# Build and run all tests
cmake --build build/debug --target test

# Run tests with verbose output
ctest --test-dir build/debug --output-on-failure --verbose

# Run specific test executable
./build/debug/test/scrap_test

# Release build testing
cmake -S . -B build/release -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=ON
cmake --build build/release --target test

Test Structure:

  • test/unit/ - Unit tests for individual components
  • test/helpers/ - Test utilities (TestPresenter, FileSystemHelper)
  • test/fixtures/ - Test data and mock templates

πŸ“Š Roadmap

Phase 1: Foundation (Current)

  • βœ… Command structure and template system
  • 🚧 Configuration management
  • 🚧 Basic build system

Phase 2: Toolchain & Build

  • ⏳ Toolchain management
  • ⏳ Full build system implementation
  • ⏳ Dependency resolution

Phase 3: Package Ecosystem

  • ⏳ Package registry
  • ⏳ Binary package distribution
  • ⏳ Package publishing tools

Phase 4: Advanced Features

  • ⏳ Cross-compilation
  • ⏳ IDE integrations
  • ⏳ CI/CD templates
  • ⏳ SBOM generation

🎯 Design Philosophy

scrap follows these core principles:

  1. Convention over Configuration - Sensible defaults that just work
  2. Reproducible Builds - Same input, same output, everywhere
  3. Modern C++ First - Built for C++17/20/23, not C++98
  4. Community Driven - Open source, open development
  5. Developer Experience - Making C++ development enjoyable

πŸ“œ License

scrap is MIT licensed. See LICENSE for details.

πŸ™ Acknowledgments

scrap is inspired by:

  • Cargo - Rust's excellent package manager
  • Homebrew - The missing package manager for macOS
  • Poetry - Python's modern dependency management

Special thanks to all contributors and the C++ community for feedback and support.

πŸ“¬ Contact


Made with ❀️ for the C++ Community

⬆ Back to top

About

A Modern C++ Package Manager and Build System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages