fork von https://github.com/nilsnolde/OSMtools mit QGIS2 processing erweiterung
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 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. #/***************************************************************************
  2. # OSMtools
  3. #
  4. # falk
  5. # -------------------
  6. # begin : 2017-02-01
  7. # git sha : $Format:%H$
  8. # copyright : (C) 2017 by nils
  9. # email : nils
  10. # ***************************************************************************/
  11. #
  12. #/***************************************************************************
  13. # * *
  14. # * This program is free software; you can redistribute it and/or modify *
  15. # * it under the terms of the GNU General Public License as published by *
  16. # * the Free Software Foundation; either version 2 of the License, or *
  17. # * (at your option) any later version. *
  18. # * *
  19. # ***************************************************************************/
  20. #################################################
  21. # Edit the following to match your sources lists
  22. #################################################
  23. #Add iso code for any locales you want to support here (space separated)
  24. # default is no locales
  25. # LOCALES = af
  26. LOCALES =
  27. # If locales are enabled, set the name of the lrelease binary on your system. If
  28. # you have trouble compiling the translations, you may have to specify the full path to
  29. # lrelease
  30. #LRELEASE = lrelease
  31. #LRELEASE = lrelease-qt4
  32. PLUGINNAME = OSMtools
  33. PY_FILES = \
  34. __init__.py osm_tools.py \
  35. core gui osmtools_processing utils
  36. # translation
  37. SOURCES = $(PY_FILES)
  38. UI_FILES = gui/*.ui
  39. EXTRAS = metadata.txt *.png config.yml
  40. EXTRA_DIRS =
  41. COMPILED_RESOURCE_FILES = gui/resources.py gui/resources_rc.py
  42. PEP8EXCLUDE=pydev,resources.py,conf.py,third_party,ui
  43. #################################################
  44. # Normally you would not need to edit below here
  45. #################################################
  46. HELP = help/build/html
  47. PLUGIN_UPLOAD = $(c)/plugin_upload.py
  48. RESOURCE_SRC=$(shell grep '^ *<file' resources.qrc | sed 's@</file>@@g;s/.*>//g' | tr '\n' ' ')
  49. QGISDIR=.qgis2
  50. default: deploy
  51. compile: $(COMPILED_RESOURCE_FILES)
  52. %.py : %.qrc $(RESOURCES_SRC)
  53. #pyrcc4 -o $*.py $<
  54. %.qm : %.ts
  55. $(LRELEASE) $<
  56. test: compile # transcompile
  57. @echo
  58. @echo "----------------------"
  59. @echo "Regression Test Suite"
  60. @echo "----------------------"
  61. @# Preceding dash means that make will continue in case of errors
  62. @-export PYTHONPATH=`pwd`:$(PYTHONPATH); \
  63. export QGIS_DEBUG=0; \
  64. export QGIS_LOG_FILE=/dev/null; \
  65. nosetests -v --with-id --with-coverage --cover-package=. \
  66. 3>&1 1>&2 2>&3 3>&- || true
  67. @echo "----------------------"
  68. @echo "If you get a 'no module named qgis.core error, try sourcing"
  69. @echo "the helper script we have provided first then run make test."
  70. @echo "e.g. source run-env-linux.sh <path to qgis install>; make test"
  71. @echo "----------------------"
  72. deploy: compile # doc transcompile
  73. @echo
  74. @echo "------------------------------------------"
  75. @echo "Deploying plugin to your .qgis2 directory."
  76. @echo "------------------------------------------"
  77. # The deploy target only works on unix like operating system where
  78. # the Python plugin directory is located at:
  79. # $HOME/$(QGISDIR)/python/plugins
  80. mkdir -p $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  81. cp -vfr $(PY_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  82. cp -vf $(UI_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  83. cp -vf $(COMPILED_RESOURCE_FILES) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  84. cp -vf $(EXTRAS) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  85. cp -vfr i18n $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  86. #cp -vfr $(HELP) $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)/help
  87. # Copy extra directories if any
  88. # (temporarily removed)
  89. # The dclean target removes compiled python files from plugin directory
  90. # also deletes any .git entry
  91. dclean:
  92. @echo
  93. @echo "-----------------------------------"
  94. @echo "Removing any compiled python files."
  95. @echo "-----------------------------------"
  96. find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname "*.pyc" -delete
  97. find $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME) -iname ".git" -prune -exec rm -Rf {} \;
  98. derase:
  99. @echo
  100. @echo "-------------------------"
  101. @echo "Removing deployed plugin."
  102. @echo "-------------------------"
  103. rm -Rf $(HOME)/$(QGISDIR)/python/plugins/$(PLUGINNAME)
  104. zip: deploy dclean
  105. @echo
  106. @echo "---------------------------"
  107. @echo "Creating plugin zip bundle."
  108. @echo "---------------------------"
  109. # The zip target deploys the plugin and creates a zip file with the deployed
  110. # content. You can then upload the zip file on http://plugins.qgis.org
  111. rm -f $(PLUGINNAME).zip
  112. cd $(HOME)/$(QGISDIR)/python/plugins; zip -9r $(CURDIR)/$(PLUGINNAME).zip $(PLUGINNAME)
  113. package: compile
  114. # Create a zip package of the plugin named $(PLUGINNAME).zip.
  115. # This requires use of git (your plugin development directory must be a
  116. # git repository).
  117. # To use, pass a valid commit or tag as follows:
  118. # make package VERSION=Version_0.3.2
  119. @echo
  120. @echo "------------------------------------"
  121. @echo "Exporting plugin to zip package. "
  122. @echo "------------------------------------"
  123. rm -f $(PLUGINNAME).zip
  124. git archive --prefix=$(PLUGINNAME)/ -o $(PLUGINNAME).zip $(VERSION)
  125. echo "Created package: $(PLUGINNAME).zip"
  126. upload: zip
  127. @echo
  128. @echo "-------------------------------------"
  129. @echo "Uploading plugin to QGIS Plugin repo."
  130. @echo "-------------------------------------"
  131. $(PLUGIN_UPLOAD) $(PLUGINNAME).zip
  132. clean:
  133. @echo
  134. @echo "------------------------------------"
  135. @echo "Removing uic and rcc generated files"
  136. @echo "------------------------------------"
  137. rm $(COMPILED_UI_FILES) $(COMPILED_RESOURCE_FILES)
  138. watch:
  139. while true; do \
  140. make $(WATCHMAKE); \
  141. inotifywait -qre close_write ./; \
  142. done
  143. doc:
  144. @echo
  145. @echo "------------------------------------"
  146. @echo "Building documentation using sphinx."
  147. @echo "------------------------------------"
  148. #cd help; make html
  149. pylint:
  150. @echo
  151. @echo "-----------------"
  152. @echo "Pylint violations"
  153. @echo "-----------------"
  154. @pylint --reports=n --rcfile=pylintrc . || true
  155. @echo
  156. @echo "----------------------"
  157. @echo "If you get a 'no module named qgis.core' error, try sourcing"
  158. @echo "the helper script we have provided first then run make pylint."
  159. @echo "e.g. source run-env-linux.sh <path to qgis install>; make pylint"
  160. @echo "----------------------"
  161. # Run pep8 style checking
  162. #http://pypi.python.org/pypi/pep8
  163. pep8:
  164. @echo
  165. @echo "-----------"
  166. @echo "PEP8 issues"
  167. @echo "-----------"
  168. @pep8 --repeat --ignore=E203,E121,E122,E123,E124,E125,E126,E127,E128 --exclude $(PEP8EXCLUDE) . || true
  169. @echo "-----------"
  170. @echo "Ignored in PEP8 check:"
  171. @echo $(PEP8EXCLUDE)