flutter_makefile 1.0.2 copy "flutter_makefile: ^1.0.2" to clipboard
flutter_makefile: ^1.0.2 copied to clipboard

A CLI tool for Flutter projects that provides Makefile-style commands for common development tasks like building, testing, and running Flutter applications.

flutter_makefile #

version coverage style: very good analysis License: MIT

A CLI tool to generate Makefile and package.json for Flutter projects with support for builds, testing, asset generation, and automated releases.


Requirements #

  • Dart SDK
  • make (the CLI will check and provide installation instructions if not found)

Getting Started πŸš€ #

If the CLI application is available on pub, activate globally via:

dart pub global activate flutter_makefile

Or locally via:

dart pub global activate --source=path <path to this package>

Usage #

# Initialize a new Makefile and package.json in your Flutter project
$ flutter_makefile init

# Initialize with custom app name
$ flutter_makefile init --app-name my_awesome_app

# Initialize with custom output directory
$ flutter_makefile init --output /path/to/project

# Force overwrite existing files
$ flutter_makefile init --force

# Show CLI version
$ flutter_makefile --version

# Show usage help
$ flutter_makefile --help

Init Command #

The init command generates a comprehensive Makefile and package.json for your Flutter project. It also checks if make is installed on your system and provides installation instructions if needed.

Generated Makefile includes:

  • βœ… Configurable build flavors and targets
  • βœ… Support for Android (APK/AAB) and iOS (IPA) builds
  • βœ… Firebase App Distribution integration
  • βœ… TestFlight distribution support
  • βœ… Package publishing to pub.flutter-io.cn
  • βœ… Asset generation (icons, splash screens)
  • βœ… Testing and code generation utilities
  • βœ… Compatible with or without FVM

Generated package.json includes:

  • βœ… Semantic-release configuration
  • βœ… Conventional commit support
  • βœ… Automated version management
  • βœ… Changelog generation
  • βœ… GitHub release automation

Options:

  • --output, -o - Specify output directory (default: current directory)
  • --app-name, -n - App name for package.json (default: "app")
  • --force, -f - Overwrite existing files

Example:

cd my_flutter_project
flutter_makefile init --app-name my_awesome_app
make npm-install
make run

Running Tests with coverage πŸ§ͺ #

To run all unit tests use the following command:

$ dart pub global activate coverage 1.15.0
$ dart test --coverage=coverage
$ dart pub global run coverage:format_coverage --lcov --in=coverage --out=coverage/lcov.info

To view the generated coverage report you can use lcov .

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Available Makefile Commands πŸ“‹ #

Setup & Dependencies #

  • make clean - Clean build artifacts
  • make get - Get Flutter dependencies
  • make pod-install - Install iOS pods
  • make upgrade - Upgrade Flutter dependencies

Running #

  • make run - Run app (optionally with FLAVOR and TARGET)

Code Generation #

  • make build-runner - Run build_runner to generate code
  • make build-runner-watch - Watch mode for build_runner
  • make gen-assets - Generate assets using FlutterGen

Testing #

  • make test - Run all tests
  • make test-coverage - Generate test coverage report

Asset Generation #

  • make icon-launcher - Generate launcher icons
  • make splash-screen - Generate splash screen

Localization #

  • make intl-utils - Generate localization files
  • make purge-unused-l10n - Remove unused localization keys

Release Management #

  • make npm-install - Install npm dependencies
  • make release - Create a new release
  • make release-dry - Dry run of release

Builds #

  • make build-aab - Build Android App Bundle
  • make build-apk - Build Android APK
  • make build-ipa - Build iOS IPA

Distribution #

  • make upload-apk-to-appdistrib - Upload APK to Firebase App Distribution
  • make upload-aab-to-appdistrib - Upload AAB to Firebase App Distribution
  • make upload-aab-to-playstore - Upload AAB to Play Store
  • make upload-ipa-to-appdistrib - Upload IPA to Firebase App Distribution
  • make upload-ipa-to-testflight - Upload IPA to TestFlight

Package Publishing #

  • make deploy-dry-run - Validate package before publishing
  • make deploy - Publish package to pub.flutter-io.cn

0
likes
140
points
124
downloads

Publisher

unverified uploader

Weekly Downloads

A CLI tool for Flutter projects that provides Makefile-style commands for common development tasks like building, testing, and running Flutter applications.

Repository (GitHub)
View/report issues

Topics

#cli #flutter #makefile #development-tools

Documentation

API reference

License

MIT (license)

Dependencies

args, cli_completion, mason_logger, path, pub_updater

More

Packages that depend on flutter_makefile