-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
92 lines (74 loc) · 1.73 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
#
# Copyright (c) 2017, Globo.com (https://github.com/globocom)
# Copyright (c) 2013, Payton White (https://github.com/prwhite)
#
# License: MIT
#
.SILENT:
.PHONY: android ios help
# See https://gist.github.com/prwhite/8168133#comment-1313022
## Help screen
help:
echo
printf "Targets available:\n\n"
awk '/^[a-zA-Z\-\_0-9]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-15s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
echo
## Project setup
setup:
@npm install && cd sample && npm install && npm run sync-lib
## Setup with yarn
setup-yarn:
@cd sample && yarn
## Reset npm environment
reset-npm:
@watchman watch-del-all
@cd sample && rm -rf node_modules
@npm cache clean
## Clean dependencies
reset: reset-npm setup
## Clean dependencies and reruns setup
reset-yarn: reset-npm setup-yarn
## Run library tests
test:
@npm test
## Update jest snapshots
test-reset:
@cd sample && npm run test-reset
npm test
## Run code coverage
test-coverage:
@npm run coverage
## Display eslint errors
lint:
@npm run linter
## Display flow errors
flow:
@npm run flow
## Stops a Flow server
flow-stop:
@npm run flow-stop
## Checks linter, flow types and run tests
check: lint flow test
## Synchronize lib files with sample app
sync-lib:
@cd sample && npm run sync-lib
## Watch lib changes to update sample app
watch:
@cd sample && npm run watch-src
## Open iOS project on XCode
open-ios:
open sample/ios/react_native_draftjs_render.xcodeproj/
## Run iOS
ios:
@cd sample && react-native run-ios
## Run android
android:
@cd sample && react-native run-android