-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.bat
73 lines (59 loc) · 1.74 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
@echo off
if exist "%JAVA_HOME%" (
echo Java Path: %JAVA_HOME%
echo Java Version:
java -version
)
if exist "%E3_HOME%" (
echo Maven Path: %E3_HOME%
echo Maven Version:
call mvn -version
)
set "skipTests="
:targetProfile
echo Please choose Profile. 1: Development, 2: Test, 3: Staging, 4: Production, 0: Exit
set /p selectProfile=Please press the above numbers to enter the options and press Enter to confirm:
if /i "%selectProfile%"=="" goto prod
if /i "%selectProfile%"=="1" goto dev
if /i "%selectProfile%"=="2" goto test
if /i "%selectProfile%"=="3" goto staging
if /i "%selectProfile%"=="4" goto prod
if /i "%selectProfile%"=="0" exit
:dev
echo Development environment selected
set "profile=dev"
goto targetTests
:test
echo Test environment selected
set "profile=test"
goto targetTests
:pre
echo Staging environment selected
set "profile=staging"
goto targetTests
:prod
echo Production environment selected
set "profile=prod"
goto targetTests
:targetTests
echo Please choose whether to skip the test before building. Y: Yes, N: No
set /p skipTests=Please press the above numbers to enter the options and press Enter to confirm:
if /i "%skipTests%"=="" goto skipTests
if /i "%skipTests%"=="Y" goto skipTests
if /i "%skipTests%"=="y" goto skipTests
if /i "%skipTests%"=="N" goto doTests
if /i "%skipTests%"=="n" goto doTests
:skipTests
echo Test skip selected
set "skipTests=-DskipTests=true"
goto build
:doTests
echo Test exec selected
set "skipTests="
goto build
:build
echo Start building, please wait. . . . . .
echo Command: mvn clean package -e -P %profile% %skipTests%
call mvn clean compile package -e -P %profile% %skipTests%
echo.&echo The build is complete, you can copy executable program from %cd%/target, press any key to exit &pause>nul
exit