Skip to content

Commit

Permalink
Warn on invalid NuGet configuration
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 4, 2024
1 parent badd53c commit 7270c8f
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('\'))"

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build Linux debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS release)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.

Check failure on line 43 in Directory.Build.targets

View check run for this annotation

Azure Pipelines / razor-tooling-ci (Build macOS debug)

Directory.Build.targets#L43

Directory.Build.targets(43,5): error : (NETCORE_ENGINEERING_TELEMETRY=Build) NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues.
Text="NUGET_PACKAGES should end with a slash or it will lead to editorconfig issues." />
</Target>

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

0 comments on commit 7270c8f

Please sign in to comment.