Fastforge Documentation

repository·main·Indexed 22 days ago

https://github.com/fastforgedev/fastforge

An app distribution tool for building, packaging, and publishing applications, primarily Flutter, to various platforms and app stores using a single configuration file. It includes a CLI (fastforge_cli v0.7.0) with subcommands for analyzing packages, building artifacts, managing YAML-based local workflows, and publishing to distribution targets. The system is built on Rust core abstractions (AppAnalyzer, AppBuilder, AppPackager, AppPublisher) and supports targets including Android (APK, AAB), iOS (IPA), macOS (DMG, PKG, ZIP), Windows, Linux, Web, and OpenHarmony.

Tokens
97K
Snippets
334
Records
474
Agent score
77%

What's inside Fastforge

  1. Overview of app_builder

    main

    app_builder is the Rust implementation of the Fastforge Flutter build orchestration layer. It ensures that build parameters and output structures are consistent with the Dart implementation of Fastforge.

    Key capabilities include:

    • Encoding build parameters following Dart-compatible rules.
    • Generating build result JSON structures compatible with Dart.
    • Multi-platform builder registration and routing.
    • Automatic injection of FLUTTER_BUILD_NAME and FLUTTER_BUILD_NUMBER from pubspec.yaml.
    • Support for the FLUTTER_ROOT environment variable.
  2. Overview of Fastforge CLI capabilities

    main

    Fastforge is a CLI tool designed for app building, packaging, and publishing. Its current capabilities include:

    • App package analysis: Fully implemented for APK, AAB, IPA, DMG, and .app files.
    • Publishing: Multiple targets are implemented for artifact distribution.
    • Store Management: Full implementation for App Store Connect, Google Play Console, and multi-store catalog synchronization.
    • Local Workflows: Fully implemented via .fastforge/workflows.
    • Packaging & Builders: Android, iOS, and macOS packaging, as well as various builders (Gradle, Xcode, Flutter), are currently partially implemented.

    Note: Features like fastforge upgrade and online version checks are currently not implemented.

  3. Use Fastforge store entry points

    main

    Fastforge provides three primary entry points for store management:

    • fastforge appstore: Interacts with the App Store Connect API to manage builds and reviews.
    • fastforge googleplay: Manages Google Play edits, AABs, and tracks.
    • fastforge store: A unified command to process multiple configured store apps defined in your project configuration.
  4. Supported platforms and package formats

    main

    Fastforge currently supports the following platforms and output formats via the package command:

    PlatformFormatsIntegration
    AndroidAPK, AABGradle
    iOSIPAXcode (package action)
    macOSDMG, PKG, ZIPXcode (package action), Flutter Builder

    Important Platform Constraints:

    • Flutter Projects: The fastforge package command currently supports only the three macOS formats (DMG, PKG, ZIP).
    • Native Projects: The Android (APK, AAB) and iOS (IPA) packaging paths are only available for native projects that do not contain a pubspec.yaml file.
  5. What is the Unified Catalog?

    main
    The Unified Catalog is a system for managing app-store metadata and images locally. It synchronizes remote store data into a local directory structure, allowing for version control, bulk editing of metadata, and repeatable publishing workflows. This local storage acts as a source of truth that can be committed to a repository.
  6. Use environment variables in configuration

    main

    You can use environment variables within your distribute_options.yaml file to handle sensitive information like API keys. Use the ${VARIABLE_NAME} syntax to reference an environment variable.

    variables:
      API_KEY: ${PGYER_API_KEY} # Uses the PGYER_API_KEY environment variable
  7. Use preinstall and postinstall scripts in PKG packages

    main

    You can include custom logic that runs during the package installation process by providing a directory of executable scripts.

    Directory Structure

    If you provide a path to the scripts option in make_config.yaml, the directory should follow this structure:

    macos/packaging/pkg/
    ├── make_config.yaml
    └── scripts/
        ├── preinstall     # Runs before file installation
        └── postinstall    # Runs after file installation

    Requirements

    • Naming: Scripts must be named exactly preinstall or postinstall.
    • Permissions: Scripts must be executable (chmod +x).
    • Privileges: Scripts run as root during installation.
  8. Understand the .deb installation structure

    main

    When a .deb package is installed, Fastforge follows the Filesystem Hierarchy Standard (FHS) for third-party software. The application files are placed as follows:

    PathDescription
    /opt/{package_name}/Application binaries and runtime files
    /usr/bin/{package_name}Symlink to the main binary (added to $PATH)
    /usr/share/applications/{package_name}.desktopDesktop entry for the application menu
    /usr/share/icons/hicolor/128x128/apps/{package_name}.pngApplication icon
    /usr/share/icons/hicolor/256x256/apps/{package_name}.pngApplication icon (high resolution)
    /usr/share/metainfo/{package_name}.metainfo.xmlAppStream metadata (if configured)
  9. What are Builders in Fastforge

    main

    Builders are responsible for selecting a project's build tool, executing the build command, and locating the resulting artifacts.

    It is important to distinguish between Builders and Packagers:

    • Builders generate the raw build artifacts (e.g., an APK or an IPA).
    • Packagers consume those artifacts to create distributable formats (e.g., a .dmg or a .zip).

    Note that a builder being 'implemented' is different from it being 'connected to the CLI'. If a builder lacks top-level CLI integration, you cannot select it directly via fastforge build and should instead use the project's native build commands.

  10. Use the `custom` target to publish application artifacts

    main

    The custom target allows you to execute an arbitrary script or command to publish your application artifact. This is the recommended approach when you need to integrate with a publishing platform that is not natively supported by fastforge.

    When the command is executed, fastforge provides the path to the artifact via the ARTIFACT_PATH environment variable. You can also pass additional arguments which will be available as environment variables prefixed with PUBLISH_ARG_ (converted to uppercase with dashes replaced by underscores).

    #!/bin/sh
    set -e
    echo "Publishing artifact: $ARTIFACT_PATH"
    # Add your custom publish logic here
  11. Understand the Custom Builder model

    main

    A Custom Builder is a mechanism that runs an arbitrary command and collects resulting files using glob patterns.

    Important Note: As of the current version, the Custom Builder is not yet integrated into the top-level fastforge build or fastforge package commands. It is currently intended to be used as a manual step within a workflow rather than via a CLI flag like --platform custom (which does not exist).