forked from fieldkit/mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
111 lines (90 loc) · 3.74 KB
/
Makefile
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
ANDROID ?= $(HOME)/Android/Sdk/tools/bin
APP ?= ./
default: setup test
setup: .setup-completed $(APP)/app/secrets.ts $(APP)/node_modules
.setup-completed:
$(ANDROID)/sdkmanager --verbose "system-images;android-25;google_apis;x86"
$(ANDROID)/sdkmanager --verbose "system-images;android-26;google_apis;x86"
$(ANDROID)/sdkmanager --verbose "system-images;android-27;google_apis;x86"
$(ANDROID)/sdkmanager --verbose "system-images;android-28;google_apis;x86"
$(ANDROID)/sdkmanager --verbose "platforms;android-28"
$(ANDROID)/sdkmanager --verbose "emulator"
echo | $(ANDROID)/avdmanager create avd --force -n test -k "system-images;android-26;google_apis;x86"
touch .setup-completed
update:
$(ANDROID)/sdkmanager --update --verbose
emulator:
sudo $(ANDROID)/../emulator -avd test
$(APP)/app/secrets.ts: $(APP)/app/secrets.ts.template
cp $^ $@
prettier:
prettier --write "$(APP)/app/**/*.{ts,js,css,json,vue}"
$(APP)/node_modules:
rm -rf $(APP)/node_modules/*/.git $(APP)/node_modules/fk-*-protocol
cd $(APP) && npm install
git config core.hooksPath .githooks
jenkins: setup
rm -rf $(APP)/node_modules
cd $(APP) && npm install
cd $(APP) && npm test
android-release: setup
rm -rf $(APP)/node_modules/*/.git
rm -rf $(APP)/node_modules/nativescript-conservify
rm -rf $(APP)/node_modules/fk-*-protocol
jq '.nativescript.id = "com.fieldkit"' $(APP)/package.json > $(APP)/package.json.temp
mv $(APP)/package.json.temp $(APP)/package.json
npm install
cd $(APP) && tns build android --release --env.sourceMap --key-store-path $(FK_APP_RELEASE_STORE_FILE) --key-store-password $(FK_APP_RELEASE_STORE_PASSWORD) --key-store-alias $(FK_APP_RELEASE_KEY_ALIAS) --key-store-alias-password $(FK_APP_RELEASE_KEY_PASSWORD)
cd $(APP) && tns build android --release --env.sourceMap --key-store-path $(FK_APP_RELEASE_STORE_FILE) --key-store-password $(FK_APP_RELEASE_STORE_PASSWORD) --key-store-alias $(FK_APP_RELEASE_KEY_ALIAS) --key-store-alias-password $(FK_APP_RELEASE_KEY_PASSWORD) --aab
clean-secrets:
rm -rf $(APP)/app/secrets.ts
ios-release: setup
security list-keychains
security lock-keychain login.keychain
security unlock-keychain -p $(APP_IOS_KEYCHAIN_PASSWORD) login.keychain
security show-keychain-info login.keychain
rm -rf $(APP)/node_modules/*/.git
rm -rf $(APP)/node_modules/nativescript-conservify
rm -rf $(APP)/node_modules/fk-*-protocol
npm install
if [ -d $(APP)/platforms/ios ]; then \
cd $(APP) && tns platform clean ios || true ;\
else \
cd $(APP) && tns platform add ios || true ;\
fi
cd $(APP) && tns build ios --provision || true
cd $(APP) && tns build ios --team-id || true
cd $(APP) && tns build ios --provision "Conservify Ad Hoc (2020/01)" --for-device --env.sourceMap
cd $(APP) && tns build ios --provision "Conservify Ad Hoc (2020/01)" --for-device --release --env.sourceMap
android-logs:
adb logcat | grep -i " JS" | grep -v NSVue
android-logs-verbose:
adb logcat | grep -i " JS"
android-debug: setup
cd $(APP) && tns debug android --bundle --no-hmr | grep -v NSVue
ios-debug: setup
cd $(APP) && tns debug ios --bundle --no-hmr | grep -v NSVue
clean:
rm -rf $(APP)/node_modules
rm -rf $(APP)/platforms
images:
for a in $(APP)/app/images/Icon*.svg; do \
SOURCE=../$$a; \
DIR=`dirname $$a`; \
PNG=`basename $$a .svg`.png; \
OUTPUT=../$$DIR/$$PNG; \
(cd $(APP) && node_modules/.bin/svgexport $$SOURCE $$OUTPUT 16x); \
done; \
for a in $(APP)/app/images/*logo*.svg; do \
SOURCE=../$$a; \
DIR=`dirname $$a`; \
PNG=`basename $$a .svg`.png; \
OUTPUT=../$$DIR/$$PNG; \
(cd $(APP) && node_modules/.bin/svgexport $$SOURCE $$OUTPUT 2x); \
done; \
test: setup
jest --silent
watch: setup
jest --silent --watch
update-third-party:
third-party/update.sh