Skip to content

Commit

Permalink
Warn on invalid NuGet configuration (#10220)
Browse files Browse the repository at this point in the history
Issue a warning when `%NUGET_PACKAGES%` doesn't have a trailing slash
until the associatede issue is fixed.

dotnet/roslyn#72657
  • Loading branch information
jaredpar committed Apr 5, 2024
2 parents c68a6bd + bb8dfea commit 6c02086
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
10 changes: 10 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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($([System.String]::new($([System.IO.Path]::DirectorySeparatorChar)))))"
Text="NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues: $(NUGET_PACKAGES)" />
</Target>

<Target Name="GetCustomAssemblyAttributes"
BeforeTargets="GetAssemblyAttributes"
Condition=" '$(MSBuildProjectExtension)' == '.csproj' "
Expand Down

0 comments on commit 6c02086

Please sign in to comment.