Skip to content
Snippets Groups Projects
Commit 9d53f6d2 authored by Viktor Vorobev's avatar Viktor Vorobev Committed by Ugo Albanese
Browse files

Merged in NRRPLT-8191-makefile-schema-generation (pull request #80)

[NRRPLT-8191] Schemas generation through Makefile for user mode

Approved-by: Ugo Albanese
parent 7ff17c57
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,44 @@ clean:
done
.PHONY: devinstall clean download-req
###########################################################
######################### SCHEMAS #########################
###########################################################
#$(info $$SCHEMA_GENERATION is [${SCHEMA_GENERATION}])
ifdef SCHEMA_GENERATION
schemas-build: virtualenv
for f in $(SCHEMA_GENERATION); do \
IFS=':' read -r -a schema <<< "$$f"; \
. $(PLATFORM_VENV)/bin/activate;\
pyxbgen -u $(HBP)/"$${schema[0]}"/"$${schema[1]}" -m "$${schema[2]}" 2>&1 | grep -v "^WARNING" || { echo ERROR;exit 1; }; \
done
schemas-install: schemas-build $(SCHEMA_TARGET_LOCATION)/__init__.py
for f in $(SCHEMA_GENERATION); do \
IFS=':' read -r -a schema <<< "$$f"; \
mv "$${schema[2]}".py $(SCHEMA_TARGET_LOCATION)/ ;\
done
schemas-clean:
for f in $(SCHEMA_GENERATION); do \
IFS=':' read -r -a schema <<< "$$f"; \
rm -rf $(SCHEMA_TARGET_LOCATION)/"$${schema[2]}".py; \
done
$(SCHEMA_TARGET_LOCATION)/__init__.py:
[ -z $$SCHEMA_TARGET_LOCATION ] || touch $@
devinstall-schemas: devinstall schemas-install
.PHONY: devinstall-schemas schemas-install schemas-build schemas-get schemas-dep
#...ifdef SCHEMA_GENERATION
endif
###########################################################
######################### VirtualEnv ######################
###########################################################
......
......@@ -78,17 +78,9 @@ cp $HBP/user-scripts/config_files/nginx/uwsgi-nrp.ini $HOME/.local/etc/nginx/uws
echo "Generating schema parsers for ExDBackend"
if [[ -d "${NRP_VIRTUAL_ENV}" ]]; then
source ${NRP_VIRTUAL_ENV}/bin/activate
pyxbgen -u $HBP/Experiments/bibi_configuration.xsd -m bibi_api_gen 2>&1 | grep -v "^WARNING" || { echo ERROR;exit 1; }
pyxbgen -u $HBP/Experiments/ExDConfFile.xsd -m exp_conf_api_gen 2>&1 | grep -v "^WARNING" || { echo ERROR;exit 1; }
pyxbgen -u $HBP/Models/environment_model_configuration.xsd -m environment_conf_api_gen 2>&1 | grep -v "^WARNING" || { echo ERROR;exit 1; }
pyxbgen -u $HBP/Models/robot_model_configuration.xsd -m robot_conf_api_gen 2>&1 | grep -v "^WARNING" || { echo ERROR;exit 1; }
gen_file_path=$HBP/ExDBackend/hbp_nrp_commons/hbp_nrp_commons/generated
mv bibi_api_gen.py $gen_file_path
mv exp_conf_api_gen.py $gen_file_path
mv robot_conf_api_gen.py $gen_file_path
mv environment_conf_api_gen.py $gen_file_path
deactivate
pushd $HBP/ExDBackend > /dev/null
make schemas-install -s
popd > /dev/null
else
echo "ExDBackend is not built yet. Skipping schema parsers generation."
fi
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment