This Makefile provides flexible build and run automation for the WebTrit Phone Flutter project, supporting configuration management, flavors, and parameterization.
phone_project_path ?= .Defines the root path of the Flutter project. Defaults to the current directory.
BUILD_CONFIG_FILE := $(phone_project_path)/build.configReads the VERSION value from build.config. Based on the version, the VERSION_STAGE is determined, which controls
flavor logic.
Possible stages:
legacy— version is missing or outdated.v0.0.1— supports deeplink flavor only.v0.0.2+— supports deeplink and SMS receiver flavors.
DART_DEFINE_PATH ?= $(phone_project_path)/dart_define.jsonPath to the Dart define file passed as --dart-define-from-file.
compute-deeplink-flavorSets deeplinks or deeplinksDisabled based on the presence of WEBTRIT_APP_LINK_DOMAIN.
compute-sms-flavorSets smsReceiver or smsReceiverDisabled based on WEBTRIT_CALL_TRIGGER_MECHANISM_SMS.
compute-flavor-argGenerates the appropriate --flavor argument based on version stage:
legacy: no flavor used.v0.0.1: deeplink flavor only.v0.0.2+: deeplink + SMS flavor concatenation.
COMMON_FLAGS := --dart-define-from-file=...
COMMON_BUILD_FLAGS := $(COMMON_FLAGS) --no-tree-shake-icons--build-name--build-number--release--no-codesign--config-only
FLUTTER_BUILD_COMMANDExecutes flutter build with all necessary flags and conditions.
FLUTTER_RUN_COMMANDExecutes flutter run with appropriate arguments. --no-tree-shake-icons is not used here.
make build-apk— builds Android APK.make build-appbundle— builds Android App Bundle.make build-ios— builds iOS app.make build— builds using the defaultBUILD_PLATFORM.make build-ios-config-only— generates iOS Xcode project only (no actual build).
make run— runs usingBUILD_PLATFORM.make run-apk— runs Android APK on device.make run-ios— runs iOS app on simulator/device.
- Requires
jqfor JSON parsing. dart_define.jsonmust be present and valid.- On iOS,
--flavoris ignored forrunandconfig-onlymodes.
make build-apk build_name=1.2.3 build_number=123 release=true
make run-apk
make build-ios-config-only no_codesign=true