Skip to content

Commit aa34694

Browse files
committed
Fix trimming issues
1 parent ce450db commit aa34694

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/Configuration/Watches.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ namespace TE.FileWatcher.Configuration
1010
[XmlRoot("watches")]
1111
public class Watches : HasVariablesBase
1212
{
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="Watches"/> class.
15+
/// </summary>
16+
public Watches()
17+
{
18+
}
19+
1320
/// <summary>
1421
/// Gets or sets the logging information.
1522
/// </summary>

src/FileWatcher.csproj

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,19 @@
1212
<!-- Self-contained deployment optimization -->
1313
<PublishSingleFile>true</PublishSingleFile>
1414
<SelfContained>true</SelfContained>
15-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
1615

1716
<!-- Trimming configuration for smaller size -->
1817
<PublishTrimmed>true</PublishTrimmed>
1918
<TrimMode>link</TrimMode>
2019
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
2120

21+
<!-- Suppress trim warnings from System.CommandLine beta package -->
22+
<!-- IL2104: Assembly produces trim warnings -->
23+
<NoWarn>$(NoWarn);IL2104</NoWarn>
24+
25+
<!-- Preserve XML serialization members -->
26+
<TrimmerRemoveSymbols>false</TrimmerRemoveSymbols>
27+
2228
<!-- Optimize for size over speed -->
2329
<PublishReadyToRun>false</PublishReadyToRun>
2430
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
@@ -38,6 +44,11 @@
3844
<PackageId>TE.FileWatcher</PackageId>
3945
</PropertyGroup>
4046

47+
<!-- Apply RuntimeIdentifier only during publish to avoid test project architecture mismatch -->
48+
<PropertyGroup Condition="'$(IsPublishing)' == 'true'">
49+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
50+
</PropertyGroup>
51+
4152
<ItemGroup>
4253
<None Include="..\README.md">
4354
<Pack>True</Pack>
@@ -62,4 +73,11 @@
6273
</None>
6374
</ItemGroup>
6475

76+
<ItemGroup>
77+
<!-- Preserve XML Serialization types from trimming -->
78+
<TrimmerRootAssembly Include="fw" />
79+
<!-- Preserve System.CommandLine types from trimming -->
80+
<TrimmerRootAssembly Include="System.CommandLine" />
81+
</ItemGroup>
82+
6583
</Project>

tests/IO/PatternMatcherTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void StrictMatchPattern_WithVariousPatterns_ShouldMatchCorrectly(
3434
[InlineData(null, "file.txt")]
3535
[InlineData("*.txt", null)]
3636
public void StrictMatchPattern_WithEmptyOrNullInputs_ShouldReturnFalse(
37-
string pattern, string filename)
37+
string? pattern, string? filename)
3838
{
3939
// Act
4040
var result = PatternMatcher.StrictMatchPattern(pattern, filename);

0 commit comments

Comments
 (0)