flutter_post_build 1.3.0
flutter_post_build: ^1.3.0 copied to clipboard
A command-line tool to rename and organize Flutter build artifacts after the build process is complete.
// example/example.dart
import 'package:flutter_post_build/flutter_post_build.dart';
/// Example entry point for the `flutter_post_build` global CLI tool.
///
/// Add the following configuration to your `pubspec.yaml` before running:
///
/// ```yaml
/// name: my_app
/// version: 1.3.0+5
///
/// flutter_post_builder:
/// package_name: my_app # Base name for renamed artifacts
/// append_version: true # Appends version string to filenames
/// final_directory: releases/ # Output directory (created if missing)
/// move_files: true # Move instead of copy
/// clean_build_folder: false # Set true to delete build/ when done
/// discard:
/// x86: true # Skip x86_64 APK variant
/// ```
///
/// ## APK workflow
///
/// ```sh
/// dart pub global activate flutter_post_build
/// flutter build apk --split-per-abi
/// flutter_post_build
/// ```
///
/// Expected output:
///
/// ```
/// Scanning APKs...
/// - Moving "app-arm64-v8a-release.apk → my_app_1.3.0_a64.apk"
/// - Moving "app-armeabi-v7a-release.apk → my_app_1.3.0_v7a.apk"
/// - Skipping "app-x86_64-release.apk" (discard rule)
/// Scanning AAB...
/// - No AAB to process.
///
/// ✅ Done! 2 file(s) processed.
/// ```
///
/// ## AAB-only workflow
///
/// ```sh
/// flutter build appbundle
/// flutter_post_build
/// ```
///
/// Expected output:
///
/// ```
/// Scanning APKs...
/// - No APKs to process.
/// Scanning AAB...
/// - Moving "app-release.aab → my_app_1.3.0_bun.aab"
///
/// ✅ Done! 1 file(s) processed.
/// ```
void main() => runPostBuild();