Mirror of the MieuxVoter API specifications. https://api.mieuxvoter.fr
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.

36 lines
833 B

  1. INSTALL_DIR=build
  2. CONFIG_DIR=config
  3. YAML_FILE=https://raw.githubusercontent.com/MieuxVoter/mv-api-spec/master/mv-openapi.yaml
  4. .DEFAULT_GOAL := all
  5. .PHONY: all
  6. all: clients server
  7. .PHONY: server
  8. server: ${INSTALL_DIR}/python-flask
  9. .PHONY: clients
  10. clients: ${INSTALL_DIR}/typescript-fetch ${INSTALL_DIR}/python
  11. ${INSTALL_DIR}/%:
  12. mkdir -p ${INSTALL_DIR}
  13. CONFIG_FILE=${CONFIG_DIR}/$*.yaml
  14. if [ -f ${CONFIG_DIR}/$*.yaml ]; then\
  15. docker run --rm -v "${PWD}:/local" \
  16. openapitools/openapi-generator-cli generate \
  17. -i ${YAML_FILE} \
  18. -g $* \
  19. -o /local/${INSTALL_DIR}/$* \
  20. -c /local/${CONFIG_DIR}/$*.yaml;\
  21. else\
  22. docker run --rm -v "${PWD}:/local" \
  23. openapitools/openapi-generator-cli generate \
  24. -i ${YAML_FILE} \
  25. -g $* \
  26. -o /local/${INSTALL_DIR}/$*; \
  27. fi
  28. .PHONY: clean
  29. clean:
  30. rm -rf ${INSTALL_DIR}