🔧 Automating Flutter Workflows with Derry: A Powerful Script Manager

Managing a growing Flutter project often involves juggling build commands, cleaning environments, running setup scripts, and deploying builds. What if you could wrap all those tedious terminal commands into a single, easy-to-remember tool? That’s exactly what Derry does — and here's how I’ve integrated it into my Flutter workflow.


🚀 What is Derry?

Derry is a script manager for Dart and Flutter projects. It lets you define and execute custom CLI scripts via simple aliases, making it easy to standardize and simplify your development and CI/CD processes.

Rather than typing out long commands every time, you can define them once in a YAML file and run them with ease.


🛠️ Getting Started

📦 1. Add Derry to Your Project

flutter pub get
dart pub global activate derry

Make sure the Dart SDK's global binaries are in your system path so you can run derry from the terminal.

📁 2. Create a derry.yaml File

Here’s a breakdown of my derry.yaml file and how it simplifies my Flutter workflow:

setup: chmod +x scripts/init_setup.sh && ./scripts/init_setup.sh
clean: flutter clean && flutter pub get

launch:
  d: flutter run --flavor dev
  p: flutter run --flavor production
  u: flutter run --flavor uat

analyze: flutter analyze
outdated: flutter pub outdated

fix:
  a: dart fix --apply
  d: dart fix --dry-run

ci:
  lint: flutter analyze && dart format --set-exit-if-changed lib test
  test: flutter test --coverage

version:
  patch: flutter pub run build_runner build --delete-conflicting-outputs && flutter pub run version_updater --patch
  minor: flutter pub run build_runner build --delete-conflicting-outputs && flutter pub run version_updater --minor
  major: flutter pub run build_runner build --delete-conflicting-outputs && flutter pub run version_updater --major

⚙️ Building and Uploading APKs with One Command

The real power of Derry shows when automating build + upload flows. Here’s a snippet from my build: script section:

build:
  apk:
    d:
      (scripts): >
        flutter build apk --flavor dev --release --no-tree-shake-icons &&
        python3 scripts/upload_to_drive.py "build/app/outputs/apk/dev/release/"

This script:

  1. Builds the APK for the specified flavor (e.g., dev, production, uat)
  2. Automatically uploads it to Google Drive

Now I just run:

derry build apk d

And my dev APK is uploaded in one shot. 🚀


🔄 One-Click Project Initialization

I’ve also added a custom shell script for project setup:

init_setup.sh

#!/bin/bash
flutter clean
flutter pub get
pip3 install google-api-python-client google-auth-httplib2 google-auth-oauthlib
echo "Setup completed!"

This can be run with:

derry setup

Perfect for onboarding new developers or setting up CI runners.


☁️ Seamless Google Drive Integration

The upload_to_drive.py script lets me push APKs directly to a predefined Google Drive folder. It uses Google OAuth2 for authentication and supports:

  • Recursive APK search
  • File size progress reporting
  • Interactive upload selection

This is incredibly helpful for sharing builds with QA or stakeholders.


🧪 Useful Commands at a Glance

Command Description
derry cleanClean Flutter and fetch dependencies
derry launch dRun dev flavor
derry build apk uBuild and upload UAT APK
derry analyzeAnalyze project code
derry outdatedCheck outdated packages
derry ci testRun tests with coverage
derry fix aApply Dart fixes

✅ Why Use Derry?

  • 🧠 Simplifies remembering complex commands
  • 📦 Keeps build logic organized
  • 🧪 Ideal for CI/CD scripting
  • 👨‍💻 Easy onboarding for new devs
  • ☁️ Integrates with cloud tools like Google Drive

📌 Final Thoughts

Derry has been a game-changer in my Flutter development workflow. It transforms messy terminal commands into a structured, documented, and shareable script layer. Whether you're working solo or with a team, using Derry will bring clarity and automation to your day-to-day development.

If you're tired of retyping build or test commands — give Derry a try.

Post a Comment

Previous Post Next Post

Subscribe Us


Get tutorials, Flutter news and other exclusive content delivered to your inbox. Join 1000+ growth-oriented Flutter developers subscribed to the newsletter

100% value, 0% spam. Unsubscribe anytime