Skip to content

Commit

Permalink
downgrade to .net 6.0 fix trimmed problem
Browse files Browse the repository at this point in the history
  • Loading branch information
tmoonlight committed Aug 18, 2024
1 parent adcbbdb commit fbe8013
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NSmartProxy.Data/NSmartProxy.Data.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EasyCompressor.Snappier" Version="2.0.2" />
<PackageReference Include="NewtonSoft.Json" Version="13.0.3" />
<PackageReference Include="System.Buffers" Version="4.5.1" />
<PackageReference Include="System.IO.Pipelines" Version="8.0.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
public sealed class NSPVersion
{
public const string NO_TOKEN_STRING = "notoken";
public const string NSmartProxyClientName = "NSmartProxy Client v1.3.7231.7118";
public const string NSmartProxyServerName = "NSmartProxy Server v1.3.7231.7118";
public const string NSmartProxyClientName = "NSmartProxy Client v1.4.8596.1967";
public const string NSmartProxyServerName = "NSmartProxy Server v1.4.8596.1967";
}
4 changes: 2 additions & 2 deletions src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
public sealed class NSPVersion
{
public const string NO_TOKEN_STRING = "notoken";
public const string NSmartProxyClientName = "NSmartProxy Client v1.3.<#=v1#>.<#=v2#>";
public const string NSmartProxyServerName = "NSmartProxy Server v1.3.<#=v1#>.<#=v2#>";
public const string NSmartProxyClientName = "NSmartProxy Client v1.4.<#=v1#>.<#=v2#>";
public const string NSmartProxyServerName = "NSmartProxy Server v1.4.<#=v1#>.<#=v2#>";
}
5 changes: 0 additions & 5 deletions src/NSmartProxy.Infrastructure/StringUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.Text;
using NSmartProxy.Data;
using NSmartProxy.Infrastructure;
using EasyCompressor;
using System.Threading;
using System.Threading.Tasks;
using Snappy.Sharp;
Expand All @@ -16,10 +15,6 @@ namespace NSmartProxy
{
public static class StringUtil
{
//Lazy初始化一个snappier
private static Lazy<SnappierCompressor> _snappyCompressor = new Lazy<SnappierCompressor>(() => SnappierCompressor.Shared);


/// <summary>
/// 整型转双字节
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion src/NSmartProxy.ServerHost/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ENTRYPOINT ["dotnet", "NSmartProxy.ServerHost.dll"]

#need combile 1st.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS runtime
WORKDIR /app
COPY / /app/
EXPOSE 12300-22300
Expand Down
4 changes: 2 additions & 2 deletions src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishTrimmed>True</PublishTrimmed>
<TargetFramework>net6.0</TargetFramework>

</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NSmartProxy/NSmartProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<ApplicationIcon />
<StartupObject />
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NSmartProxyClient/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#need combile 1st.
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS runtime
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS runtime
WORKDIR /app
COPY / /app/
ENTRYPOINT ["dotnet", "NSmartProxyClient.dll"]
4 changes: 2 additions & 2 deletions src/NSmartProxyClient/NSmartProxyClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<PublishTrimmed>True</PublishTrimmed>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -20,6 +19,7 @@
<PackageReference Include="log4net" Version="2.0.17" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="PeterKottas.DotNetCore.WindowsService" Version="2.0.12" />


</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand Down
12 changes: 6 additions & 6 deletions src/build.cmd
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
rem windows only
rem NSP v1.4.0
rem NSP v1.4.1
@ECHO on

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

set nsp_client_path=%BuildPath%/nspclient_%Ver%
set nsp_server_path=%BuildPath%/nspserver_%Ver%
set nsp_client_path=%BuildPath%/nspclient_unity_%Ver%
set nsp_server_path=%BuildPath%/nspserver_unity_%Ver%

set nsp_client_scd_linux_path=%BuildPath%/nspclient_scd_linux_%Ver%
set nsp_client_scd_win_path=%BuildPath%/nspclient_scd_win_x86_%Ver%
Expand All @@ -25,10 +25,10 @@ set nsp_client_winfform_path=%BuildPath%/nspclient_winform_%Ver%

rem del %~dp0/../build/*.*
rem NSPClient
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path%
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path% /p:PublishTrimmed=false

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

rem NSPClient_SCD
dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-x64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_linux_path%
Expand Down

0 comments on commit fbe8013

Please sign in to comment.