You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Makefile 4.1KB

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