-
Notifications
You must be signed in to change notification settings - Fork 299
/
build.cmd
94 lines (80 loc) · 2.07 KB
/
build.cmd
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
90
91
92
93
94
@echo off
set WORK_ROOT=%cd%
set SOURCE_ROOT=%~dp0
set dev=0
set build_addon=0
set USE_VENDER_DIST=
set new_args=
set i=0
for %%a in (%*) do (
if "%%a"=="dev" (
set dev=1
set build_addon=1
) else if "%%a"=="ci" (
set USE_VENDER_DIST=1
set build_addon=1
) else (
set new_args=%new_args% %%a
set /a i+=1
)
)
set args_count=0
for /f %%a in ('set new_args[ 2^>nul ^| find /c "="') do set args_count=%%a
if %dev%==0 (
set USE_VENDER_DIST=1
git submodule update --init --recursive
)
if "%USE_VENDER_DIST%" == "" (
if exist "%SOURCE_ROOT%/vender/build.cmd" (
cd /d "%SOURCE_ROOT%/vender"
call build %new_args%
if ERRORLEVEL 1 goto exitbuild
) else goto inform
)
cd /d "%SOURCE_ROOT%/fibjs"
call build %new_args%
if ERRORLEVEL 1 goto exitbuild
cd /d "%SOURCE_ROOT%/fibjs/program"
call build %new_args%
if ERRORLEVEL 1 goto exitbuild
if %build_addon%==1 (
cd /d "%SOURCE_ROOT%/fibjs/addons"
call build %new_args%
if ERRORLEVEL 1 goto exitbuild
)
cd /d "%SOURCE_ROOT%/fibjs/installer"
call build %new_args%
if ERRORLEVEL 1 goto exitbuild
cd /d "%SOURCE_ROOT%"
goto finished
:inform
echo.
echo submodule vender is not existed!
echo you can execute the given command to init and update it.
echo \$ git submodule init
echo \$ git submodule update
echo.
:exitbuild
cd /d "%SOURCE_ROOT%"
exit /B 1
:finished
echo.
echo.
cmake -E cmake_echo_color --red ^
" _______ _________ ______ _________ _______ " ^
" ( ____ \\__ __/( ___ \ \__ _/( ____ \ " ^
" | ( \/ ) ( | ( ) ) ) ( | ( \/ " ^
" | (__ | | | (__/ / | | | (_____ " ^
" | __) | | | __ ( | | (_____ ) " ^
" | ( | | | ( \ \ | | ) | " ^
" | (_ ___) (___| (___) )/\_) ) /\____) | " ^
" (__/ \_______/(______/ \____/ \_______) "
echo.
echo.
echo FIBJS has been successfully built.
echo.
echo For more information:
echo website: http://fibjs.org
echo repository: https://github.com/fibjs
echo.
echo.