Skip to content

Commit

Permalink
docker中关闭裁剪防止镜像出错
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoonlight committed Aug 18, 2024
1 parent fbe8013 commit 2b1f384
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 36 deletions.
4 changes: 2 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ steps:
command: 'publish'
publishWebProjects: false
projects: './src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj'
arguments: ' --output $(System.DefaultWorkingDirectory)/build/nspserver'
arguments: ' --output $(System.DefaultWorkingDirectory)/build/nspserver /p:PublishTrimmed=false'
workingDirectory: '$(System.DefaultWorkingDirectory)/'
zipAfterPublish: false

Expand All @@ -59,7 +59,7 @@ steps:
command: 'publish'
publishWebProjects: false
projects: './src/NSmartProxyClient/NSmartProxyClient.csproj'
arguments: ' --output $(System.DefaultWorkingDirectory)/build/nspclient'
arguments: ' --output $(System.DefaultWorkingDirectory)/build/nspclient /p:PublishTrimmed=false'
workingDirectory: '$(System.DefaultWorkingDirectory)/'
zipAfterPublish: false

Expand Down
2 changes: 1 addition & 1 deletion src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>

<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions src/NSmartProxyClient/NSmartProxyClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<PublishTrimmed>true</PublishTrimmed>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
68 changes: 35 additions & 33 deletions src/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rem NSP v1.4.1
@ECHO on

set Ver=v1.4.1
set BuildPath=%~dp0../build
set BuildPath=%~dp0/build

set nsp_client_path=%BuildPath%/nspclient_unity_%Ver%
set nsp_server_path=%BuildPath%/nspserver_unity_%Ver%
Expand All @@ -23,55 +23,57 @@ set nsp_server_scd_win_arm_path=%BuildPath%/nspserver_scd_win_arm_%Ver%

set nsp_client_winfform_path=%BuildPath%/nspclient_winform_%Ver%

rem del %~dp0/../build/*.*
rem 删除nsp_client和nsp_server相关的pdb文件
powershell del %nsp_client_path%\*.pdb
powershell del %nsp_server_path%\*.pdb

rem NSPClient
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path% /p:PublishTrimmed=false
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path% /p:DebugType=None /p:PublishTrimmed=true

rem NSPServer
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c release -o %nsp_server_path% /p:PublishTrimmed=false
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c release -o %nsp_server_path% /p:DebugType=None /p:PublishTrimmed=true

rem NSPClient_SCD
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-x64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_linux_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r win-x64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_win_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r osx-x64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_osx_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r osx-arm64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_osx_arm_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-arm -c Release /p:PublishSingleFile=true -o %nsp_client_scd_linux_arm_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r win-arm64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_win_arm_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_linux_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r win-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_win_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r osx-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_osx_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r osx-arm64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_osx_arm_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-arm -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_linux_arm_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r win-arm64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_client_scd_win_arm_path%

rem NSPServer_SCD
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r linux-x64 -c Release /p:PublishSingleFile=true -o %nsp_server_scd_linux_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r win-x64 -c Release /p:PublishSingleFile=true -o %nsp_server_scd_win_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r osx-x64 -c Release /p:PublishSingleFile=true -o %nsp_server_scd_osx_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r osx-arm64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_osx_arm_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r linux-arm -c Release /p:PublishSingleFile=true -o %nsp_server_scd_linux_arm_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r win-arm64 -c Release /p:PublishSingleFile=true -o %nsp_server_scd_win_arm_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r linux-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_linux_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r win-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_win_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r osx-x64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_osx_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r osx-arm64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_osx_arm_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r linux-arm -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_linux_arm_path%
dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -r win-arm64 -c Release /p:PublishSingleFile=true /p:DebugType=None /p:PublishTrimmed=true -o %nsp_server_scd_win_arm_path%

rem NSPWinform
MSBuild .\NSmartProxyWinform\NSmartProxyWinform.csproj /t:build /p:OutDir=%nsp_client_winfform_path%
powershell del %nsp_client_winfform_path%/*.pdb
powershell del %nsp_client_winfform_path%/*.xml
powershell del %nsp_client_winfform_path%\*.pdb
powershell del %nsp_client_winfform_path%\*.xml

rem ilmerge
rem ruined :<

rem compress
powershell Compress-Archive -Path '%nsp_client_path%/*' -DestinationPath '%nsp_client_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_path%/*' -DestinationPath '%nsp_server_path%.zip' -Force

powershell Compress-Archive -Path '%nsp_client_scd_linux_path%/*' -DestinationPath '%nsp_client_scd_linux_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_win_path%/*' -DestinationPath '%nsp_client_scd_win_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_osx_path%/*' -DestinationPath '%nsp_client_scd_osx_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_linux_arm_path%/*' -DestinationPath '%nsp_client_scd_linux_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_win_arm_path%/*' -DestinationPath '%nsp_client_scd_win_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_path%/' -DestinationPath '%nsp_client_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_path%/' -DestinationPath '%nsp_server_path%.zip' -Force

powershell Compress-Archive -Path '%nsp_server_scd_linux_path%/*' -DestinationPath '%nsp_server_scd_linux_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_win_path%/*' -DestinationPath '%nsp_server_scd_win_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_osx_path%/*' -DestinationPath '%nsp_server_scd_osx_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_linux_arm_path%/*' -DestinationPath '%nsp_server_scd_linux_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_win_arm_path%/*' -DestinationPath '%nsp_server_scd_win_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_linux_path%/' -DestinationPath '%nsp_client_scd_linux_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_win_path%/' -DestinationPath '%nsp_client_scd_win_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_osx_path%/' -DestinationPath '%nsp_client_scd_osx_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_linux_arm_path%/' -DestinationPath '%nsp_client_scd_linux_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_scd_win_arm_path%/*' -DestinationPath '%nsp_client_scd_win_arm_path%.zip' -Force

powershell Compress-Archive -Path '%nsp_server_scd_linux_path%/' -DestinationPath '%nsp_server_scd_linux_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_win_path%/' -DestinationPath '%nsp_server_scd_win_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_osx_path%/' -DestinationPath '%nsp_server_scd_osx_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_linux_arm_path%/' -DestinationPath '%nsp_server_scd_linux_arm_path%.zip' -Force
powershell Compress-Archive -Path '%nsp_server_scd_win_arm_path%/*' -DestinationPath '%nsp_server_scd_win_arm_path%.zip' -Force

powershell Compress-Archive -Path '%nsp_client_winfform_path%/*' -DestinationPath '%BuildPath%/nspclient_winform_%Ver%.zip' -Force
powershell Compress-Archive -Path '%nsp_client_winfform_path%/*' -DestinationPath '%BuildPath%/nspclient_winform_%Ver%.zip' -Force

powershell explorer %~dp0..\build
powershell explorer %~dp0\build
pause

0 comments on commit 2b1f384

Please sign in to comment.