diff --git a/.editorconfig b/.editorconfig index f6bdd8504..f713e4f97 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,6 +10,10 @@ indent_style = space end_of_line = lf insert_final_newline = true +# Indentation override for Makefiles +[Makefile, .mk] +indent_style = tab + # 4 space indentation [*.py] indent_style = space diff --git a/.gitignore b/.gitignore index dc84c23ff..7367652f2 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ robots.txt venv/* venv3/* .flaskenv +Makefile.perso.mk atlas/configuration/config.py atlas/configuration/settings.ini diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..bb226304c --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +-include Makefile.perso.mk + +########################### +# colors # +########################### +PRINT_COLOR = printf +COLOR_SUCCESS = \033[1;32m +COLOR_DEBUG = \033[36m +COLOR_RESET = \033[0m + +########################### +# Variables # +########################### + +DIR_BIN = venv/bin/ + +########################### +# Run project # +########################### + +.PHONY: serve-dev +serve-dev: + $(call display_cmd, Start dev server) + $(DIR_BIN)flask --app ./atlas/app run --debug -h 0.0.0.0 + +########################### +# Manage translations # +########################### + +.PHONY: messages +messages: + $(call display_cmd, Extract translations) + $(DIR_BIN)pybabel extract -F atlas/babel.cfg -o atlas/messages.pot atlas + $(DIR_BIN)pybabel update -i atlas/messages.pot -d atlas/translations + +.PHONY: compile_messages +compile_messages: + $(call display_cmd, Apply translations) + $(DIR_BIN)pybabel compile -d atlas/translations + +define display_cmd + @$(PRINT_COLOR) "\n$(COLOR_SUCCESS) ########################## $(COLOR_RESET)\n" + @$(PRINT_COLOR) "$(COLOR_SUCCESS) ### $(1) $(COLOR_RESET)\n" + @$(PRINT_COLOR) "$(COLOR_SUCCESS) ########################## $(COLOR_RESET)\n\n" +endef diff --git a/docs/changelog.rst b/docs/changelog.rst index 1cb38c87c..ac203698d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -20,6 +20,10 @@ CHANGELOG - Amélioration de la "recherche par commune": mots tronqués, sans accent (#531 par @jpm-cbna) +👨‍💻 **Développement** + +- Ajout d'un Makefile afin de faciliter les développements. + ⚠️ **Notes de version** Si vous mettez à jour GeoNature-atlas :