Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

111 linhas
3.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. distmacapp = dist/Kosmorro.app
  47. dist-mac-app: env
  48. @if [ -e $(distmacapp) ]; then echo "Deleting the existing app."; rm -rf $(distmacapp); fi
  49. mkdir -p "$(distmacapp)/Contents/MacOS" "$(distmacapp)/Contents/Resources"
  50. # Add application files
  51. cp "kosmorro" "$(distmacapp)/Contents/MacOS/kosmorro"
  52. cp -r "kosmorrolib" "$(distmacapp)/Contents/MacOS/kosmorrolib"
  53. cp "Pipfile" "$(distmacapp)/Contents/MacOS/Pipfile"
  54. cp "Pipfile.lock" "$(distmacapp)/Contents/MacOS/Pipfile.lock"
  55. # Install dependencies
  56. cd $(distmacapp)/Contents/MacOS && PIPENV_VENV_IN_PROJECT=1 pipenv sync
  57. cd $(distmacapp)/Contents/MacOS && source .venv/bin/activate && pip install wxPython latex
  58. # Add Python binaries and remove the links in the virtualenv
  59. cp -r "$$(dirname $$(realpath $$(which python3)))/.." $(distmacapp)/Contents/MacOS/python
  60. rm $(distmacapp)/Contents/MacOS/.venv/bin/python{,3,3.9}
  61. # Add Mac-specific files
  62. cp "build/distrib/darwin/Info.plist" "$(distmacapp)/Contents/Info.plist"
  63. cp "build/distrib/darwin/launch-kosmorro.sh" "$(distmacapp)/Contents/MacOS/launch-kosmorro"
  64. cp "build/distrib/darwin/icon.icns" "$(distmacapp)/Contents/Resources/icon.icns"
  65. sed "s/{{app_version}}/$$RELEASE_NUMBER/" "build/distrib/darwin/Info.plist" > "$(distmacapp)/Contents/Info.plist"
  66. chmod +x "$(distmacapp)/Contents/MacOS/launch-kosmorro"
  67. # Clean package
  68. rm "$(distmacapp)/Contents/MacOS/Pipfile" "$(distmacapp)/Contents/MacOS/Pipfile.lock"
  69. @echo "Application created."
  70. distmacdmg = dist/Kosmorro.dmg
  71. dist-mac-dmg: dist-mac-app
  72. @if [ -e $(distmacdmg) ]; then echo "Deleting the existing DMG."; rm -rf $(distmacdmg); fi
  73. mkdir -p "$(distmacapp)/Contents/MacOS"
  74. mkdir -p dist/dmg
  75. cp -r $(distmacapp) dist/dmg
  76. create-dmg --volname "Kosmorro installer" \
  77. --volicon build/distrib/darwin/dmg.icns \
  78. --background build/distrib/darwin/dmg-background.png \
  79. --icon-size 72 \
  80. --icon Kosmorro.app 140 120 \
  81. --window-size 640 365 \
  82. --app-drop-link 475 120 \
  83. --eula LICENSE.md \
  84. $(distmacdmg) \
  85. dist/dmg
  86. rm -rf dist/dmg
  87. dist: dist-mac-dmg