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.
 
 
 
 

85 lines
2.8 KiB

  1. .PHONY: test
  2. test:
  3. unset KOSMORRO_LATITUDE; \
  4. unset KOSMORRO_LONGITUDE; \
  5. unset KOSMORRO_TIMEZONE; \
  6. LANG=C pipenv run python3 -m coverage run -m unittest test
  7. .PHONY: build
  8. build: i18n
  9. python3 setup.py sdist bdist_wheel
  10. i18n:
  11. ronn --roff manpage/kosmorro.1.md
  12. ronn --roff manpage/kosmorro.7.md
  13. if [ "$$POEDITOR_API_ACCESS" != "" ]; then \
  14. python3 .scripts/build/getlangs.py; \
  15. python3 setup.py compile_catalog; \
  16. fi
  17. env:
  18. @if [[ "$$RELEASE_NUMBER" == "" ]]; \
  19. then echo "Missing environment variable: RELEASE_NUMBER."; \
  20. echo 'Example: export RELEASE_NUMBER="1.0.0" (without the leading "v")'; \
  21. exit 1; \
  22. fi
  23. release: env
  24. @echo -e "\e[1mCreating release with version number \e[36m$$RELEASE_NUMBER\e[0m"
  25. @echo
  26. sed "s/^VERSION =.*/VERSION = '$$RELEASE_NUMBER'/g" kosmorrolib/version.py > version.py
  27. mv version.py kosmorrolib/version.py
  28. pipenv run python setup.py extract_messages --output-file=kosmorrolib/locales/messages.pot > /dev/null
  29. conventional-changelog -p angular -i CHANGELOG.md -s
  30. sed "0,/\\[\\]/s/\\[\\]/[v$$RELEASE_NUMBER]/g" CHANGELOG.md > /tmp/CHANGELOG.md
  31. sed -e "s/...v)/...v$$RELEASE_NUMBER)/" /tmp/CHANGELOG.md > CHANGELOG.md
  32. rm /tmp/CHANGELOG.md
  33. @echo
  34. @echo -e "\e[1mRelease \e[36m$$RELEASE_NUMBER\e[39m is ready to commit."
  35. @echo -e "Please review the changes, then invoke \e[33mmake finish-release\e[39m."
  36. finish-release: env
  37. git add CHANGELOG.md kosmorrolib/version.py kosmorrolib/locales/messages.pot
  38. git commit -m "build: bump version $$RELEASE_NUMBER"
  39. git tag "v$$RELEASE_NUMBER"
  40. git checkout features
  41. git merge master
  42. git checkout master
  43. @echo
  44. @echo -e "\e[1mVersion \e[36m$$RELEASE_NUMBER\e[39m successfully tagged!"
  45. @echo -e "Invoke \e[33mgit push origin master features v$$RELEASE_NUMBER\e[39m to finish."
  46. distapp = dist/Kosmorro.app
  47. distrib-mac: env
  48. @if [ -e $(distapp) ]; then echo "Deleting the existing app."; rm -rf $(distapp); fi
  49. mkdir -p "$(distapp)/Contents/MacOS" "$(distapp)/Contents/Resources"
  50. # Add application files
  51. cp "kosmorro" "$(distapp)/Contents/MacOS/kosmorro"
  52. cp -r "kosmorrolib" "$(distapp)/Contents/MacOS/kosmorrolib"
  53. cp "Pipfile" "$(distapp)/Contents/MacOS/Pipfile"
  54. cp "Pipfile.lock" "$(distapp)/Contents/MacOS/Pipfile.lock"
  55. # Install dependencies
  56. cd $(distapp)/Contents/MacOS && PIPENV_VENV_IN_PROJECT=1 pipenv sync
  57. cd $(distapp)/Contents/MacOS && source .venv/bin/activate && pip install wxPython
  58. # Add Mac-specific files
  59. cp "build/distrib/darwin/Info.plist" "$(distapp)/Contents/Info.plist"
  60. cp "build/distrib/darwin/launch-kosmorro.sh" "$(distapp)/Contents/MacOS/launch-kosmorro"
  61. cp "build/distrib/darwin/icon.icns" "$(distapp)/Contents/Resources/icon.icns"
  62. sed "s/{{app_version}}/$$RELEASE_NUMBER/" "build/distrib/darwin/Info.plist" > "$(distapp)/Contents/Info.plist"
  63. chmod +x "$(distapp)/Contents/MacOS/launch-kosmorro"
  64. echo "Application created."