Automating Flutter Workflows with the Makefile

Gonçalo Palma
Flutter Community
Published in
6 min readSep 28, 2021

--

Photo by K. Mitch Hodge on Unsplash

While developing our Flutter projects, there are many repeatable tasks — formatting, running unit tests before we create a PR, cleaning the project, and running or even building the app for different flavors.

And although our IDEs can make it easy to perform some of these actions, we may have fallen in love with the Command Line, which you can learn more from in my previous article Flutter and the Command Line — a Love Story, which means that we either created our scripts or we have to type each command by hand each time.

Is there a better way to automate this?

There is! With a Makefile!

The Makefile allows us to create a set of different commands in one file to automate our workflows. With it, we can do three things at once:

  1. Have one place where we define all the actions we want for our project while at the same time creating relations between them;
  2. Make it easier to perform those actions with short commands;
  3. Use this tool in any Flutter project we have

But let’s start at the beginning.

What is a Makefile?

On the GNU manual for make it states that the purpose of a Makefile is:

The make utility…

--

--

Gonçalo Palma
Flutter Community

Author, Flutter Lead Developer @Pvotal Tech. Organizer, Google Developer Expert for Flutter and Dart, Lead Flutter Developer. 🌍 https://gpalma.pt/