このブログを検索

2015-05-14

Visual Studio コマンドラインビルドのメモ

rebuild

@echo off

set DEVENV="C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe"
set SOLNAME=xxxx
echo rebuild.bat run
rmdir /S /Q ..\build
pause
mkdir ..\build
type nul > ..\build\dummy
pause
%DEVENV% ..\source\%SOLNAME% /build release
copy ..\source\bin\Release\* ..\build\.
del ..\build\*.xml
pause



release

@echo off
echo release.bat run
rmdir /S /Q ..\release
mkdir ..\release
mkdir ..\release\tmp
copy ..\build\* ..\release\tmp\.
copy ..\*.txt ..\release\tmp\.
del ..\release\tmp\dummy
zip.exe ..\release\xxxx.zip ..\release\tmp\* -j
pause



関係ないけどバッチファイルのサンプル
set past=3
set tempfile=quebak.tmp
set logname=quebak.log
cd > %tempfile%
set /p curdir=< %tempfile%
set temp=%curdir:~3,1%
if defined temp set curdir=%curdir%\
set tempfile=%curdir%%tempfile%
set logfile=%curdir%%logname%
set today=%date:~0,4%%date:~5,2%%date:~8,2%
echo WScript.Echo DateAdd("d",-%past%,"%date% %time:~0,8%")> dateadd.vbs
for /f "delims=" %%X in ('cscript //nologo dateadd.vbs') do set pastday=%%X
set pastday=%pastday:~0,4%%pastday:~5,2%%pastday:~8,2%
set dirdate=query_%today%
echo.>> "%logfile%"
echo -------------------------------->> "%logfile%"
echo %date% %time%>> "%logfile%"
%dirbak:~0,2%
cd %dirbak%

0 件のコメント:

コメントを投稿