Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eng/dependabot/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
<PackageVersion Include="PdbGit" Version="3.0.41" />
<PackageVersion Update="PdbGit" Condition="'$(PdbGitVersion)' != ''" Version="$(PdbGitVersion)" />

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Condition="'$(MicrosoftCodeAnalysisCSharpAnalyzerTestingVersion)' != ''" Version="$(MicrosoftCodeAnalysisCSharpAnalyzerTestingVersion)" />

<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
<PackageVersion Update="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Condition="'$(MicrosoftCodeAnalysisCSharpCodeFixTestingVersion)' != ''" Version="$(MicrosoftCodeAnalysisCSharpCodeFixTestingVersion)" />

<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Update="Shouldly" Condition="'$(ShouldlyVersion)' != ''" Version="$(ShouldlyVersion)" />

Expand Down
4 changes: 2 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@
9.0.1, causing it to be downloaded and flagged by component governance -->
<PackageReference Include="Newtonsoft.Json" />

<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Condition="'$(DisableTestSharedFiles)' != 'true'" />

<!-- Don't localize unit test projects -->
<PackageReference Remove="XliffTasks" />

<Compile Include="$(RepoRoot)src\Shared\UnitTests\TestAssemblyInfo.cs" Condition="'$(IsLibraryTestProject)' != 'true'" />
<Compile Include="$(RepoRoot)src\Shared\UnitTests\TestAssemblyInfo.cs" Condition="'$(IsLibraryTestProject)' != 'true' AND '$(DisableTestSharedFiles)' != 'true'" />
<Compile Include="$(RepoRoot)src\Shared\UnitTests\TestProgram.cs" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.TaskEnvironmentRequired).WithLocation(0)
.WithArguments("Environment.GetEnvironmentVariable(string)", "use TaskEnvironment.GetEnvironmentVariable instead")
).RunAsync();
.WithArguments("Environment.GetEnvironmentVariable(string)", "use TaskEnvironment.GetEnvironmentVariable instead")).RunAsync();
}

[Fact]
Expand Down Expand Up @@ -111,8 +110,7 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.TaskEnvironmentRequired).WithLocation(0)
.WithArguments("Environment.SetEnvironmentVariable(string, string?)", "use TaskEnvironment.SetEnvironmentVariable instead")
).RunAsync();
.WithArguments("Environment.SetEnvironmentVariable(string, string?)", "use TaskEnvironment.SetEnvironmentVariable instead")).RunAsync();
}

[Fact]
Expand Down Expand Up @@ -146,8 +144,7 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.TaskEnvironmentRequired).WithLocation(0)
.WithArguments("Path.GetFullPath(string)", "use TaskEnvironment.GetAbsolutePath instead")
).RunAsync();
.WithArguments("Path.GetFullPath(string)", "use TaskEnvironment.GetAbsolutePath instead")).RunAsync();
}

[Fact]
Expand Down Expand Up @@ -181,8 +178,7 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.TaskEnvironmentRequired).WithLocation(0)
.WithArguments("Environment.CurrentDirectory", "use TaskEnvironment.ProjectDirectory instead")
).RunAsync();
.WithArguments("Environment.CurrentDirectory", "use TaskEnvironment.ProjectDirectory instead")).RunAsync();
}

[Fact]
Expand Down Expand Up @@ -216,8 +212,7 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.FilePathRequiresAbsolute).WithLocation(0)
.WithArguments("File.Exists(string?)", "wrap path argument with TaskEnvironment.GetAbsolutePath()")
).RunAsync();
.WithArguments("File.Exists(string?)", "wrap path argument with TaskEnvironment.GetAbsolutePath()")).RunAsync();
}

[Fact]
Expand Down Expand Up @@ -251,7 +246,6 @@ public override bool Execute()
}
""",
Diag(DiagnosticIds.FilePathRequiresAbsolute).WithLocation(0)
.WithArguments("new FileInfo(...)", "wrap path argument with TaskEnvironment.GetAbsolutePath()")
).RunAsync();
.WithArguments("new FileInfo(...)", "wrap path argument with TaskEnvironment.GetAbsolutePath()")).RunAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,25 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<!-- Not a standard MSBuild unit test — uses Roslyn analyzer testing infra.
IsUnitTestProject=false prevents Directory.Build.targets from adding
shared test files (TestAssemblyInfo.cs, TestProgram.cs). -->
<IsUnitTestProject>false</IsUnitTestProject>
<!-- CodeAnalysis.Testing packages have transitive NuGet dependencies
that conflict with the repo's centrally-managed NuGet versions. -->
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
DisableTestSharedFiles=true prevents Directory.Build.targets from adding
shared test files (TestAssemblyInfo.cs). -->
<DisableTestSharedFiles>true</DisableTestSharedFiles>
Comment thread
Youssef1313 marked this conversation as resolved.
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.12.0" />
<PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Analyzer.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.CodeFix.Testing" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<PackageReference Include="Shouldly" />

<!-- Re-declares deps of roslyn testing packages. MSBuild pins NuGet to 7.x, while testing packages are on 6.x -->
<!-- They are not binary compatible and so we must ensure to keep the same version as the testing packages. -->
<!-- Note that MSBuild uses CentralPackageTransitivePinningEnabled -->
<PackageReference Include="NuGet.Common" VersionOverride="6.3.4" />
<PackageReference Include="NuGet.Packaging" VersionOverride="6.3.4" />
<PackageReference Include="NuGet.Protocol" VersionOverride="6.3.4" />
<PackageReference Include="NuGet.Resolver" VersionOverride="6.3.4" />
<PackageReference Include="NuGet.Frameworks" VersionOverride="6.3.4" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion src/ThreadSafeTaskAnalyzer.Tests/WriteAllTextDetailedTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
using System.Threading.Tasks;
using Shouldly;
using Xunit;
using static Microsoft.Build.TaskAuthoring.Analyzer.Tests.TestHelpers;
using System.Linq;

using static Microsoft.Build.TaskAuthoring.Analyzer.Tests.TestHelpers;

namespace Microsoft.Build.TaskAuthoring.Analyzer.Tests
{
public class WriteAllTextDetailedTest
Expand Down
2 changes: 1 addition & 1 deletion src/ThreadSafeTaskAnalyzer/ThreadSafeTaskAnalyzer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="ThreadSafeTaskAnalyzer.Tests" />
<InternalsVisibleTo Include="ThreadSafeTaskAnalyzer.Tests" Key="002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4" />
</ItemGroup>

<ItemGroup>
Expand Down