Warn on invalid NuGet configuration

Issue a warning when `%NUGET_PACKAGES%` doesn't have a trailing slash
until the associatede issue is fixed.

https://github.com/dotnet/roslyn/issues/72657
This commit is contained in:
Jared Parsons 2024-04-04 13:08:17 -07:00
Родитель badd53cb7b
Коммит 7270c8f816
2 изменённых файлов: 12 добавлений и 1 удалений

3
.gitignore поставляемый
Просмотреть файл

@ -24,8 +24,9 @@ x86/ !eng/common/cross/x86/
msbuild.log
msbuild.err
msbuild.wrn
msbuild.binlog
msbuild.ProjectImports.zip
*.binlog
*.complog
# Visual Studio 2015
.vs/

Просмотреть файл

@ -34,6 +34,16 @@
<SupportedPlatform Remove="iOS" />
</ItemGroup>
<!--
Warn consumers until the underlying issue is fixed
https://github.com/dotnet/roslyn/issues/72657
-->
<Target Name="CheckNuPkgEnvEndsWithSlash"
AfterTargets="AfterCompile">
<Warning Condition="'$(NUGET_PACKAGES)' != '' AND !$(NUGET_PACKAGES.EndsWith('\'))"
Text="NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues." />
</Target>
<Target Name="GetCustomAssemblyAttributes"
BeforeTargets="GetAssemblyAttributes"
Condition=" '$(MSBuildProjectExtension)' == '.csproj' "