forked from roam-qgis/Roam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
89 lines (74 loc) · 2.16 KB
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
@ECHO OFF
REM ---------------------------------------------------------------------------------------
REM Script to build the resource and UI files. You only really need to run this if you are
REM running from source.
REM Change %OSGEO4W_ROOT% in setenv.bat to change the location of QGIS, if necessary.
REM ---------------------------------------------------------------------------------------
IF /I NOT "%~1"=="help" CALL scripts\setenv.bat
IF "%~1"=="" GOTO build
GOTO %1
:build
IF EXIST build RMDIR /q /s build & ECHO Removing existing build folder..
ECHO Installing requirements..
python -m pip install -r requirements.txt
ECHO Building application..
python setup.py build
IF /I "%~1"=="release" GOTO zip
GOTO END
:zip
IF NOT EXIST release MKDIR release
IF EXIST release\*.zip DEL release\*.zip /Q /F & ECHO Removing existing zip files..
ECHO Building zip file..
SET NAME=%~2
python -m zipfile -c "release\Roam%NAME%.zip" "build\Roam"
IF /I "%~1"=="release" GOTO installer
GOTO END
:installer
IF NOT EXIST %INSTALLER% ECHO [101m Installer build failed - installer could not be located [0m & GOTO END
IF NOT EXIST release MKDIR release
IF EXIST release\*.exe DEL release\*.exe /Q /F & ECHO Removing existing installers..
ECHO Building installer...
SET NAME=%~2
%INSTALLER%\iscc /F"Roam%NAME% Installer" "scripts\installer\roam-installer.iss"
IF /I "%~1"=="release" ECHO Build complete and zip file and installer created
GOTO END
:release
ECHO Running complete build..
GOTO build
:test
@ECHO ON
ECHO Running tests
pytest --cov=src\roam src\roam_tests --cov-report html --cov-report term
GOTO END
:test-only
ECHO Running tests
pytest src\roam_tests
GOTO END
:design
ECHO Opening designer
START designer.exe
GOTO END
:watch
python scripts\watchui.py
EXIT
:api-docs
pdoc .\src\roam\ .\src\configmanager\ -o .\docs
GOTO END
:help
ECHO ===========================
ECHO OPTIONS
ECHO ===========================
ECHO build
ECHO build zip
ECHO build installer
ECHO build release
ECHO build test
ECHO build test-only
ECHO build design
ECHO build watch
ECHO build api-docs
ECHO.
ECHO For zip, installer and release, version details can be added
ECHO eg. build installer " 3.0"
GOTO END
:END