Skip to content

Commit

Permalink
[NuGet] Fix setting platform version on the target framework moniker …
Browse files Browse the repository at this point in the history
…(TFM) when passed to NuGet resolver to properly load NuGet libraries (#2432)

Co-authored-by: Basewq <Basewq@users.noreply.github.com>
  • Loading branch information
Basewq and Basewq authored Sep 6, 2024
1 parent ba36a7e commit 4ebbf54
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.config;.exe</AllowedOutputExtensionsInPackageBuildOutputFolder>
<UseWPF Condition="'$(StrideNuGetResolverUI)' == 'true'">true</UseWPF>
</PropertyGroup>
<PropertyGroup>
</PropertyGroup>
<Target Name="NuGetResolverModuleInitializerGenerate" BeforeTargets="BeforeCompile;CoreCompile" DependsOnTargets="PrepareForBuild">
<PropertyGroup>
<NuGetResolverModuleInitializerFile>$(IntermediateOutputPath)$(MSBuildProjectName).NuGetResolverEntryPoint$(DefaultLanguageSourceExtension)</NuGetResolverModuleInitializerFile>
<NuGetResolverTargetFramework>$(TargetFramework)</NuGetResolverTargetFramework>
<NuGetResolverTargetFramework Condition="'$(TargetPlatformVersion)' != '' and !$(TargetFramework.EndsWith(TargetPlatformVersion))">$(TargetFramework)$(TargetPlatformVersion)</NuGetResolverTargetFramework>
</PropertyGroup>
<WriteLinesToFile File="$(NuGetResolverModuleInitializerFile)" Overwrite="true" Lines="$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)NuGetResolverModuleInitializer.cs')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_TARGET_FRAMEWORK','&quot;$(TargetFramework)&quot;')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_PACKAGE_NAME','&quot;$(PackageId)&quot;')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_PACKAGE_VERSION','&quot;$(PackageVersion)&quot;'))" />
<WriteLinesToFile File="$(NuGetResolverModuleInitializerFile)" Overwrite="true" Lines="$([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)NuGetResolverModuleInitializer.cs')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_TARGET_FRAMEWORK','&quot;$(NuGetResolverTargetFramework)&quot;')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_PACKAGE_NAME','&quot;$(PackageId)&quot;')&#xD;&#xA; .Replace('STRIDE_NUGET_RESOLVER_PACKAGE_VERSION','&quot;$(PackageVersion)&quot;'))" />
<ItemGroup>
<FileWrites Include="$(NuGetResolverModuleInitializerFile)" />
<Compile Include="$(NuGetResolverModuleInitializerFile)" />
Expand Down

0 comments on commit 4ebbf54

Please sign in to comment.