|
| 1 | +.PHONY: react-native |
| 2 | + |
| 3 | +help: ##@other Show this help |
| 4 | + @perl -e '$(HELP_FUN)' $(MAKEFILE_LIST) |
| 5 | + |
| 6 | +# This is a code for automatic help generator. |
| 7 | +# It supports ANSI colors and categories. |
| 8 | +# To add new item into help output, simply add comments |
| 9 | +# starting with '##'. To add category, use @category. |
| 10 | +GREEN := $(shell tput -Txterm setaf 2) |
| 11 | +WHITE := $(shell tput -Txterm setaf 7) |
| 12 | +YELLOW := $(shell tput -Txterm setaf 3) |
| 13 | +RESET := $(shell tput -Txterm sgr0) |
| 14 | +HELP_FUN = \ |
| 15 | + %help; \ |
| 16 | + while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^([a-zA-Z\-]+)\s*:.*\#\#(?:@([a-zA-Z\-]+))?\s(.*)$$/ }; \ |
| 17 | + print "Usage: make [target]\n\n"; \ |
| 18 | + for (sort keys %help) { \ |
| 19 | + print "${WHITE}$$_:${RESET}\n"; \ |
| 20 | + for (@{$$help{$$_}}) { \ |
| 21 | + $$sep = " " x (32 - length $$_->[0]); \ |
| 22 | + print " ${YELLOW}$$_->[0]${RESET}$$sep${GREEN}$$_->[1]${RESET}\n"; \ |
| 23 | + }; \ |
| 24 | + print "\n"; \ |
| 25 | + } |
| 26 | + |
| 27 | +# Main targets |
| 28 | + |
| 29 | +prepare: ##@prepare Install dependencies and prepare workspace |
| 30 | + lein deps |
| 31 | + npm install |
| 32 | + ./re-natal deps |
| 33 | + ./re-natal use-figwheel |
| 34 | + lein re-frisk use-re-natal |
| 35 | + ./re-natal enable-source-maps |
| 36 | + |
| 37 | +prepare-ios: prepare ##@prepare Install iOS specific dependencies |
| 38 | + cd ios && pod install && cd .. |
| 39 | + |
| 40 | +#---------------- |
| 41 | +# Release builds |
| 42 | +#---------------- |
| 43 | +release: release-android release-ios ##@build build release for Android and iOS |
| 44 | + |
| 45 | +release-android: prod-build ##@build build release for Android |
| 46 | + react-native run-android --variant=release |
| 47 | + |
| 48 | +release-ios: prod-build ##@build build release for iOS release |
| 49 | + @echo "Build in XCode, see https://wiki.status.im/TBD for instructions" |
| 50 | + |
| 51 | +#---------------- |
| 52 | +# Dev builds |
| 53 | +#---------------- |
| 54 | +dev-android-real: ##@dev build for Android real device |
| 55 | + ./re-natal use-android-device real |
| 56 | + ./re-natal use-figwheel |
| 57 | + |
| 58 | +dev-android-avd: ##@dev build for Android AVD simulator |
| 59 | + ./re-natal use-android-device avd |
| 60 | + ./re-natal use-figwheel |
| 61 | + |
| 62 | +dev-android-genymotion: ##@dev build for Android Genymotion simulator |
| 63 | + ./re-natal use-android-device genymotion |
| 64 | + ./re-natal use-figwheel |
| 65 | + |
| 66 | +dev-ios-real: prod-build ##@dev build for iOS real device |
| 67 | + ./re-natal use-ios-device real |
| 68 | + ./re-natal use-figwheel |
| 69 | + |
| 70 | +dev-ios-simulator: prod-build ##@dev build for iOS simulator |
| 71 | + ./re-natal use-ios-device simulator |
| 72 | + ./re-natal use-figwheel |
| 73 | + |
| 74 | +prod-build: |
| 75 | + lein prod-build |
| 76 | + |
| 77 | +#-------------- |
| 78 | +# REPL |
| 79 | +# ------------- |
| 80 | + |
| 81 | +repl: ##@repl Start REPL for iOS and Android |
| 82 | + BUILD_IDS="ios,android" lein repl |
| 83 | + |
| 84 | +repl-ios: ##@repl Start REPL for iOS |
| 85 | + BUILD_IDS="ios" lein repl |
| 86 | + |
| 87 | +repl-android: ##@repl Start REPL for Android |
| 88 | + BUILD_IDS="android" lein repl |
| 89 | + |
| 90 | +#-------------- |
| 91 | +# Run |
| 92 | +# ------------- |
| 93 | +run-android: ##@run Run Android build |
| 94 | + react-native run-android |
| 95 | + |
| 96 | +run-ios: ##@run Run iOS build |
| 97 | + react-native run-ios |
| 98 | + |
| 99 | +#-------------- |
| 100 | +# Other |
| 101 | +#-------------- |
| 102 | +react-native: ##@other Start react native packager |
| 103 | + react-native start |
| 104 | + |
| 105 | +geth-connect: ##@other Connect to Geth on the device |
| 106 | + adb forward tcp:8545 tcp:8545 |
| 107 | + build/bin/geth attach http://localhost:8545 |
| 108 | + |
| 109 | +android-ports: ##@other Add reverse proxy to Android Device/Simulator |
| 110 | + adb reverse tcp:8081 tcp:8081 |
| 111 | + adb reverse tcp:3449 tcp:3449 |
| 112 | + adb reverse tcp:4567 tcp:4567 |
0 commit comments