winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

EmbeddedCsWinRT.targets (1926B)


      1 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
      2   <PropertyGroup>
      3     <CsWinRTEmbedded>true</CsWinRTEmbedded>
      4     <IncludeWindowsSDKRefFrameworkReferences>false</IncludeWindowsSDKRefFrameworkReferences>
      5   </PropertyGroup>
      6 
      7   <!-- Disable warnings from embedded/generated CsWinRT files. -->
      8   <!-- Runs after the last target from https://github.com/microsoft/CsWinRT/blob/master/nuget/Microsoft.Windows.CsWinRT.Embedded.targets -->
      9   <Target Name="DisableCsWinRTWarnings" AfterTargets="CsWinRTAddEmbeddedRuntime_Net5Sources">
     10     <ItemGroup>
     11       <WinGetCsWinRTGeneratedFiles Include="$(CsWinRTGeneratedFilesDir)*.cs" />
     12     </ItemGroup>
     13     <WriteLinesToFile File="%(WinGetCsWinRTGeneratedFiles.FullPath)"
     14         Condition="$([System.IO.File]::Exists(%(WinGetCsWinRTGeneratedFiles.FullPath))) AND !$([System.IO.File]::ReadAllText(%(WinGetCsWinRTGeneratedFiles.FullPath)).StartsWith(&quot;// &lt;auto-generated /&gt;&quot;))"
     15         Lines="$([System.String]::Concat(&quot;// &lt;auto-generated /&gt;&#xA;#pragma warning disable&#xA;&#xA;&quot;,$([System.IO.File]::ReadAllText(%(WinGetCsWinRTGeneratedFiles.FullPath)))))"
     16         Overwrite="true"
     17         Encoding="Unicode" />
     18   </Target>
     19 
     20   <!-- Remove the embedded module file that contains an unversioned SupportedOSPlatform attribute. -->
     21   <Target Name="WinGetRemoveCsWinRTModuleFile" AfterTargets="CsWinRTIncludeProjection">
     22     <ItemGroup>
     23       <Compile Remove="$(CsWinRTGeneratedFilesDir)Module.cs" />
     24     </ItemGroup>
     25   </Target>
     26 
     27   <!-- Remove any items from ReferenceCopyLocalPaths that have CopyLocal set to false. -->
     28   <Target Name="WinGetRemoveCopyLocalReferencesAsNeeded" AfterTargets="CsWinRTRemoveWinMDReferences">
     29     <ItemGroup>
     30       <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="%(ReferenceCopyLocalPaths.CopyLocal) == 'false'" />
     31     </ItemGroup>
     32   </Target>
     33 </Project>