Skip to content

Commit

Permalink
Suppress warnings more intelligently
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyrrrz committed May 22, 2024
1 parent 0b5daaa commit c7bf9e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<LangVersion>preview</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<ILLinkTreatWarningsAsErrors>false</ILLinkTreatWarningsAsErrors>
</PropertyGroup>

</Project>
45 changes: 16 additions & 29 deletions YoutubeDownloader/YoutubeDownloader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,12 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<ApplicationIcon>..\favicon.ico</ApplicationIcon>
<PublishTrimmed>true</PublishTrimmed>
<NoWarn>$(NoWarn);IL2104</NoWarn>
</PropertyGroup>

<!-- Avalonia-related settings -->
<PropertyGroup>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<!-- Warnings not valid when using compiled bindings -->
<NoWarn>$(NoWarn);IL2026</NoWarn>
<!-- Warnings about Material.Avalonia having peer dependencies -->
<NoWarn>$(NoWarn);IL2036</NoWarn>
</PropertyGroup>

<!-- Required by Avalonia.WebView -->
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<PublishTrimmed>true</PublishTrimmed>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
</PropertyGroup>

<!-- Avalonia.WebView is completely incompatible with trimming -->
<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.WebView" />
<TrimmerRootAssembly Include="Avalonia.WebView.Desktop" />
<TrimmerRootAssembly Include="Avalonia.WebView.Linux" />
<TrimmerRootAssembly Include="Avalonia.WebView.MacCatalyst" />
<TrimmerRootAssembly Include="Avalonia.WebView.Windows" />
<TrimmerRootAssembly Include="AvaloniaWebView.Shared" />
<TrimmerRootAssembly Include="Linux.WebView.Core" />
<TrimmerRootAssembly Include="Microsoft.Web.WebView2.Core" />
<TrimmerRootAssembly Include="WebView.Avalonia" />
<TrimmerRootAssembly Include="WebView.Core" />
</ItemGroup>

<ItemGroup>
<AvaloniaResource Include="..\favicon.ico" Link="favicon.ico" />
</ItemGroup>
Expand Down Expand Up @@ -65,6 +38,20 @@
<ProjectReference Include="..\YoutubeDownloader.Core\YoutubeDownloader.Core.csproj" />
</ItemGroup>

<!-- Avalonia.WebView is completely incompatible with trimming -->
<ItemGroup>
<TrimmerRootAssembly Include="Avalonia.WebView" />
<TrimmerRootAssembly Include="Avalonia.WebView.Desktop" />
<TrimmerRootAssembly Include="Avalonia.WebView.Linux" />
<TrimmerRootAssembly Include="Avalonia.WebView.MacCatalyst" />
<TrimmerRootAssembly Include="Avalonia.WebView.Windows" />
<TrimmerRootAssembly Include="AvaloniaWebView.Shared" />
<TrimmerRootAssembly Include="Linux.WebView.Core" />
<TrimmerRootAssembly Include="Microsoft.Web.WebView2.Core" />
<TrimmerRootAssembly Include="WebView.Avalonia" />
<TrimmerRootAssembly Include="WebView.Core" />
</ItemGroup>

<!-- Download FFmpeg and copy it to the output directory-->
<PropertyGroup>
<FFmpegPlatform>$(RuntimeIdentifier)</FFmpegPlatform>
Expand Down

0 comments on commit c7bf9e8

Please sign in to comment.