takwin

command module
v0.0.0-...-16119dc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 2 Imported by: 0

README ΒΆ

Takwin

CI Pipeline Release Go Report Card codecov GitHub release

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?

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

πŸ“š Resources

Documentation & Guides
Development Resources
Community & Support
Integration & Deployment
Performance & Compatibility

πŸ“„ 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 ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL