Skip to content

Commit ce290b4

Browse files
committed
Fix compile error on test
1 parent 7cf11ca commit ce290b4

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

PluginTest/PluginTest.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1010
<InvariantGlobalization>true</InvariantGlobalization>
1111
<Platforms>x64</Platforms>
12-
<Configurations>Debug;Release</Configurations>
12+
<Configurations>Debug;Release;DebugNoReflection;ReleaseNoReflection</Configurations>
1313
</PropertyGroup>
1414

1515
<ItemGroup>
@@ -22,4 +22,14 @@
2222
<ProjectReference Include="..\Hi3Helper.Plugin.Core.csproj" />
2323
</ItemGroup>
2424

25+
<PropertyGroup Condition="'$(Configuration)'=='DebugNoReflection'">
26+
<DefineConstants>$(DefineConstants);DEBUG;USELIGHTWEIGHTJSONPARSER</DefineConstants>
27+
<Optimize>false</Optimize>
28+
</PropertyGroup>
29+
30+
<PropertyGroup Condition="'$(Configuration)'=='ReleaseNoReflection'">
31+
<DefineConstants>$(DefineConstants);USELIGHTWEIGHTJSONPARSER</DefineConstants>
32+
<Optimize>true</Optimize>
33+
</PropertyGroup>
34+
2535
</Project>

PluginTest/Test.PluginUpdate.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using Hi3Helper.Plugin.Core.Management;
22
using Hi3Helper.Plugin.Core.Update;
33
using Hi3Helper.Plugin.Core.Utility;
4-
using Hi3Helper.Plugin.Core.Utility.Json.Converters;
54
using Microsoft.Extensions.Logging;
65
using System;
76
using System.Buffers;
@@ -15,6 +14,10 @@
1514
using System.Threading;
1615
using System.Threading.Tasks;
1716

17+
#if !USELIGHTWEIGHTJSONPARSER
18+
using Hi3Helper.Plugin.Core.Utility.Json.Converters;
19+
#endif
20+
1821
namespace PluginTest;
1922

2023
internal static partial class Test
@@ -222,16 +225,24 @@ public class PluginManifest
222225
public string? MainPluginAuthor { get; init; }
223226
public string? MainPluginDescription { get; init; }
224227

228+
#if !USELIGHTWEIGHTJSONPARSER
225229
[JsonConverter(typeof(Utf8SpanParsableJsonConverter<GameVersion>))]
230+
#endif
226231
public GameVersion PluginStandardVersion { get; init; }
227232

233+
#if !USELIGHTWEIGHTJSONPARSER
228234
[JsonConverter(typeof(Utf8SpanParsableJsonConverter<GameVersion>))]
235+
#endif
229236
public GameVersion PluginVersion { get; init; }
230237

238+
#if !USELIGHTWEIGHTJSONPARSER
231239
[JsonConverter(typeof(Utf16SpanParsableJsonConverter<DateTimeOffset>))]
240+
#endif
232241
public DateTimeOffset PluginCreationDate { get; init; }
233242

243+
#if !USELIGHTWEIGHTJSONPARSER
234244
[JsonConverter(typeof(Utf16SpanParsableJsonConverter<DateTimeOffset>))]
245+
#endif
235246
public DateTimeOffset ManifestDate { get; init; }
236247

237248
public required List<PluginManifestAsset> Assets { get; init; }

0 commit comments

Comments
 (0)