The make-flutter
project utilizes a Makefile to streamline various Flutter development tasks. This Makefile is designed to automate common Flutter development workflows such as fetching dependencies, running build runners, formatting code, running tests with coverage, and more. It simplifies the development process, making it more efficient and error-free.
To use the Makefile in your project, follow these steps:
-
Clone the
make-flutter
Repository: Ensure that themake-flutter
repository is cloned one directory level up from your current project. -
Reference the Makefile: In your project's Makefile, add the following lines to reference the
make-flutter
Makefile:# Define the path to the external Makefile EXTERNAL_MAKEFILE := ../make-flutter/Makefile # Include the external Makefile include $(EXTERNAL_MAKEFILE)
This setup allows you to use the functionalities defined in the
make-flutter
Makefile directly in your project.
The make-flutter
Makefile includes the following targets:
pub_get
: Runs Flutterpub get
to fetch project dependencies.build_runner
: Executesbuild_runner
to generate necessary files.format
: Formats the code in thelib
andtest
directories.test
: Runs tests with coverage and opens the coverage report.pretty
: A combination ofpub_get
,build_runner
, andformat
for a comprehensive cleanup and setup.fix
: Applies suggested fixes to the code.
Each target is designed to be self-contained, allowing for flexible use depending on the developer's needs.
To use any of the targets in the Makefile, run the following command in your terminal:
make [target]
For example, to format your project, you would run:
make format
This will execute the formatting process for both the lib
and test
directories of your Flutter project.
We welcome contributions from the community to enhance and expand the capabilities of the make-flutter
Makefile. If you have suggestions for additional Make commands or improvements to existing ones, here's how you can contribute:
-
Fork the Repository:
- Start by forking the
make-flutter
repository to your own GitHub account.
- Start by forking the
-
Update the Documentation:
- If you've added new commands or significantly changed existing ones, update the
README.md
or other relevant documentation to reflect these changes. Provide clear explanations and usage examples.
- If you've added new commands or significantly changed existing ones, update the
-
Create a Pull Request (PR):
- Submit a pull request to the original
make-flutter
repository. In the PR description, explain your changes and why they are beneficial to the project.
- Submit a pull request to the original
We appreciate your interest in contributing to the make-flutter
project and look forward to seeing your innovative ideas and improvements!