forked from SatoshiPortal/bullbitcoin-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
97 lines (78 loc) · 3.1 KB
/
makefile
File metadata and controls
97 lines (78 loc) · 3.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
.PHONY: all setup clean deps build-runner l10n hooks ios-pod-update drift-migrations docker-build docker-run test unit-test integration-test fvm-check
fvm-check:
@echo "🔍 Checking FVM"
@if ! command -v fvm >/dev/null 2>&1; then \
echo "❌ FVM is not installed. Please install FVM first:"; \
exit 1; \
fi
@echo "✅ FVM is installed"
@fvm install
all: setup
@echo "✨ All tasks completed!"
setup: fvm-check clean deps build-runner l10n hooks ios-pod-update
@echo "🚀 Setup complete!"
clean:
@echo "🧹 Clean and remove pubspec.lock and ios/Podfile.lock"
@fvm flutter clean && rm -f pubspec.lock && rm -f ios/Podfile.lock
deps:
@echo "🏃 Fetch dependencies"
@fvm flutter pub get
build-runner:
@echo "🏗️ Build runner for json_serializable and flutter_gen"
@fvm dart run build_runner build --delete-conflicting-outputs
build-runner-watch:
@echo "🏗️ Build runner for json_serializable and flutter_gen (watch mode)"
@fvm dart run build_runner watch --delete-conflicting-outputs
l10n:
@echo "🌐 Generating translations files"
@fvm flutter gen-l10n
hooks:
@CURRENT_HOOKS_PATH=$$(git config --local core.hooksPath); \
if [ "$$CURRENT_HOOKS_PATH" = ".git_hooks/" ]; then \
echo "✅ Git hooks already configured"; \
else \
echo "🔧 Setting up git pre-commit hooks"; \
git config --local core.hooksPath .git_hooks/; \
fi
drift-migrations:
@echo "🔄 Create schema and sum migrations"
fvm dart run drift_dev make-migrations
ios-pod-update:
@echo " Fetching dependencies"
@fvm flutter precache --ios
@cd ios && pod install --repo-update && cd -
ios-sqlite-update:
@echo "🔄 Updating SQLite"
@cd ios && pod update sqlite3 && cd -
feature:
@if [ -z "$(filter-out $@,$(MAKECMDGOALS))" ]; then \
echo "❌ Error: Please provide a feature name. Usage: make feature your_feature_name"; \
exit 1; \
fi
@FEATURE_NAME=$$(echo $(filter-out $@,$(MAKECMDGOALS)) | sed 's/\([A-Z]\)/_\1/g' | sed 's/^_//' | tr '[:upper:]' '[:lower:]'); \
echo "🎯 Creating feature: $$FEATURE_NAME"; \
FEATURE_DIR="lib/features/$$FEATURE_NAME"; \
if [ -d "$$FEATURE_DIR" ]; then \
echo "❌ Error: Feature directory $$FEATURE_DIR already exists"; \
exit 1; \
fi; \
echo "📁 Copying template folder..."; \
cp -r lib/features/template "$$FEATURE_DIR"; \
echo "🗑️ Removing _main.dart..."; \
rm -f "$$FEATURE_DIR/_main.dart"; \
echo "🔄 Replacing template references..."; \
FEATURE_NAME_PASCAL=$$(echo $$FEATURE_NAME | sed 's/_\([a-z]\)/\U\1/g' | sed 's/^\([a-z]\)/\U\1/'); \ find "$$FEATURE_DIR" -type f -name "*.dart" -exec sed -i '' "s/Template/$$FEATURE_NAME_PASCAL/g" {} \; \
2>/dev/null || find "$$FEATURE_DIR" -type f -name "*.dart" -exec sed -i "s/Template/$$FEATURE_NAME_PASCAL/g" {} \;; \
echo "✅ Feature '$$FEATURE_NAME' created successfully in $$FEATURE_DIR"
%:
@:
docker-build:
@echo "🏗️ Building Docker image"
@ docker build -t bull-mobile .
test: unit-test integration-test
unit-test:
@echo "🏃 running unit tests"
@fvm flutter test test/ --reporter=compact
integration-test:
@echo "🧪 integration tests"
@fvm flutter test integration_test/ --reporter=compact