2015-12-05 22:40:30 +03:00
|
|
|
@echo OFF
|
|
|
|
::
|
|
|
|
:: Post-build auto-deploy script
|
|
|
|
:: Create and fill PublishPath_mp.txt file with path to deployment folder
|
|
|
|
:: I.e. PublishPath_mp.txt should contain one line with a folder path
|
|
|
|
:: Call it so:
|
2016-12-06 22:21:52 +03:00
|
|
|
:: IF EXIST "$(ProjectDir)PostBuild_mp.bat" (CALL "$(ProjectDir)PostBuild_mp.bat" "$(TargetDir)" "$(TargetName)" "$(TargetExt)" "$(ProjectDir)")
|
2015-12-05 22:40:30 +03:00
|
|
|
::
|
|
|
|
|
|
|
|
SET targetDir=%~1
|
2016-12-06 22:21:52 +03:00
|
|
|
SET targetDirPlay=%targetDir:Play=%
|
|
|
|
|
2015-12-05 22:40:30 +03:00
|
|
|
SET targetName=%~2
|
|
|
|
SET targetExt=%~3
|
|
|
|
SET projectDir=%~4
|
2016-12-06 22:21:52 +03:00
|
|
|
SET destination=PublishPath_mp
|
|
|
|
|
|
|
|
IF NOT "%targetDir%"=="%targetDirPlay%" (
|
|
|
|
SET destination=PublishPath_mp_play
|
|
|
|
)
|
2015-12-05 22:40:30 +03:00
|
|
|
|
2016-12-06 22:21:52 +03:00
|
|
|
IF NOT EXIST "%projectDir%\%destination%.txt" (
|
|
|
|
ECHO No deployment path specified. Create %destination%.txt near PostBuild_mp.bat with paths on separate lines for auto deployment.
|
2015-12-05 22:40:30 +03:00
|
|
|
exit /B 0
|
|
|
|
)
|
|
|
|
|
2016-12-06 22:21:52 +03:00
|
|
|
FOR /f "tokens=* delims= usebackq" %%a IN ("%projectDir%\%destination%.txt") DO (
|
2015-12-05 22:40:30 +03:00
|
|
|
ECHO Deploying to: %%a
|
|
|
|
IF NOT "%%a" == "" (
|
|
|
|
copy /Y "%targetDir%%targetName%%targetExt%" "%%a"
|
|
|
|
IF NOT ERRORLEVEL 1 (
|
|
|
|
IF EXIST "%targetDir%%targetName%.pdb" (
|
|
|
|
copy /Y "%targetDir%%targetName%.pdb" "%%a"
|
|
|
|
)
|
|
|
|
) ELSE (
|
2016-12-06 22:21:52 +03:00
|
|
|
ECHO PostBuild_mp.bat ^(27^) : warning : Can't copy '%targetName%%targetExt%' to deploy path '%%a'
|
2015-12-05 22:40:30 +03:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
IF "%%a" == "" (
|
|
|
|
ECHO No deployment path specified.
|
|
|
|
)
|
|
|
|
|
|
|
|
exit /B 0
|