Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PublicAPI analyzer to all public projects #3205

Merged
merged 27 commits into from
Nov 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
fc4f298
Add to SettingsMigrator
nohwnd Nov 30, 2021
80bf5a8
Add to Microsoft.TestPlatform.Build
nohwnd Nov 30, 2021
cb3c6f7
Add to Microsoft.TestPlatform.AdapterUtilities
nohwnd Nov 30, 2021
6c81850
Move all apis in Microsoft.TestPlatform.AdapterUtilities to published
nohwnd Nov 30, 2021
5fc131b
Add to AttachVS
nohwnd Nov 30, 2021
7922703
Add to DumpMinitool and DumpMinitool.x86
nohwnd Nov 30, 2021
446a86f
Remove extra files from DumpMinitool and DumpMinitool.x86
nohwnd Nov 30, 2021
b9d7ee2
Add to Microsoft.TestPlatform.Extensions.HtmlLogger
nohwnd Nov 30, 2021
00cb2a4
Add to Microsoft.TestPlatform.Utilities
nohwnd Nov 30, 2021
648dafe
Add to Microsoft.TestPlatform.Extensions.TrxLogger
nohwnd Nov 30, 2021
9a2cad2
Add to Microsoft.TestPlatform.Extensions.EventLogCollector
nohwnd Nov 30, 2021
2f4ada8
Add to Microsoft.TestPlatform.Extensions.BlameDataCollector
nohwnd Nov 30, 2021
efce802
Add to Microsoft.TestPlatform.TestHostProvider
nohwnd Nov 30, 2021
3e82b93
Add to Microsoft.TestPlatform.Common
nohwnd Nov 30, 2021
759b6ed
Add to Microsoft.TestPlatform.CommunicationUtilities
nohwnd Nov 30, 2021
53b2b49
Add to Microsoft.TestPlatform.CrossPlatEngine
nohwnd Nov 30, 2021
fe3724a
Add to Microsoft.TestPlatform.VsTestConsole.TranslationLayer
nohwnd Nov 30, 2021
c5c763a
Add to datacollector
nohwnd Nov 30, 2021
89b9922
Add to Microsoft.TestPlatform.Client/Microsoft.TestPlatform.Client
nohwnd Nov 30, 2021
8f1d8f4
Add to testhost, and testhost.x86
nohwnd Nov 30, 2021
01096e8
Add to vstest.console
nohwnd Nov 30, 2021
12982d0
Add to package
nohwnd Nov 30, 2021
a12767e
Add PublicApi analyzer dependency via targets
nohwnd Nov 30, 2021
90d45f2
Fix whitespace in props
nohwnd Nov 30, 2021
31f5209
Fix whitespace
nohwnd Nov 30, 2021
4f46861
Remove copy of CrossPlatEngine project
nohwnd Nov 30, 2021
417f5c2
Formatting updates
Haplois Nov 30, 2021
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
2 changes: 2 additions & 0 deletions scripts/build/TestPlatform.Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
<SystemNetHttpVersion>4.3.4</SystemNetHttpVersion>

<DependencyVersionsImported>true</DependencyVersionsImported>

<RoslynPublicApiAnalyzersVersion>3.3.4-beta1.21554.2</RoslynPublicApiAnalyzersVersion>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\..\eng\Versions.props" />
Expand Down
16 changes: 16 additions & 0 deletions scripts/build/TestPlatform.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@
</AdditionalFiles>
</ItemGroup>

<!-- Include PublicApi analyzers into all projects that are in our src directory, this can't use TestProject == true
because some projects in test and playground are not tests, but we don't want to analyze those for public apis, because
we don't ship them.
-->
<Choose>
<When Condition="$(MSBuildProjectFullPath.Contains('/src/')) OR $(MSBuildProjectFullPath.Contains('\src\'))">
<ItemGroup>
<!-- We normally don't build against net6.0, so the public api analyzer errors would only appear in CI pipeline. -->
<PackageReference Condition=" '$(DotNetBuildFromSource)' != 'true' " Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="$(RoslynPublicApiAnalyzersVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
</Choose>

<!-- Test project settings -->
<Choose>
<When Condition="$(TestProject) == 'true'">
Expand Down
12 changes: 8 additions & 4 deletions src/AttachVS/AttachVS.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">..\..\</TestPlatformRoot>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">..\..\</TestPlatformRoot>
<TargetLatestRuntimePatch>true</TargetLatestRuntimePatch>
</PropertyGroup>
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net472</TargetFrameworks>
<LangVersion>preview</LangVersion>
<AssemblyName>AttachVS</AssemblyName>
</PropertyGroup>

<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
</ItemGroup>
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions src/DataCollectors/DumpMinitool.x86/DumpMinitool.x86.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@
<ItemGroup>
<Compile Include="..\DumpMinitool\Program.cs" Link="Program.cs" />
</ItemGroup>

<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
</ItemGroup>
</Project>
Empty file.
Empty file.
6 changes: 6 additions & 0 deletions src/DataCollectors/DumpMinitool/DumpMinitool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<RuntimeIdentifier Condition=" '$(DotNetBuildFromSource)' != 'true' ">win7-x86</RuntimeIdentifier>
<AutoGenerateBindingRedirects>false</AutoGenerateBindingRedirects>
</PropertyGroup>

<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="..\DumpMinitool.x86\PublicAPI\PublicAPI.Shipped.txt" Link="PublicAPI\PublicAPI.Shipped.txt" />
<AdditionalFiles Include="..\DumpMinitool.x86\PublicAPI\PublicAPI.Unshipped.txt" Link="PublicAPI\PublicAPI.Unshipped.txt" />
</ItemGroup>

<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,13 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
<!-- Framework specific API -->
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
</ItemGroup>
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Microsoft.TestPlatform.Extensions.EventLogCollector.EventLogDataCollector
Microsoft.TestPlatform.Extensions.EventLogCollector.EventLogDataCollector.EventLogDataCollector() -> void
override Microsoft.TestPlatform.Extensions.EventLogCollector.EventLogDataCollector.Dispose(bool disposing) -> void
override Microsoft.TestPlatform.Extensions.EventLogCollector.EventLogDataCollector.Initialize(System.Xml.XmlElement configurationElement, Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.DataCollectionEvents events, Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.DataCollectionSink dataSink, Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.DataCollectionLogger logger, Microsoft.VisualStudio.TestPlatform.ObjectModel.DataCollection.DataCollectionEnvironmentContext dataCollectionEnvironmentContext) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,14 @@
-->
</ItemGroup>

<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
<!-- API that is common to all frameworks except for .NET Standard 1.0 and UAP10. -->
<AdditionalFiles Condition=" '$(TargetFramework)' != 'netstandard1.0' AND '$(TargetFramework)' != 'uap10.0' " Include="PublicAPI\net\PublicAPI.Shipped.txt" />
<AdditionalFiles Condition=" '$(TargetFramework)' != 'netstandard1.0' AND '$(TargetFramework)' != 'uap10.0' " Include="PublicAPI\net\PublicAPI.Unshipped.txt" />
</ItemGroup>

<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.HierarchyLabel = "Hierarchy" -> string
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.HierarchyPropertyId = "TestCase.Hierarchy" -> string
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.ClassIndex = 1 -> int
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.NamespaceIndex = 0 -> int
const Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels.TotalLevelCount = 2 -> int
const Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants.ManagedMethodLabel = "ManagedMethod" -> string
const Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants.ManagedMethodPropertyId = "TestCase.ManagedMethod" -> string
const Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants.ManagedTypeLabel = "ManagedType" -> string
const Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants.ManagedTypePropertyId = "TestCase.ManagedType" -> string
Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants
Microsoft.TestPlatform.AdapterUtilities.HierarchyConstants.Levels
Microsoft.TestPlatform.AdapterUtilities.ManagedNameConstants
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException.InvalidManagedNameException(string message) -> void
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameHelper
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser.ManagedNameParser() -> void
Microsoft.TestPlatform.AdapterUtilities.TestIdProvider
Microsoft.TestPlatform.AdapterUtilities.TestIdProvider.AppendString(string str) -> void
Microsoft.TestPlatform.AdapterUtilities.TestIdProvider.GetHash() -> byte[]
Microsoft.TestPlatform.AdapterUtilities.TestIdProvider.GetId() -> System.Guid
Microsoft.TestPlatform.AdapterUtilities.TestIdProvider.TestIdProvider() -> void
static Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameHelper.GetManagedName(System.Reflection.MethodBase method, out string managedTypeName, out string managedMethodName) -> void
static Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameHelper.GetManagedName(System.Reflection.MethodBase method, out string managedTypeName, out string managedMethodName, out string[] hierarchyValues) -> void
static Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameHelper.GetMethod(System.Reflection.Assembly assembly, string managedTypeName, string managedMethodName) -> System.Reflection.MethodBase
static Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser.ParseManagedMethodName(string managedMethodName, out string methodName, out int arity, out string[] parameterTypes) -> void
static Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.ManagedNameParser.ParseManagedTypeName(string managedTypeName, out string namespaceName, out string typeName) -> void
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Microsoft.TestPlatform.AdapterUtilities.ManagedNameUtilities.InvalidManagedNameException.InvalidManagedNameException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
</ItemGroup>
<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
</ItemGroup>
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
Microsoft.TestPlatform.Build.Tasks.VSTestForwardingApp
Microsoft.TestPlatform.Build.Tasks.VSTestForwardingApp.Cancel() -> void
Microsoft.TestPlatform.Build.Tasks.VSTestForwardingApp.Execute() -> int
Microsoft.TestPlatform.Build.Tasks.VSTestForwardingApp.VSTestForwardingApp(string vsTestExePath, System.Collections.Generic.IEnumerable<string> argsToForward) -> void
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.LogType.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.LogType.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.ProjectFilePath.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.ProjectFilePath.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.VSTestLogsTask() -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask
Microsoft.TestPlatform.Build.Tasks.VSTestTask.Cancel() -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.TestFileFullPath.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.TestFileFullPath.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlame.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlame.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrash.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrash.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrashCollectAlways.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrashCollectAlways.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrashDumpType.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameCrashDumpType.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHang.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHang.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHangDumpType.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHangDumpType.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHangTimeout.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestBlameHangTimeout.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestCLIRunSettings.get -> string[]
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestCLIRunSettings.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestCollect.get -> string[]
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestCollect.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestConsolePath.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestConsolePath.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestDiag.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestDiag.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestFramework.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestFramework.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestListTests.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestListTests.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestLogger.get -> string[]
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestLogger.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestNoLogo.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestNoLogo.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestPlatform.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestPlatform.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestResultsDirectory.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestResultsDirectory.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestSetting.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestSetting.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTask() -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTestAdapterPath.get -> string[]
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTestAdapterPath.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTestCaseFilter.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTestCaseFilter.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTraceDataCollectorDirectoryPath.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestTraceDataCollectorDirectoryPath.set -> void
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestVerbosity.get -> string
Microsoft.TestPlatform.Build.Tasks.VSTestTask.VSTestVerbosity.set -> void
Microsoft.TestPlatform.Build.Trace.Tracing
Microsoft.TestPlatform.Build.Utils.ArgumentEscaper
override Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask.Execute() -> bool
override Microsoft.TestPlatform.Build.Tasks.VSTestTask.Execute() -> bool
static Microsoft.TestPlatform.Build.Trace.Tracing.Trace(string message) -> void
static Microsoft.TestPlatform.Build.Trace.Tracing.traceEnabled -> bool
static Microsoft.TestPlatform.Build.Utils.ArgumentEscaper.HandleEscapeSequenceInArgForProcessStart(string arg) -> string
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,13 @@
<PropertyGroup Label="Configuration">
<RootNamespace>Microsoft.VisualStudio.TestPlatform.Client</RootNamespace>
</PropertyGroup>
<ItemGroup>
<!-- API that is common to all frameworks that we build for. -->
<AdditionalFiles Include="PublicAPI/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/PublicAPI.Unshipped.txt" />
<!-- Framework specific API -->
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />
</ItemGroup>
<Import Project="$(TestPlatformRoot)scripts\build\TestPlatform.targets" />
</Project>
Loading