|
| 1 | +@echo off |
| 2 | + |
| 3 | + |
| 4 | +IF /I "%1"=="def skip(app, what, name, obj, would_skip, options)" GOTO def skip(app, what, name, obj, would_skip, options) |
| 5 | +IF /I "%1"==" if name in ('__init__',)" GOTO if name in ('__init__',) |
| 6 | +IF /I "%1"==" def setup(app)" GOTO def setup(app) |
| 7 | +IF /I "%1"=="setup" GOTO setup |
| 8 | +IF /I "%1"=="setup-prod" GOTO setup-prod |
| 9 | +IF /I "%1"=="setup-dev" GOTO setup-dev |
| 10 | +IF /I "%1"=="build" GOTO build |
| 11 | +IF /I "%1"=="local-install" GOTO local-install |
| 12 | +IF /I "%1"=="style" GOTO style |
| 13 | +IF /I "%1"=="format" GOTO format |
| 14 | +IF /I "%1"=="lint" GOTO lint |
| 15 | +IF /I "%1"=="docs-gen" GOTO docs-gen |
| 16 | +IF /I "%1"=="docs-sphinx" GOTO docs-sphinx |
| 17 | +IF /I "%1"=="docs-py" GOTO docs-py |
| 18 | +IF /I "%1"=="docs-start" GOTO docs-start |
| 19 | +IF /I "%1"=="docs-push" GOTO docs-push |
| 20 | +IF /I "%1"=="docs-build" GOTO docs-build |
| 21 | +IF /I "%1"=="docs-deploy" GOTO docs-deploy |
| 22 | +IF /I "%1"=="clean" GOTO clean |
| 23 | +IF /I "%1"=="sphinx-docs-clean" GOTO sphinx-docs-clean |
| 24 | +IF /I "%1"=="docs-clean" GOTO docs-clean |
| 25 | +IF /I "%1"=="build-clean" GOTO build-clean |
| 26 | +IF /I "%1"=="dump-clean" GOTO dump-clean |
| 27 | +IF /I "%1"=="test" GOTO test |
| 28 | +IF /I "%1"=="test-no-warn" GOTO test-no-warn |
| 29 | +GOTO error |
| 30 | + |
| 31 | +:def skip(app, what, name, obj, would_skip, options) |
| 32 | + '''Skip''' |
| 33 | + GOTO :EOF |
| 34 | + |
| 35 | +: if name in ('__init__',) |
| 36 | + return False |
| 37 | + return would_skip |
| 38 | + GOTO :EOF |
| 39 | + |
| 40 | +: def setup(app) |
| 41 | + '''Setup App''' |
| 42 | + GOTO :EOF |
| 43 | + |
| 44 | +:setup |
| 45 | + CALL make.bat setup-prod |
| 46 | + CALL make.bat setup-dev |
| 47 | + GOTO :EOF |
| 48 | + |
| 49 | +:setup-prod |
| 50 | + python -m pip install --upgrade pip |
| 51 | + pip install pipenv |
| 52 | + pipenv install |
| 53 | + GOTO :EOF |
| 54 | + |
| 55 | +:setup-dev |
| 56 | + python -m pip install --upgrade pip |
| 57 | + pip install pipenv |
| 58 | + pipenv install --dev |
| 59 | + GOTO :EOF |
| 60 | + |
| 61 | +:build |
| 62 | + pipenv run python3 setup.py sdist bdist_wheel --universal |
| 63 | + GOTO :EOF |
| 64 | + |
| 65 | +:local-install |
| 66 | + pipenv run pip3 install -e . |
| 67 | + GOTO :EOF |
| 68 | + |
| 69 | +:style |
| 70 | + CALL make.bat format |
| 71 | + CALL make.bat lint |
| 72 | + GOTO :EOF |
| 73 | + |
| 74 | +:format |
| 75 | + @ black src/mapillary |
| 76 | + @ black tests/ |
| 77 | + GOTO :EOF |
| 78 | + |
| 79 | +:lint |
| 80 | + @ |
| 81 | + @ flake8 src/mapillary --count --select=E9,F63,F7,F82 --show-source --statistics |
| 82 | + @ flake8 tests/ --count --select=E9,F63,F7,F82 --show-source --statistics |
| 83 | + GOTO :EOF |
| 84 | + |
| 85 | +:docs-gen |
| 86 | + CALL make.bat docs-sphinx |
| 87 | + CALL make.bat docs-py |
| 88 | + CALL make.bat docs-start |
| 89 | + GOTO :EOF |
| 90 | + |
| 91 | +:docs-sphinx |
| 92 | + sphinx-apidoc -o sphinx-docs ./src/ sphinx-apidoc --full -A 'Mapillary'; cd sphinx-docs; echo "$$PYTHON_SCRIPT" >> conf.py; make markdown; |
| 93 | + GOTO :EOF |
| 94 | + |
| 95 | +:docs-py |
| 96 | + python3 scripts/documentation.py |
| 97 | + GOTO :EOF |
| 98 | + |
| 99 | +:docs-start |
| 100 | + PUSHD docs; npm run start; && POPD |
| 101 | + GOTO :EOF |
| 102 | + |
| 103 | +:docs-push |
| 104 | + CALL make.bat docs-build |
| 105 | + CALL make.bat docs-deploy |
| 106 | + GOTO :EOF |
| 107 | + |
| 108 | +:docs-build |
| 109 | + PUSHD docs; npm run build; && POPD |
| 110 | + GOTO :EOF |
| 111 | + |
| 112 | +:docs-deploy |
| 113 | + PUSHD docs; GIT_USER=Rubix982 yarn deploy; && POPD |
| 114 | + GOTO :EOF |
| 115 | + |
| 116 | +:clean |
| 117 | + CALL make.bat sphinx-docs-clean |
| 118 | + CALL make.bat docs-clean |
| 119 | + CALL make.bat build-clean |
| 120 | + CALL make.bat dump-clean |
| 121 | + GOTO :EOF |
| 122 | + |
| 123 | +:sphinx-docs-clean |
| 124 | + DEL /Q sphinx-docs/ -rf |
| 125 | + GOTO :EOF |
| 126 | + |
| 127 | +:docs-clean |
| 128 | + DEL /Q docs/build -rf |
| 129 | + GOTO :EOF |
| 130 | + |
| 131 | +:build-clean |
| 132 | + DEL /Q build/ dist/ -rf |
| 133 | + GOTO :EOF |
| 134 | + |
| 135 | +:dump-clean |
| 136 | + DEL /Q tests/dump/ -rf |
| 137 | + GOTO :EOF |
| 138 | + |
| 139 | +:test |
| 140 | + @ pytest --log-cli-level=20 |
| 141 | + GOTO :EOF |
| 142 | + |
| 143 | +:test-no-warn |
| 144 | + @ pytest --log-cli-level=20 --disable-warnings |
| 145 | + GOTO :EOF |
| 146 | + |
| 147 | +:error |
| 148 | + IF "%1"=="" ( |
| 149 | + ECHO make: *** No targets specified and no makefile found. Stop. |
| 150 | + ) ELSE ( |
| 151 | + ECHO make: *** No rule to make target '%1%'. Stop. |
| 152 | + ) |
| 153 | + GOTO :EOF |
0 commit comments