-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
176 lines (142 loc) · 6.68 KB
/
Makefile
File metadata and controls
176 lines (142 loc) · 6.68 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
ANDROID ?= $(HOME)/android-sdk/tools/bin
PROJECT_DIR ?= $(shell pwd)
BUILD_TYPE ?= beta
APP ?= .
NSSQLITE = nativescript-sqlite-commercial-1.3.2.tgz
default: setup test
setup: .setup-completed $(APP)/app/secrets.ts $(APP)/node_modules
mkdir -p backup
.setup-completed:
$(ANDROID)/sdkmanager --verbose "system-images;android-28;google_apis;x86_64"
$(ANDROID)/sdkmanager --verbose "system-images;android-29;google_apis;x86_64"
$(ANDROID)/sdkmanager --verbose "system-images;android-30;google_apis;x86_64"
$(ANDROID)/sdkmanager --verbose "platforms;android-29"
$(ANDROID)/sdkmanager --verbose "emulator"
echo | $(ANDROID)/avdmanager create avd --force -n test -k "system-images;android-29;google_apis;x86_64" --abi google_apis/x86_64
touch .setup-completed
pip3 install requests
refresh-cms-data:
cd tools && npm install && npm run refresh-all
refresh-cms-json:
cd tools && npm install && npm run refresh-json
update:
$(ANDROID)/sdkmanager --update --verbose
emulator:
sudo $(ANDROID)/../emulator -avd test
$(APP)/app/secrets.ts: $(APP)/app/secrets.ts.$(BUILD_TYPE)
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
clean-secrets:
rm -rf $(APP)/app/secrets.ts
platform-libraries:
if [ -f $(NSSQLITE) ]; then \
ns plugin add $(NSSQLITE); \
mkdir -p backup; \
mv $(NSSQLITE) backup/$(NSSQLITE); \
fi
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
$(MAKE) refresh-cms-data || true
$(MAKE) platform-libraries
cd $(APP) && ns build android --release --env.verbose --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) && ns build android --release --env.verbose --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
ios-release: setup
cat ~/.ssh/known_hosts || true
ssh-keyscan github.com
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
rm -rf $(APP)/platforms
npm install
$(MAKE) refresh-cms-data || true
if [ -d $(APP)/platforms/ios ]; then \
cd $(APP) && ns platform clean ios || true ;\
else \
cd $(APP) && ns platform add ios || true ;\
fi
$(MAKE) platform-libraries
xcode-select -p
xcodebuild -version
xcrun simctl list || true
arch -arm64 pod repo update
cd $(APP) && ns build ios --provision || true
cd $(APP) && ns build ios --team-id || true
cd $(APP) && ns build ios --provision "FK AdHoc 2023" --for-device --env.sourceMap --log trace
cd $(APP) && ns build ios --provision "FK AdHoc 2023" --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) && ns platform add android || true
$(MAKE) platform-libraries
cd $(APP) && ns debug android --no-hmr
ios-debug: setup
cd $(APP) && ns platform add ios || true
$(MAKE) platform-libraries
cd $(APP) && ns debug ios --no-hmr
clean:
rm -rf $(APP)/node_modules
rm -rf $(APP)/platforms
rm -rf $(APP)/hooks/before-*
@echo Leaving $(APP)/hooks because of firebase-hack.
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
node_modules/.bin/jest --silent
$(MAKE) checks
watch: setup
node_modules/.bin/jest --silent --watch
update-third-party:
third-party/update.sh
ios-devices:
xcrun xctrace list devices
idevice_id --list
ios-logs:
idevicesyslog --udid `idevice_id --list` -p "mobile(NativeScript)"
cycle-checks:
node_modules/.bin/madge --circular --extensions ts ./app
webpack: setup android-webpack ios-webpack
checks: setup
node_modules/.bin/eslint --ext=ts --fix app
node_modules/.bin/eslint --ext=vue --fix app
$(MAKE) cycle-checks
android-webpack:
node --max_old_space_size=4096 --preserve-symlinks node_modules/@nativescript/webpack/dist/bin/index.js build --config=webpack.config.js --env.externals=~/package.json --env.externals=package.json --env.appPath=app --env.appResourcesPath=App_Resources --env.nativescriptLibPath=$(PROJECT_DIR)/node_modules/nativescript/lib/nativescript-cli-lib.js --env.verbose --env.sourceMap --no-cache --env.android
android-webpack-watch:
NODE_OPTIONS="--max_old_space_size=4096 --preserve-symlinks" webpack-dev-server --config=webpack.config.js --env.externals=~/package.json --env.externals=package.json --env.appPath=app --env.appResourcesPath=App_Resources --env.nativescriptLibPath=$(PROJECT_DIR)/node_modules/nativescript/lib/nativescript-cli-lib.js --env.verbose --env.sourceMap --no-cache --env.android
ios-webpack:
node --max_old_space_size=4096 --preserve-symlinks node_modules/@nativescript/webpack/dist/bin/index.js build --config=webpack.config.js --env.externals=~/package.json --env.externals=package.json --env.appPath=app --env.appResourcesPath=App_Resources --env.nativescriptLibPath=$(PROJECT_DIR)/node_modules/nativescript/lib/nativescript-cli-lib.js --env.verbose --env.sourceMap --env.ios --no-cache
ios-webpack-watch:
NODE_OPTIONS="--max_old_space_size=4096 --preserve-symlinks" webpack-dev-server --config=webpack.config.js --env.externals=~/package.json --env.externals=package.json --env.appPath=app --env.appResourcesPath=App_Resources --env.nativescriptLibPath=$(PROJECT_DIR)/node_modules/nativescript/lib/nativescript-cli-lib.js --env.verbose --env.sourceMap --no-cache --env.ios