-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathpackage.bat
51 lines (40 loc) · 1.35 KB
/
package.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
@echo off
@rem 设置环境变量
set JAVA_HOME=%JAVA_HOME%
@rem 设置文件目录
set dirs=brfs\bin,brfs\jar,brfs\config,brfs\logs,brfs\lib
@rem 设置当前路径
set baseDir=%~dp0
set version=%date:~0,4%%date:~5,2%%date:~8,2%
set keyword="Last Changed Rev"
@rem 设置需要打包的模块
set modules=FS_Client,FS_Server
@rem 初始项目的目录结构
rd /s /q brfs
for %%i in (%dirs%) do (
if exist %baseDir%%%i (
echo dir '%%i' already exist.
) else (
md %%i
if "%%i" == "brfs\jar" (
for %%n in (%modules%) do md %%i\%%n
)
echo dir '%%i' not exist, create it.
)
)
@rem 工程里生成版本号文件
for %%i in (%modules%) do if exist %%i\src\main\resources\ver_*.txt del /s /q %%i\src\main\resources\ver_*.txt
@rem maven打包
call mvn clean package -Dmaven.test.skip=true
@rem 删除工程里版本号文件
for %%i in (%modules%) do if exist %%i\src\main\resources\ver_*.txt del /s /q %%i\src\main\resources\ver_*.txt
@rem 复制程序jar,配置文件,启动脚本,版本文件
for %%i in (%modules%) do copy %%i\target\%%i.jar brfs\jar\%%i\
copy config\*.* brfs\config\
copy bin\*.* brfs\bin\
copy lib\*.* brfs\lib\
copy release\*.* brfs\
echo %version% > brfs\ver_%version%.txt
@rem 打zip包
for %%i in (%modules%) do 7z.exe a -tzip brfs\zip\%%i.zip %baseDir%\brfs\jar\%%i\* %baseDir%\brfs\readme.txt %baseDir%\brfs\release-notes.txt
pause