[ADD] makefile generate code generation other and i18n
- clean test to stash git before copying data - prettier_xml.sh in format
This commit is contained in:
parent
41e645d3fa
commit
6002309a68
3 changed files with 61 additions and 36 deletions
16
Makefile
16
Makefile
|
|
@ -192,6 +192,16 @@ test_code_generator_template: db_restore_erplibre_base_db_template addons_instal
|
|||
.PHONY: test_code_generator_demo
|
||||
test_code_generator_demo: db_restore_erplibre_base_db_template addons_install_all_generated_demo clean_code_generator_template
|
||||
|
||||
.PHONY: test_code_generator_code
|
||||
test_code_generator_code: clean_test
|
||||
./script/make.sh test_code_generator_template
|
||||
./script/make.sh test_code_generator_generation_other
|
||||
|
||||
.PHONY: test_code_generator_code_i18n
|
||||
test_code_generator_code_i18n: test_code_generator_code
|
||||
./script/make.sh test_code_generator_template
|
||||
./script/make.sh clean_code_generator_template
|
||||
|
||||
##############
|
||||
# terminal #
|
||||
##############
|
||||
|
|
@ -208,10 +218,12 @@ format: format_code_generator format_code_generator_template
|
|||
.PHONY: format_code_generator
|
||||
format_code_generator:
|
||||
./script/maintenance/black.sh ./addons/TechnoLibre_odoo-code-generator/
|
||||
#./script/maintenance/prettier_xml.sh ./addons/TechnoLibre_odoo-code-generator/
|
||||
|
||||
.PHONY: format_code_generator_template
|
||||
format_code_generator_template:
|
||||
./script/maintenance/black.sh ./addons/TechnoLibre_odoo-code-generator-template/
|
||||
#./script/maintenance/prettier_xml.sh ./addons/TechnoLibre_odoo-code-generator-template/
|
||||
|
||||
###########
|
||||
# clean #
|
||||
|
|
@ -220,6 +232,10 @@ format_code_generator_template:
|
|||
clean_code_generator_template:
|
||||
./script/repo_revert_git_diff_date_from_code_generator.py
|
||||
|
||||
.PHONY: clean_test
|
||||
clean_test:
|
||||
cd addons/OCA_server-tools; git stash; git clean -fd
|
||||
|
||||
############
|
||||
# docker #
|
||||
############
|
||||
|
|
|
|||
4
script/make.sh
Executable file
4
script/make.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
echo "==$&%== Begin ${@}"
|
||||
time make $@
|
||||
echo "==$&%== End ${@}"
|
||||
|
|
@ -35,7 +35,11 @@ def main():
|
|||
config = get_config()
|
||||
# rex = r"\s+(?=\d{2}(?:\d{2})?-\d{1,2}-\d{1,2}\b)"
|
||||
rex = r"[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]) (2[0-3]|[01][0-9]):[0-5][0-9]"
|
||||
path = "./addons/TechnoLibre_odoo-code-generator-template"
|
||||
lst_path = [
|
||||
"./addons/TechnoLibre_odoo-code-generator-template",
|
||||
"./addons/OCA_server-tools",
|
||||
]
|
||||
for path in lst_path:
|
||||
repo = git.Repo(path)
|
||||
supported_ext = [".xml", ".pot", ".po"]
|
||||
for diff in repo.index.diff(None, create_patch=True):
|
||||
|
|
@ -55,6 +59,7 @@ def main():
|
|||
nb_line_target = len(hunk.target)
|
||||
if nb_line_source != nb_line_target:
|
||||
# TODO support different line
|
||||
_logger.warning(f"Source nb line different of target nb line for file {path}/{file_path}.")
|
||||
continue
|
||||
# try:
|
||||
# assert nb_line_source == nb_line_target, f"Not the same line of diff:\n{str_diff}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue