Skip to content

Latest commit

 

History

History
200 lines (147 loc) · 4.94 KB

File metadata and controls

200 lines (147 loc) · 4.94 KB

Build System Documentation

This document describes how to build the TikTok Video Downloader for multiple platforms and architectures.

Prerequisites

  • .NET 8.0 SDK or later
  • Make (available on Linux/macOS, install via tools like MSYS2 on Windows)
  • zip (for Windows package creation)
  • tar (for Linux/macOS package creation)

Quick Start

# Show all available build targets
make help

# Build for all platforms
make build-all

# Build for specific platform groups
make build-windows    # Windows x64 + ARM64
make build-linux      # Linux x64 + ARM64
make build-macos      # macOS x64 + ARM64

# Build for specific platforms
make win-x64          # Windows x64
make macos-arm64      # macOS Apple Silicon
make linux-x64        # Linux x64

Supported Platforms

Platform Architecture Runtime ID Output
Windows x64 win-x64 TikTokDownloader.exe
Windows ARM64 win-arm64 TikTokDownloader.exe
Linux x64 linux-x64 TikTokDownloader
Linux ARM64 linux-arm64 TikTokDownloader
macOS x64 (Intel) osx-x64 TikTokDownloader
macOS ARM64 (Apple Silicon) osx-arm64 TikTokDownloader

Build Configuration

All builds use the following optimizations:

  • Release Configuration: Optimized for performance
  • Self-Contained: No .NET runtime required on target machine
  • Single File: Everything bundled into one executable
  • Trimmed: Unused code removed to reduce size
  • Partial Trimming: Safe trimming mode for Avalonia apps

Build Output

Builds are output to the dist/ directory:

dist/
├── win-x64/
│   └── TikTokDownloader.exe
├── win-arm64/
│   └── TikTokDownloader.exe
├── linux-x64/
│   └── TikTokDownloader
├── linux-arm64/
│   └── TikTokDownloader
├── osx-x64/
│   └── TikTokDownloader
├── osx-arm64/
│   └── TikTokDownloader
└── packages/
    ├── TikTokDownloader-win-x64.zip
    ├── TikTokDownloader-win-arm64.zip
    ├── TikTokDownloader-linux-x64.tar.gz
    ├── TikTokDownloader-linux-arm64.tar.gz
    ├── TikTokDownloader-osx-x64.tar.gz
    └── TikTokDownloader-osx-arm64.tar.gz

Makefile Targets

Build Targets

  • build-all - Build for all platforms and architectures
  • build-windows - Build for Windows (x64 and ARM64)
  • build-linux - Build for Linux (x64 and ARM64)
  • build-macos - Build for macOS (x64 and ARM64)
  • win-x64 - Build for Windows x64
  • win-arm64 - Build for Windows ARM64
  • linux-x64 - Build for Linux x64
  • linux-arm64 - Build for Linux ARM64
  • macos-x64 - Build for macOS x64 (Intel)
  • macos-arm64 - Build for macOS ARM64 (Apple Silicon)

Utility Targets

  • clean - Remove all build artifacts
  • restore - Restore NuGet packages
  • test - Run tests (if any exist)
  • package - Create distribution packages (ZIP/TAR.GZ)
  • info - Show build configuration information
  • dev - Development build for current platform
  • run - Build and run application for development
  • size-report - Show build sizes for all platforms
  • check-tools - Verify required tools are installed
  • ci - Complete CI pipeline (build, test, package)

Development Targets

  • dev-workflow - Clean, restore, build, and test for development
  • run - Build and run the application locally

Examples

Building for Distribution

# Clean and build everything
make clean build-all package

# Check build sizes
make size-report

# Output will be in dist/packages/

Development Workflow

# Clean development build and test
make dev-workflow

# Or just run the app
make run

Platform-Specific Builds

# Build only for current macOS ARM64
make macos-arm64

# Build for Windows deployment
make build-windows

# Build for Linux servers
make linux-x64

CI/CD Pipeline

# Complete CI pipeline
make ci

# This runs: check-tools → restore → test → build-all → package → size-report

Troubleshooting

Common Issues

  1. Missing .NET SDK

    make check-tools  # Verify installation
  2. Missing zip/tar tools

    # macOS
    brew install zip
    
    # Ubuntu/Debian
    sudo apt-get install zip
    
    # Windows (use MSYS2 or WSL)
  3. Trimming Warnings

    • These are normal for Avalonia applications
    • The app will still work correctly
    • Warnings are from third-party libraries

Performance Tips

  • Use make -j4 build-all for parallel builds (if your Make supports it)
  • Build specific platforms only if you don't need all targets
  • Use make dev for faster development builds

File Sizes

Typical build sizes:

  • Windows: ~45-50 MB
  • Linux: ~45-50 MB
  • macOS: ~45-50 MB

Sizes include the entire .NET runtime and all dependencies.