README
ΒΆ
Takwin
A modern, lightning-fast build tool for C and C++ projects. Built with Go for enterprise-grade performance and reliability.
Table of Contents
- Why Takwin?
- Quick Start
- Features
- Documentation
- Configuration
- Configuration Reference
- Examples
- Performance Comparison
- Development
- Development Tasks
- Enterprise Usage
- Contributing
- Project Status
- Roadmap
- Resources
π Why Takwin?
Lightning-Fast Build Tool
- Instant startup: ~50ms startup time
- Single binary: No runtime dependencies or complex installations
- Cross-platform: Native support for Linux, macOS, and Windows
- Enterprise-ready: Comprehensive testing, CI/CD, and security scanning
β‘ Quick Start
Installation
# Linux/macOS
curl -L https://github.com/hakkim/takwin/releases/latest/download/takwin-linux-amd64.tar.gz | tar -xz
sudo mv takwin-linux-amd64 /usr/local/bin/takwin
# macOS (Homebrew)
brew tap hakkim/tap && brew install takwin
# Windows (PowerShell)
Invoke-WebRequest -Uri "https://github.com/hakkim/takwin/releases/latest/download/takwin-windows-amd64.zip" -OutFile "takwin.zip"
Expand-Archive -Path "takwin.zip" -DestinationPath "C:\Program Files\Takwin"
# Docker
docker pull ghcr.io/hakkim/takwin:latest
Your First Build
# Create a new C++ project
mkdir hello-world && cd hello-world
# Create source file
cat > main.cpp << EOF
#include <iostream>
int main() {
std::cout << "Hello, Takwin!" << std::endl;
return 0;
}
EOF
# Create build configuration
cat > build.toml << EOF
[project]
name = "hello"
version = "1.0.0"
[[targets]]
name = "hello"
type = "executable"
sources = ["main.cpp"]
EOF
# Build and run
takwin build
./build/bin/hello
Basic Commands
# Build all targets
takwin build
# Build specific target
takwin build -t my_target
# Build with verbose output
takwin build -v
# List available targets
takwin list-targets
# Clean build artifacts
takwin clean
# Use custom config file
takwin build -c my_config.toml
# Show version
takwin --version
# Show help
takwin --help
ποΈ Features
Core Capabilities
- β Multi-target builds - Executables, static libraries, shared libraries
- β Cross-platform compilers - GCC, Clang, MSVC support
- β Flexible source resolution - Glob patterns and explicit file lists
- β Dependency management - Library linking and include paths
- β Optimization levels - O0, O1, O2, O3, Os support
- β Custom build flags - Compile and link flag customization
Developer Experience
- β Simple TOML configuration - Human-readable build files
- β Comprehensive validation - Early error detection
- β Verbose output modes - Detailed build information
- β Clean build management - Artifact cleanup
- β Target listing - Easy project overview
Enterprise Features
- β Security scanning - Automated vulnerability detection
- β Comprehensive testing - >85% code coverage
- β CI/CD ready - GitHub Actions workflows included
- β Docker support - Containerized builds
- β Cross-compilation - Build for any platform from any platform
π Documentation
| Resource | Description |
|---|---|
| Installation Guide | Detailed installation instructions for all platforms |
| Quick Start Tutorial | Get up and running in 5 minutes |
| Configuration Reference | Complete configuration options |
| CLI Reference | Command-line interface documentation |
| Examples | Real-world usage examples |
| API Documentation | Go package documentation |
π§ Configuration
Simple Project
[project]
name = "my_app"
version = "1.0.0"
[build]
compiler = "gcc"
optimization = "O2"
[[targets]]
name = "main"
type = "executable"
sources = ["src/*.cpp"]
include_paths = ["include"]
Complex Multi-Target Project
[project]
name = "advanced_project"
version = "2.1.0"
[build]
compiler = "gcc"
optimization = "O2"
output_dir = "build"
include_paths = ["include", "third_party/include"]
compile_flags = ["-Wall", "-Wextra", "-std=c++17"]
# Static library
[[targets]]
name = "core"
type = "static_library"
sources = ["src/core/*.cpp"]
output = "libcore"
# Shared library
[[targets]]
name = "plugin"
type = "shared_library"
sources = ["src/plugin/*.cpp"]
libraries = ["core"]
library_paths = ["build/lib"]
# Main executable
[[targets]]
name = "app"
type = "executable"
sources = ["src/main.cpp"]
libraries = ["core", "pthread"]
library_paths = ["build/lib"]
compile_flags = ["-DVERSION=\"2.1.0\""]
Configuration Reference
Essential Configuration Options
Project Section:
[project]
name = "my_project" # Project name (required)
version = "1.0.0" # Project version (required)
Build Section:
[build]
compiler = "gcc" # Compiler: gcc, clang, msvc
optimization = "O2" # Optimization: O0, O1, O2, O3, Os
output_dir = "build" # Output directory
include_paths = ["include"] # Include directories
libraries = ["pthread"] # Libraries to link
compile_flags = ["-Wall"] # Custom compile flags
link_flags = ["-static"] # Custom link flags
Targets Section:
[[targets]]
name = "my_app" # Target name (required)
type = "executable" # Type: executable, static_library, shared_library
sources = ["src/*.cpp"] # Source files (glob patterns supported)
output = "custom_name" # Custom output name (optional)
include_paths = ["inc"] # Target-specific includes
libraries = ["mylib"] # Target-specific libraries
library_paths = ["lib"] # Library search paths
π For complete configuration options, see the Configuration Reference
Examples
Simple Executable
[project]
name = "hello"
version = "1.0.0"
[[targets]]
name = "hello"
type = "executable"
sources = ["main.cpp"]
Library with Executable
[project]
name = "math_project"
version = "1.0.0"
[build]
compiler = "gcc"
optimization = "O2"
# Static library
[[targets]]
name = "mathlib"
type = "static_library"
sources = ["src/math/*.cpp"]
# Executable using the library
[[targets]]
name = "calculator"
type = "executable"
sources = ["src/main.cpp"]
libraries = ["mathlib"]
library_paths = ["build/lib"]
Cross-Platform Configuration
[project]
name = "cross_platform"
version = "1.0.0"
[build]
compiler = "gcc"
optimization = "O2"
include_paths = ["include"]
# Windows-specific settings
[build.windows]
libraries = ["ws2_32", "user32"]
compile_flags = ["-DWIN32"]
# Linux-specific settings
[build.linux]
libraries = ["pthread", "dl"]
compile_flags = ["-DLINUX"]
[[targets]]
name = "app"
type = "executable"
sources = ["src/*.cpp"]
π More examples available in the Examples Documentation
π Performance Metrics
| Metric | Value | Benefit |
|---|---|---|
| Startup Time | ~50ms | Instant feedback |
| Memory Usage | ~5MB | Lightweight footprint |
| Binary Size | ~8MB | Easy distribution |
| Build Speed | Fast | Efficient compilation |
| Distribution | Single binary | No dependencies |
π οΈ Development
Prerequisites
- Go 1.20 or later
- GCC/Clang/MSVC (for building C++ projects)
Building from Source
git clone https://github.com/hakkim/takwin.git
cd takwin
# Install dependencies
go mod download
# Run tests
go test ./...
# Build
go build -o takwin main.go
# Cross-compile
GOOS=linux GOARCH=amd64 go build -o takwin-linux main.go
GOOS=windows GOARCH=amd64 go build -o takwin.exe main.go
GOOS=darwin GOARCH=amd64 go build -o takwin-macos main.go
Development Workflow
# Format code
go fmt ./...
# Lint code
golangci-lint run
# Run tests with coverage
go test -race -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
# Run integration tests
cd examples/simple && ../../takwin build
cd examples/complex && ../../takwin build -t mathlib
Development Tasks
Takwin includes convenient development workflows:
# Quick validation (build + test examples)
go test ./... && cd examples/simple && ../../takwin build
# Code quality checks
go fmt ./... # Format code
go vet ./... # Check for issues
golangci-lint run # Comprehensive linting
# Testing
go test ./... # Run all tests
go test -race ./... # Run with race detection
go test -coverprofile=coverage.out ./... # Generate coverage
go tool cover -html=coverage.out # View coverage report
# Building
go build -o takwin main.go # Build for current platform
go build -ldflags="-s -w" -o takwin main.go # Optimized build
# Cross-compilation
GOOS=linux GOARCH=amd64 go build -o takwin-linux main.go
GOOS=windows GOARCH=amd64 go build -o takwin.exe main.go
GOOS=darwin GOARCH=amd64 go build -o takwin-macos main.go
# Example testing
cd examples/simple && ../../takwin build # Test simple example
cd examples/complex && ../../takwin build -t mathlib # Test complex example
Project Structure
takwin/ # Repository root
βββ main.go # Entry point
βββ cmd/ # CLI commands (Cobra)
β βββ root.go # Root command and global flags
β βββ build.go # Build command implementation
β βββ clean.go # Clean command implementation
β βββ list.go # List targets command
βββ internal/ # Internal packages
β βββ config/ # Configuration handling
β β βββ config.go # TOML parsing and validation
β β βββ config_test.go # Configuration tests
β βββ build/ # Build engine
β β βββ engine.go # Main build orchestration
β β βββ engine_test.go # Build engine tests
β βββ compiler/ # Compiler adapters
β β βββ adapter.go # GCC, Clang, MSVC implementations
β β βββ adapter_test.go # Compiler tests
β βββ platform/ # Platform-specific code
β β βββ adapter.go # Windows, Linux, macOS support
β βββ sources/ # Source file resolution
β βββ resolver.go # Glob and explicit file handling
β βββ resolver_test.go # Source resolution tests
βββ examples/ # Example projects
β βββ simple/ # Basic executable example
β βββ complex/ # Multi-target library example
βββ docs/ # Documentation
βββ .github/ # GitHub Actions workflows
βββ go.mod # Go module definition
βββ go.sum # Dependency checksums
βββ Dockerfile # Container build
βββ CHANGELOG.md # Version history
βββ CONTRIBUTING.md # Contribution guidelines
βββ SECURITY.md # Security policy
βββ LICENSE # MIT license
π’ Enterprise Usage
CI/CD Integration
# GitHub Actions example
- name: Setup Takwin
run: |
curl -L https://github.com/hakkim/takwin/releases/latest/download/takwin-linux-amd64.tar.gz | tar -xz
sudo mv takwin-linux-amd64 /usr/local/bin/takwin
- name: Build Project
run: takwin build
- name: Run Tests
run: ./build/bin/tests
Docker Usage
FROM ghcr.io/hakkim/takwin:latest AS builder
COPY . /workspace
WORKDIR /workspace
RUN takwin build
FROM alpine:latest
COPY --from=builder /workspace/build/bin/myapp /usr/local/bin/
CMD ["myapp"]
Security & Compliance
- Vulnerability scanning with gosec and nancy
- Dependency verification with go mod verify
- SBOM generation for supply chain security
- Signed releases with checksums
- Regular security updates
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Quick Contribution Setup
# Fork and clone
git clone https://github.com/yourusername/takwin.git
cd takwin
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
go test ./...
golangci-lint run
# Commit and push
git commit -m "Add amazing feature"
git push origin feature/amazing-feature
# Create pull request
π Project Status
- Stability: Production Ready
- Maintenance: Actively Maintained
- Support: Community + Enterprise
- License: MIT
- Go Version: 1.20+
Release Cycle
- Major releases: Every 6-12 months
- Minor releases: Monthly
- Patch releases: As needed
- Security updates: Immediate
π£οΈ Roadmap
Planned Features
Performance & Scalability:
- Incremental builds (only rebuild changed files)
- Dependency tracking and caching
- Parallel compilation support
- Build performance profiling
- Remote build caching
Developer Experience:
- IDE integration (VS Code, CLion, Vim)
- Interactive configuration wizard
- Build visualization and debugging
- Hot reload for development builds
- Build templates and scaffolding
Enterprise Features:
- Plugin system for extensibility
- Package management integration (Conan, vcpkg)
- Advanced cross-compilation support
- Build artifact signing
- Enterprise authentication and authorization
Ecosystem Integration:
- CMake project import/export
- Bazel compatibility layer
- Continuous integration templates
- Cloud build support (GitHub Actions, GitLab CI)
- Container-native builds
Current Status
β Completed (v2.0.0):
- Core build functionality
- Cross-platform support (Linux, macOS, Windows)
- Multiple compiler support (GCC, Clang, MSVC)
- TOML configuration system
- Comprehensive testing (>85% coverage)
- CI/CD pipeline with security scanning
- Docker support and multi-arch builds
- Enterprise-grade documentation
π§ In Progress:
- Advanced configuration validation
- Enhanced error messages and diagnostics
- Performance optimizations
- Extended platform support
π Planned (v2.1.0):
- Incremental build support
- IDE integration plugins
- Build caching system
- Enhanced cross-compilation
π Links
π Resources
Documentation & Guides
- Complete Documentation - Comprehensive guides and references
- Installation Guide - Platform-specific installation
- Quick Start Tutorial - Get started in 5 minutes
- Configuration Reference - Complete configuration options
- CLI Reference - Command-line interface guide
- Examples - Real-world usage examples
- Contributing Guide - How to contribute
- Security Policy - Security and vulnerability reporting
Development Resources
- API Documentation - Go package documentation
- Architecture Guide - Internal design and structure
- Testing Guide - Testing strategies and practices
- Release Process - How releases are made
Community & Support
- GitHub Repository - Source code and development
- Issue Tracker - Bug reports and feature requests
- Discussions - Community discussions and Q&A
- Release Notes - Version history and changes
Integration & Deployment
- Docker Hub - Official Docker images
- GitHub Packages - Container registry
- GitHub Actions - CI/CD pipelines
- Homebrew Formula - macOS package manager
Performance & Compatibility
- Performance Benchmarks - Speed and efficiency metrics
- Compatibility Matrix - Platform and compiler support
π License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ for the C/C++ community
Takwin: Where enterprise meets simplicity in C/C++ builds.
Documentation
ΒΆ
There is no documentation for this package.