本文主要是介绍DOS工具: 自动从VSS获取并编译,复制,上传,打包的工具 new,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
echo off
@cls
@color
rem -- ======================================
rem -- DESCRIPTION: <自動_VSS管理バッチ 2.0>
rem -- AUTHOR: <>
rem -- CREATE DATE: <2010/12/27>
rem -- UPDATE DATE: <2011/08/22>
rem -- =======================================
rem ----------------------------
rem Local Folder Name
rem ----------------------------
@set local_forder_name=Src
rem ----------------------------
rem Vss_username
rem ----------------------------
@set vss_username=fanhui
rem ----------------------------
rem Vss_password
rem ----------------------------
@set vss_password=fanhui
rem ----------------------------
rem Local Dirver
rem ----------------------------
@set local_dirver=F:\
rem ----------------------------
rem Vss_server
rem ----------------------------
@set Vss_server=\\kdc-hs-022\project02$
rem ----------------------------
rem Vss_project_path
rem ----------------------------
@set vss_project_path="$/10 DPM/Src"
rem ----------------------------
rem vss_flag(1:on, 0:off)
rem vss サーバから最新のバージョンを取得
rem ----------------------------
@set vss_flag=1
rem ----------------------------
rem build_flag(1:on, 0:off)
rem 自動のビルドを行う
rem ----------------------------
@set build_flag=1
rem ----------------------------
rem 納品_flag(1:on, 0:off)
rem 不要なファイルを除くことができる
rem ----------------------------
@set order_flag=1
rem ----------------------------
rem RAR_flag(1:on, 0:off)
rem rarタイプで梱包することができる
rem ----------------------------
@set rar_flag=1
rem ----------------------------
rem Vss_install_path
rem ----------------------------
@set vss_install_path=C:\Program Files\Microsoft Visual SourceSafe
rem ----------------------------
rem .net_install_path
rem ----------------------------
@set net_install_path=C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
rem ----------------------------
rem .rar_install_path
rem ----------------------------
@set rar_install_path=C:\Program Files\WinRAR
rem ----------------------------
rem Local log Name
rem ----------------------------
@set local_logfile_name=build.log
@set path=%path%;%vss_install_path%
@set ssdir=%Vss_server%
@set ssuser=%Vss_username%
@set sspwd=%Vss_password%
@if %vss_flag% EQU 1 goto do_vss
@if %build_flag% EQU 1 goto do_build
@goto do_order
@:do_vss
@echo ----------------------------
@echo do vss
@echo ----------------------------
@if not exist %local_forder_name% (md %local_dirver%%local_forder_name%)
@echo -- ========================
@echo get files from vss
@echo -- ========================
@ss workfold %vss_project_path% %local_dirver%%local_forder_name%
@ss get -GL%local_dirver%%local_forder_name% %vss_project_path% -R -W -I-
@if %build_flag% EQU 1 goto do_build
@goto do_order
@:do_build
@set str=0
@echo ----------------------------
@echo do build
@echo ----------------------------
@echo -- =========================
@echo build starting
@echo -- ==========================
@set path=%path%;%net_install_path%
@if exist %local_dirver%%local_logfile_name% (del %local_dirver%%local_logfile_name%)
@for /r %local_dirver%%local_forder_name%\. %%a in (*.sln) do @(
@if exist %%a @devenv /build release %%a >>%local_dirver%%local_logfile_name%
@if errorlevel 1 call :error %%a
)
@if %str% EQU 1 goto end
@del %local_dirver%%local_logfile_name%
@echo -- =========================
@echo build success
@echo -- =========================
@goto do_order
@:error
@set str=1
@color 4f
@echo -- =========================
@echo ビルド失敗【%1】
@echo ⇒ %local_dirver%%local_forder_name%\%local_logfile_name% を参照してください
@echo -- =========================
@goto :eof
@:do_order
@if %order_flag% NEQ 1 goto do_rar
@echo ----------------------------
@echo do order
@echo ----------------------------
@for /r %local_dirver%%local_forder_name%\. %%a in (bin,obj) do @if exist %%a rd /q/s "%%a"
@for /r %local_dirver%%local_forder_name%\. %%a in (*.scc,*.vspscc,*.vssscc) do @if exist %%a del /q/s/f "%%a"
@for /r %local_dirver%%local_forder_name%\. %%a in (*.sln,*.vbproj) do @if exist %%a VssSeparator "%%a"
@goto do_rar
@:do_rar
@if %rar_flag% NEQ 1 goto end
@echo ----------------------------
@echo do rar
@echo ----------------------------
@SET YY=%date:~0,4%
@SET MM=%date:~5,2%
@SET DD=%date:~8,2%
@if exist %local_dirver%%YY%%MM%%DD% (rd /q/s %local_dirver%%YY%%MM%%DD%)
@md %local_dirver%%YY%%MM%%DD%
@set path=%path%;%rar_install_path%
%local_dirver:~0,2%
CD %local_dirver%%local_forder_name%
rar a %local_dirver%%local_forder_name% -r
move %local_dirver%%local_forder_name%.rar %local_dirver%%YY%%MM%%DD%
cd \
@if exist %local_dirver%%local_forder_name% (rd /q/s %local_dirver%%local_forder_name%)
@color 2f
@echo -- =========================
@echo rar success
@echo -- =========================
@echo //
@echo 全て処理終了
@echo 作成者: 2010/12 Create 1.0
@echo 2011/08 Update 2.0
@echo //
@:end
@pause
@goto :eof
这篇关于DOS工具: 自动从VSS获取并编译,复制,上传,打包的工具 new的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!