69 lines
2.4 KiB
Makefile
69 lines
2.4 KiB
Makefile
# --- Mobile App Development ---
|
|
|
|
.PHONY: mobile-client-install mobile-client-dev mobile-client-build mobile-staff-install mobile-staff-dev mobile-staff-build
|
|
|
|
FLAVOR :=
|
|
ifeq ($(ENV),dev)
|
|
FLAVOR := dev
|
|
else ifeq ($(ENV),staging)
|
|
FLAVOR := staging
|
|
else ifeq ($(ENV),prod)
|
|
FLAVOR := production
|
|
endif
|
|
|
|
BUILD_TYPE ?= appbundle
|
|
|
|
# --- Client App ---
|
|
mobile-client-install:
|
|
@echo "--> Installing Flutter dependencies for client app..."
|
|
@cd apps/mobile-client && $(FLUTTER) pub get
|
|
|
|
mobile-client-dev:
|
|
@echo "--> Running client app in dev mode..."
|
|
@echo "--> If using VS code, use the debug configurations"
|
|
@cd apps/mobile-client && $(FLUTTER) run --flavor dev -t lib/main_dev.dart
|
|
|
|
mobile-client-build:
|
|
@if [ "$(ENV)" != "dev" ] && [ "$(ENV)" != "staging" ] && [ "$(ENV)" != "prod" ]; then \
|
|
echo "ERROR: ENV must be one of dev, staging, or prod."; exit 1; \
|
|
fi
|
|
@if [ "$(PLATFORM)" != "android" ] && [ "$(PLATFORM)" != "ios" ]; then \
|
|
echo "ERROR: PLATFORM must be either android or ios."; exit 1; \
|
|
fi
|
|
@echo "--> Building client app for $(PLATFORM) with flavor $(FLAVOR)..."
|
|
@cd apps/mobile-client && \
|
|
$(FLUTTER) pub get && \
|
|
$(FLUTTER) pub run build_runner build --delete-conflicting-outputs && \
|
|
if [ "$(PLATFORM)" = "android" ]; then \
|
|
$(FLUTTER) build $(BUILD_TYPE) --flavor $(FLAVOR); \
|
|
elif [ "$(PLATFORM)" = "ios" ]; then \
|
|
$(FLUTTER) build ipa --flavor $(FLAVOR); \
|
|
fi
|
|
|
|
# --- Staff App ---
|
|
mobile-staff-install:
|
|
@echo "--> Installing Flutter dependencies for staff app..."
|
|
@cd apps/mobile-staff && $(FLUTTER) pub get
|
|
|
|
mobile-staff-dev:
|
|
@echo "--> Running staff app in dev mode..."
|
|
@echo "--> If using VS code, use the debug configurations"
|
|
@cd apps/mobile-staff && $(FLUTTER) run --flavor dev -t lib/main_dev.dart
|
|
|
|
mobile-staff-build:
|
|
@if [ "$(ENV)" != "dev" ] && [ "$(ENV)" != "staging" ] && [ "$(ENV)" != "prod" ]; then \
|
|
echo "ERROR: ENV must be one of dev, staging, or prod."; exit 1; \
|
|
fi
|
|
@if [ "$(PLATFORM)" != "android" ] && [ "$(PLATFORM)" != "ios" ]; then \
|
|
echo "ERROR: PLATFORM must be either android or ios."; exit 1; \
|
|
fi
|
|
@echo "--> Building staff app for $(PLATFORM) with flavor $(FLAVOR)..."
|
|
@cd apps/mobile-staff && \
|
|
$(FLUTTER) pub get && \
|
|
$(FLUTTER) pub run build_runner build --delete-conflicting-outputs && \
|
|
if [ "$(PLATFORM)" = "android" ]; then \
|
|
$(FLUTTER) build $(BUILD_TYPE) --flavor $(FLAVOR); \
|
|
elif [ "$(PLATFORM)" = "ios" ]; then \
|
|
$(FLUTTER) build ipa --flavor $(FLAVOR); \
|
|
fi
|