forked from nachaphon-phontree/TrustTunnelFlutterClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (75 loc) · 3.01 KB
/
Makefile
File metadata and controls
84 lines (75 loc) · 3.01 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
.PHONY: gen init release-android ln ci-set-version-suffix aux-setup-android-signing
gen:
@echo "* Starting code generation... *"
@dart run build_runner build --delete-conflicting-outputs
@$(MAKE) -C plugins/vpn_plugin gen
@echo "* Code generation successful *"
ln:
@echo "* Generating localizations *"
@dart run intl_utils:generate
init:
@echo "* Running flutter clean *"
@flutter clean
@echo "* Getting latest dependencies *"
@flutter pub get
@echo "* Running build runner *"
@dart run build_runner build --delete-conflicting-outputs
@dart pub run intl_utils:generate
@$(MAKE) -C plugins/vpn_plugin init
.dart_tool/package_config.json: pubspec.yaml pubspec.lock
@echo "* Resolving dependencies... *"
@flutter pub get 2>&1 | \
grep -v 'untranslated message' | \
grep -v 'To see a detailed report' | \
grep -v 'untranslated-messages-file' | \
grep -v 'This will generate' | cat
@echo "* Dependencies resolved. *"
lib/common/localization/generated/l10n.dart: .dart_tool/package_config.json lib/common/localization/arb/*.arb
@echo "* Generating localization... *"
@dart run intl_utils:generate 2>&1 | \
grep -v 'untranslated message' | \
grep -v 'untranslated-messages-file' | \
grep -v 'This will generate' | cat
@flutter gen-l10n 2>&1 | \
grep -v 'untranslated message' | \
grep -v 'untranslated-messages-file' | \
grep -v 'This will generate' | cat
@echo "* Localization generated. *"
.dart_tool/build/entrypoint/build.dart: lib/common/localization/generated/l10n.dart
@echo "* Starting code generation... *"
@dart run build_runner build --delete-conflicting-outputs
@$(MAKE) -C plugins/vpn_plugin gen
@echo "* Code generation successful *"
# ----------------------------
# Android signing helpers
# ----------------------------
aux-setup-android-signing:
@echo "Enter password for Android keystore (will be used for keystore AND written to android/local.properties):"
@read -s PASSWORD; echo ""; \
echo "* Generating android/trusttunnel.keystore (alias: trusttunnel) *"; \
mkdir -p android; \
rm -f android/trusttunnel.keystore; \
keytool -genkeypair -v \
-keystore android/trusttunnel.keystore \
-alias trusttunnel \
-keyalg RSA \
-keysize 2048 \
-validity 10500 \
-sigalg SHA256withRSA \
-storepass $$PASSWORD \
-keypass $$PASSWORD; \
echo "* Updating android/local.properties (preserve other keys; replace signingConfigKey* only) *"; \
touch android/local.properties; \
grep -vE '^[[:space:]]*signingConfigKey(Alias|Password|StorePath|StorePassword)[[:space:]]*=' android/local.properties > android/local.properties.tmp || true; \
mv android/local.properties.tmp android/local.properties; \
printf "%s\n" \
"signingConfigKeyAlias=trusttunnel" \
"signingConfigKeyPassword=$$PASSWORD" \
"signingConfigKeyStorePath=./trusttunnel.keystore" \
"signingConfigKeyStorePassword=$$PASSWORD" \
>> android/local.properties; \
echo "* Android signing setup done. *"
release-android:
@echo "* Building Android release (AAB) *"
@flutter build appbundle --release
@echo "* Android release build done *"