Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. help:
  2. @echo "Please use \`make <target>' where <target> is one of"
  3. @echo " start-server to start the test server"
  4. @echo " stop-server to stop the test server"
  5. @echo " test to perform unit tests. Provide TEST to perform a specific test."
  6. @echo " coverage to perform unit tests with code coverage. Provide TEST to perform a specific test."
  7. @echo " coverage-show to show the code coverage report"
  8. @echo " clean to remove build artifacts"
  9. @echo " docs to build the Sphinx docs"
  10. @echo " docs-show to view the Sphinx docs"
  11. @echo " tag to modify the version, update changelog, and chag tag"
  12. @echo " package to build the phar and zip files"
  13. start-server: stop-server
  14. node tests/server.js &> /dev/null &
  15. stop-server:
  16. @PID=$(shell ps axo pid,command \
  17. | grep 'tests/server.js' \
  18. | grep -v grep \
  19. | cut -f 1 -d " "\
  20. ) && [ -n "$$PID" ] && kill $$PID || true
  21. test: start-server
  22. vendor/bin/phpunit
  23. $(MAKE) stop-server
  24. coverage: start-server
  25. vendor/bin/phpunit --coverage-html=build/artifacts/coverage
  26. $(MAKE) stop-server
  27. coverage-show: view-coverage
  28. view-coverage:
  29. open build/artifacts/coverage/index.html
  30. clean:
  31. rm -rf artifacts/*
  32. docs:
  33. cd docs && make html && cd ..
  34. docs-show:
  35. open docs/_build/html/index.html
  36. tag:
  37. $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1"))
  38. @echo Tagging $(TAG)
  39. chag update $(TAG)
  40. sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/ClientInterface.php
  41. php -l src/ClientInterface.php
  42. git add -A
  43. git commit -m '$(TAG) release'
  44. chag tag
  45. package:
  46. php build/packager.php
  47. .PHONY: docs burgomaster coverage-show view-coverage