@echo off
title=HYTradingGateway自動化編譯打包工具
mode con cols=80 lines=40
echo -------------------------------------------------------------
echo 使用說明
echo.
echo HYTradingGateway自動化編譯打包工具、修改
echo 使用前提:
echo 1、安裝VS2008
echo 2、安裝好壓
echo 3、ReleaseHYTradingGateway.bat路徑修改
echo.
echo 1、版本發布前刪除debug下所有的,臨時文件,具體類型如下
echo *.aps *.idb *.ncp *.obj *.pch *.sbr *.tmp *.pdb *.bsc
echo *.ilk *.res *.ncb *.opt *.suo *.manifest *.dep *.htm
echo.
echo 2、版本發布前刪除所有bin目錄下的*.pdb *.ilk *.dll *.exe文件
echo.
echo 3、HYTradingGateway項目編譯,一共包含21個子項目
echo.
echo 4、編譯後進行打包,並存放到Release\HYTradingGateway目錄下
echo.
echo 5、發布版本者將文件上傳svn就可以自動完成整個發布過程
echo.
echo 6、支持打包後文件定位
echo.
echo 7、目前不支持svn自動上傳、補丁命名,後續完善
echo.
echo Visual c++ 2008
echo.
echo shaoming 2012-04-13
echo -----------------------------------------------------------
pause
mode con cols=120 lines=60
color 8A
cls
echo -----------------------------------------------------------
echo 開始清除無效文件
del /F /Q /S *.aps *.idb *.ncp *.obj *.pch *.sbr *.tmp *.pdb *.bsc *.ilk *.res *.ncb *.opt *.suo *.manifest *.dep *.htm
SET VSCMD=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv
SET ProjectCMD="F:\HyCode\HYTradingGateway
del /F /Q /S %ProjectCMD%\bin\*.pdb
del /F /Q /S %ProjectCMD%\bin\*.ilk
del /F /Q /S %ProjectCMD%\bin\unipackage*.dll
del /F /Q /S %ProjectCMD%\bin\tools.dll
del /F /Q /S %ProjectCMD%\bin\activemqTool.dll
del /F /Q /S %ProjectCMD%\bin\sqliteTool.dll
del /F /Q /S %ProjectCMD%\bin\MJSExchangeAPI.dll
del /F /Q /S %ProjectCMD%\bin\SJSExchangeAPI.dll
del /F /Q /S %ProjectCMD%\bin\*.exe
echo 清除無效文件完成
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo 開始編譯HYTradingGateway
"%VSCMD%" %ProjectCMD%\tools\tools.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\activemqTool\activemqTool.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\sqliteTool\sqliteTool.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\MJSExchangeAPI\MJSExchangeAPI.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\SJSExchangeAPI\SJSExchangeAPI.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_base\unipackage_base.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_cffex\unipackage_cffex.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_ctp\unipackage_ctp.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_czce\unipackage_czce.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_dce\unipackage_dce.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_ib\unipackage_ib.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_mjs\unipackage_mjs.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_shfe\unipackage_shfe.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_szse\unipackage_szse.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage\unipackage.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackageBank_base\unipackageBank_base.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_boc\unipackage_boc.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackage_bbc\unipackage_bbc.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\unipackageBank\unipackageBank.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\HYTradingGateway\HYTradingGateway.sln" /Rebuild
"%VSCMD%" %ProjectCMD%\TestTrade\TestTrade.sln" /Rebuild
del /F /Q /S %ProjectCMD%\bin\*.pdb
del /F /Q /S %ProjectCMD%\bin\*.ilk
echo 編譯HYTradingGateway完成
echo -----------------------------------------------------------
echo -----------------------------------------------------------
echo 開始HYTradingGateway打包
Xcopy %ProjectCMD%\\bin" "E:\HYTradingGateway\bin\" /e /s /h /d /c /y
Xcopy %ProjectCMD%\\config" "E:\HYTradingGateway\config\" /e /s /h /d /c /y
rd /S /Q E:\HYTradingGateway\config\.svn
del /F /Q /S E:\HYTradingGateway\bin\*.txt
del /F /Q /S E:\HYTradingGateway\bin\*.lib
del /F /Q /S E:\HYTradingGateway\bin\*.dat
SET zipCMD=C:\Program Files\HaoZip
"%zipCMD%\HaoZipC.exe" -r -tzip a E:\HYTradingGateway-�te:~0,10%.zip E:\HYTradingGateway
copy "E:\HYTradingGateway-�te:~0,10%.zip" "F:\Release\HYTradingGateway\"
echo HYTradingGateway打包完成
echo -----------------------------------------------------------
echo 自動打開打包後存放文件夾
start "HYTradingGateway自動化編譯打包工具" "F:\Release\HYTradingGateway"
pause