|
@@ -1,17 +1,17 @@
|
|
|
@echo off
|
|
|
|
|
|
-::启用变量延迟
|
|
|
+::enable delayed arguments
|
|
|
setlocal EnableDelayedExpansion
|
|
|
|
|
|
|
|
|
-::(x.1)获取basePath
|
|
|
+:: #1 get basePath
|
|
|
set curPath=%cd%
|
|
|
cd /d "%~dp0"
|
|
|
cd /d ../../..
|
|
|
set basePath=%cd%
|
|
|
|
|
|
|
|
|
-::(x.2)获取netVersion
|
|
|
+:: #2 get netVersion
|
|
|
set netVersion=net6.0
|
|
|
for /f "tokens=3 delims=><" %%a in ('type %basePath%\dotnet\ServiceCenter\App.ServiceCenter\App.ServiceCenter.csproj^|findstr "<TargetFramework>.*TargetFramework"') do set netVersion=%%a
|
|
|
|
|
@@ -22,7 +22,7 @@ echo dotnet version: %netVersion%
|
|
|
|
|
|
|
|
|
|
|
|
-::(x.3)查找所有需要发布的项目并发布
|
|
|
+:: #3 find projects and publish
|
|
|
for /f "delims=" %%f in ('findstr /M /s /i "<publish>" *.csproj') do (
|
|
|
::get name
|
|
|
for /f "tokens=3 delims=><" %%a in ('type "%basePath%\%%f"^|findstr "<publish>.*publish"') do set name=%%a
|
|
@@ -32,7 +32,7 @@ for /f "delims=" %%f in ('findstr /M /s /i "<publish>" *.csproj') do (
|
|
|
cd /d "%basePath%\%%f\.."
|
|
|
dotnet build --configuration Release
|
|
|
dotnet publish --configuration Release --output "%publishPath%\!name!"
|
|
|
- @if errorlevel 1 (echo . & echo . & echo 出错,请排查!& pause)
|
|
|
+ @if errorlevel 1 (echo . & echo . & echo error & pause)
|
|
|
|
|
|
::copy xml
|
|
|
xcopy "bin\Release\%netVersion%\*.xml" "%publishPath%\!name!" /i /r /y
|
|
@@ -40,12 +40,12 @@ for /f "delims=" %%f in ('findstr /M /s /i "<publish>" *.csproj') do (
|
|
|
|
|
|
|
|
|
|
|
|
-::(x.4)copy dir
|
|
|
+:: #4 copy dir
|
|
|
xcopy "%basePath%\Publish\ReleaseFile\Station" "%publishPath%" /e /i /r /y
|
|
|
|
|
|
|
|
|
|
|
|
-::(x.5)copy ServiceCenter
|
|
|
+:: #5 copy ServiceCenter
|
|
|
xcopy "%publishPath%\ServiceCenter" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)\ServiceCenter" /e /i /r /y
|
|
|
xcopy "%publishPath%\01.ServiceCenter.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
|
|
|
xcopy "%publishPath%\01.Start-4580.bat" "%basePath%\Publish\release\release\ServiceCenter(%netVersion%)"
|
|
@@ -53,6 +53,5 @@ xcopy "%publishPath%\01.Start-4580.bat" "%basePath%\Publish\release\release\Serv
|
|
|
|
|
|
|
|
|
|
|
|
-echo %~n0.bat 执行成功!
|
|
|
-
|
|
|
+echo %~n0.bat success
|
|
|
cd /d "%curPath%"
|