feat(Makefile): restructure Makefile into modular files for better organization and maintainability
feat(Makefile): introduce common.mk for shared variables and environment configuration feat(Makefile): create web.mk for web frontend-related tasks feat(Makefile): create launchpad.mk for internal launchpad deployment tasks feat(Makefile): create mobile.mk for mobile app development tasks feat(Makefile): create dataconnect.mk for Data Connect management tasks feat(Makefile): create tools.mk for development tools like git hooks feat(Makefile): remove admin-web specific tasks and files as the admin console is no longer actively maintained feat(Makefile): update help command to reflect the new modular structure and available commands feat(Makefile): remove base44 export workflow as it is no longer relevant feat(Makefile): remove IAP configuration as it is no longer used feat(Makefile): remove harness-related tasks as they are no longer relevant The Makefile has been significantly refactored to improve organization and maintainability. The changes include: - Modularization: The monolithic Makefile has been split into smaller, more manageable files, each responsible for a specific area of the project (web, launchpad, mobile, dataconnect, tools). - Common Configuration: Shared variables and environment configuration are now centralized in common.mk. - Removal of Unused Tasks: Tasks related to the admin console, base44 export workflow, IAP configuration, and API test harness have been removed as they are no longer relevant. - Updated Help Command: The help command has been updated to reflect the new modular structure and available commands. - Improved Readability: The modular structure makes the Makefile easier to read and understand. - Maintainability: The modular structure makes it easier to maintain and update the Makefile. - Scalability: The modular structure makes it easier to add new tasks and features to the Makefile.
This commit is contained in:
68
makefiles/mobile.mk
Normal file
68
makefiles/mobile.mk
Normal file
@@ -0,0 +1,68 @@
|
||||
# --- 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 mobile-apps/client-app && $(FLUTTER) pub get
|
||||
|
||||
mobile-client-dev:
|
||||
@echo "--> Running client app in dev mode..."
|
||||
@echo "--> If using VS code, use the debug configurations"
|
||||
@cd mobile-apps/client-app && $(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 mobile-apps/client-app && \
|
||||
$(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 mobile-apps/staff-app && $(FLUTTER) pub get
|
||||
|
||||
mobile-staff-dev:
|
||||
@echo "--> Running staff app in dev mode..."
|
||||
@echo "--> If using VS code, use the debug configurations"
|
||||
@cd mobile-apps/staff-app && $(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 mobile-apps/staff-app && \
|
||||
$(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
|
||||
Reference in New Issue
Block a user