This repository has been archived by the owner on Apr 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuildRelease.bat
81 lines (64 loc) · 1.67 KB
/
buildRelease.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
@ECHO OFF
CALL updateVersion
IF %ERRORLEVEL% GEQ 1 (
ECHO Updating the version of the project failed. Exiting.
PAUSE
EXIT 1
)
:REFRESH_VENDORS
ECHO Should vendors be refreshed?
SET /P CONFIRM_REFRESH_VENDORS="(Y/N): "
IF /I "%CONFIRM_REFRESH_VENDORS%" EQU "Y" (
CALL refreshVendors
IF %ERRORLEVEL% GEQ 1 (
ECHO Refreshing the vendors of the project failed. Exiting.
PAUSE
EXIT 2
)
)
IF /I "%CONFIRM_REFRESH_VENDORS%" NEQ "N" (
IF /I "%CONFIRM_REFRESH_VENDORS%" NEQ "Y" (
ECHO Unexpected input (Expected "Y" or "N"^)!
GOTO REFRESH_VENDORS
)
)
CALL runTests
IF %ERRORLEVEL% GEQ 1 (
ECHO Tests failed to complete. Exiting.
PAUSE
EXIT 3
)
IF NOT EXIST build_template.zip (
ECHO No build template exists, make sure to run refreshVendors at least once!
PAUSE
EXIT 4
)
SET /P VERSION=<VERSION.txt
SET BUILD_ARCHIVE=Sycamore-%VERSION%.zip
WHERE 7Z >nul 2>nul
IF %ERRORLEVEL% EQU 0 ( GOTO 7Z_METHOD )
WHERE WZZIP >nul 2>nul
IF %ERRORLEVEL% EQU 0 ( GOTO WZZIP_METHOD )
WHERE ZIP >nul 2>nul
IF %ERRORLEVEL% EQU 0 ( GOTO ZIP_METHOD )
ECHO No zipping utility was found for building, please add one to your environment variable 'PATH'.
PAUSE
EXIT 5
:ZIP_METHOD
ECHO Building project zip...
ECHO NOT YET IMPLEMENTED FOR ZIP!
PAUSE
EXIT 99
:7Z_METHOD
ECHO Building project zip...
COPY /Y "build_template.zip" %BUILD_ARCHIVE%
7Z a -r -y -tzip %BUILD_ARCHIVE% "LICENSE.txt" "VERSION.txt" "global.php" "public\*.php" "src\*.php" "config\*.php"
CD VENDOR-PATCH
7Z a -r -y -tzip "../%BUILD_ARCHIVE%" "*.php"
PAUSE
EXIT 0
:WZZIP_METHOD
ECHO Building project zip...
ECHO NOT YET IMPLEMENTED FOR WINZIP!
PAUSE
EXIT 99