Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev: add makefile tool to dev use #576

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ robots.txt
venv/*
venv3/*
.flaskenv
Makefile.perso.mk

atlas/configuration/config.py
atlas/configuration/settings.ini
Expand Down
45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion atlas/babel.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[python: **.py]
[jinja2: **/templates/**/**.html]
[jinja2: **/static/custom/templates/**.sample]
extensions=jinja2.ext.autoescape,jinja2.ext.with_
Loading