Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. VERSION = 2.0.0
  2. NPM_ROOT = node_modules
  3. STATIC_DIR = src/sentry/static/sentry
  4. BOOTSTRAP_JS = ${STATIC_DIR}/scripts/lib/bootstrap.js
  5. BOOTSTRAP_JS_MIN = ${STATIC_DIR}/scripts/lib/bootstrap.min.js
  6. UGLIFY_JS ?= node_modules/uglify-js/bin/uglifyjs
  7. develop: update-submodules
  8. npm install
  9. pip install "file://`pwd`#egg=sentry[dev]"
  10. pip install -e . --use-mirrors
  11. build: locale
  12. clean:
  13. rm -r src/sentry/static/CACHE
  14. locale:
  15. cd src/sentry && sentry makemessages -l en
  16. cd src/sentry && sentry compilemessages
  17. compile-bootstrap-js:
  18. @cat src/bootstrap/js/bootstrap-transition.js src/bootstrap/js/bootstrap-alert.js src/bootstrap/js/bootstrap-button.js src/bootstrap/js/bootstrap-carousel.js src/bootstrap/js/bootstrap-collapse.js src/bootstrap/js/bootstrap-dropdown.js src/bootstrap/js/bootstrap-modal.js src/bootstrap/js/bootstrap-tooltip.js src/bootstrap/js/bootstrap-popover.js src/bootstrap/js/bootstrap-scrollspy.js src/bootstrap/js/bootstrap-tab.js src/bootstrap/js/bootstrap-typeahead.js src/bootstrap/js/bootstrap-affix.js ${STATIC_DIR}/scripts/bootstrap-datepicker.js > ${BOOTSTRAP_JS}
  19. ${UGLIFY_JS} -nc ${BOOTSTRAP_JS} > ${BOOTSTRAP_JS_MIN};
  20. install-test-requirements:
  21. pip install "file://`pwd`#egg=sentry[tests]"
  22. update-submodules:
  23. git submodule init
  24. git submodule update
  25. test: install-test-requirements lint test-js test-python
  26. test-js:
  27. @echo "Running JavaScript tests"
  28. ${NPM_ROOT}/phantomjs/bin/phantomjs runtests.js tests/js/index.html
  29. @echo ""
  30. test-python:
  31. @echo "Running Python tests"
  32. python setup.py -q test || exit 1
  33. @echo ""
  34. lint: lint-python lint-js
  35. lint-python:
  36. @echo "Linting Python files"
  37. flake8 --exclude=migrations,src/sentry/static/CACHE/* --ignore=E501,E225,E121,E123,E124,E125,E127,E128 src/sentry
  38. @echo ""
  39. lint-js:
  40. @echo "Linting JavaScript files"
  41. @${NPM_ROOT}/jshint/bin/hint src/sentry/ || exit 1
  42. @echo ""
  43. coverage:
  44. coverage run --include=src/sentry/* setup.py test
  45. coverage html --omit=src/sentry/migrations/* -d htmlcov
  46. .PHONY: build