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.
31 lines
1000 B
31 lines
1000 B
GITEA_URL=https://git.vakabus.cz/swagger.v1.json
|
|
BUILDDIR=tmp
|
|
|
|
build: swagger_client click clean_builddir
|
|
|
|
swagger_client:
|
|
mkdir -p "${BUILDDIR}"
|
|
swagger-codegen generate -i "${GITEA_URL}" -l python -o "${BUILDDIR}/gitea_api"
|
|
mv "${BUILDDIR}/gitea_api/swagger_client" .
|
|
rm -rf "${BUILDDIR}/gitea_api"
|
|
|
|
# Protoze ten generator psali nejaci dementi, neumi to cyklicke reference
|
|
# je proto potreba zakomentovat dva importy
|
|
sed -i 's/from swagger_client\.models\.gpg_key import GPGKey/#from swagger_client.models.gpg_key import GPGKey/' swagger_client/models/gpg_key.py
|
|
sed -i 's/from swagger_client\.models\.repository import Repository/#from swagger_client.models.repository import Repository/' swagger_client/models/repository.py
|
|
|
|
click:
|
|
mkdir -p "${BUILDDIR}"
|
|
cd ${BUILDDIR}; git clone --depth=1 https://github.com/pallets/click.git
|
|
mv ${BUILDDIR}/click/click click
|
|
|
|
.PHONY: clean_builddir
|
|
clean_builddir:
|
|
rm -rf ${BUILDDIR}
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -rf swagger_client/
|
|
rm -rf click/
|
|
|
|
|
|
|