mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-06-07 17:42:45 +08:00
migrate Microsoft.Interop.Tests to target .NET Core 3.1 (#8411)
* migrate Microsoft.Interop.Tests to target .NET Core 3.1 * put the stylecop nuget and stylecop.json * refactor Microsoft.Interop.Tests.csproj to have x64 platform target * Update build-powertoys-steps.yml Getting interop tests actually on CI Co-authored-by: Clint Rutkas <clint@rutkas.com>
This commit is contained in:
parent
0e59be87cb
commit
04586c02de
@ -88,6 +88,7 @@ steps:
|
|||||||
**\Wox.Test.dll
|
**\Wox.Test.dll
|
||||||
**\*Microsoft.PowerToys.Settings.UI.UnitTests.dll
|
**\*Microsoft.PowerToys.Settings.UI.UnitTests.dll
|
||||||
**\UnitTest-ColorPickerUI.dll
|
**\UnitTest-ColorPickerUI.dll
|
||||||
|
**\Microsoft.Interop.Tests.dll
|
||||||
!**\obj\**
|
!**\obj\**
|
||||||
# .NetFramework assemblies
|
# .NetFramework assemblies
|
||||||
- task: VSTest@2
|
- task: VSTest@2
|
||||||
|
@ -1,136 +1,87 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" />
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<Import Project="..\..\Version.props" />
|
<Import Project="..\..\Version.props" />
|
||||||
<!-- We don't have GenerateAssemblyInfo task until we use .net core, so we generate it with WriteLinesToFile -->
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<AssemblyTitle>interop-tests</AssemblyTitle>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<AssemblyCompany>Microsoft Corp.</AssemblyCompany>
|
<IsPackable>false</IsPackable>
|
||||||
<AssemblyCopyright>Copyright (C) 2020 Microsoft Corp.</AssemblyCopyright>
|
|
||||||
|
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||||
|
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||||
|
<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
|
||||||
|
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
|
||||||
|
<Platforms>x64</Platforms>
|
||||||
|
<AssemblyTitle>interop-tests</AssemblyTitle>
|
||||||
|
<Company>Microsoft Corp.</Company>
|
||||||
|
<Copyright>Copyright (C) 2020 Microsoft Corp.</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
|
||||||
<AssemblyVersionFiles Include="Generated Files\AssemblyInfo.cs" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Target Name="GenerateAssemblyInfo" BeforeTargets="PrepareForBuild">
|
|
||||||
<ItemGroup>
|
|
||||||
<HeaderLines Include="// Copyright (c) Microsoft Corporation" />
|
|
||||||
<HeaderLines Include="// The Microsoft Corporation licenses this file to you under the MIT license." />
|
|
||||||
<HeaderLines Include="// See the LICENSE file in the project root for more information." />
|
|
||||||
<HeaderLines Include="#pragma warning disable SA1516" />
|
|
||||||
<HeaderLines Include="using System.Reflection%3b" />
|
|
||||||
<HeaderLines Include="using System.Runtime.InteropServices%3b" />
|
|
||||||
<HeaderLines Include="using System.Windows%3b" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyTitle("$(AssemblyTitle)")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyDescription("")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyConfiguration("")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyCompany("$(AssemblyCompany)")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyCopyright("$(AssemblyCopyright)")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyProduct("$(AssemblyTitle)")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyTrademark("")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyCulture("")]" />
|
|
||||||
<HeaderLines Include="[assembly: ComVisible(false)]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyVersion("$(Version).0")]" />
|
|
||||||
<HeaderLines Include="[assembly: AssemblyFileVersion("$(Version).0")]" />
|
|
||||||
</ItemGroup>
|
|
||||||
<WriteLinesToFile File="Generated Files\AssemblyInfo.cs" Lines="@(HeaderLines)" Overwrite="true" Encoding="Unicode" WriteOnlyWhenDifferent="true" />
|
|
||||||
</Target>
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{437AD818-3F1F-4CA5-A79B-25233A157026}</ProjectGuid>
|
|
||||||
<OutputType>Library</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>Microsoft.Interop.Tests</RootNamespace>
|
|
||||||
<AssemblyName>Microsoft.Interop.Tests</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">15.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
|
||||||
<IsCodedUITest>False</IsCodedUITest>
|
|
||||||
<TestProjectType>UnitTest</TestProjectType>
|
|
||||||
<NuGetPackageImportStamp>
|
|
||||||
</NuGetPackageImportStamp>
|
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<PropertyGroup>
|
||||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<OutputType>Library</OutputType>
|
||||||
<DebugType>full</DebugType>
|
<RootNamespace>Microsoft.Interop.Tests</RootNamespace>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
<AssemblyName>Microsoft.Interop.Tests</AssemblyName>
|
||||||
<LangVersion>7.3</LangVersion>
|
</PropertyGroup>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
</PropertyGroup>
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<OutputPath>bin\x64\Release\</OutputPath>
|
<DebugType>full</DebugType>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
<Optimize>true</Optimize>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<DebugType>pdbonly</DebugType>
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<PlatformTarget>x64</PlatformTarget>
|
</PropertyGroup>
|
||||||
<LangVersion>7.3</LangVersion>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
</PropertyGroup>
|
<Optimize>true</Optimize>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<DebugType>pdbonly</DebugType>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
</PropertyGroup>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
</PropertyGroup>
|
||||||
</PropertyGroup>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<ItemGroup>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
</PropertyGroup>
|
||||||
<HintPath>..\..\..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
</Reference>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
</PropertyGroup>
|
||||||
<HintPath>..\..\..\packages\MSTest.TestFramework.2.1.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<ItemGroup>
|
||||||
<Reference Include="System.Core" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
|
||||||
|
<PackageReference Include="MSTest.TestAdapter" Version="2.1.1" />
|
||||||
|
<PackageReference Include="MSTest.TestFramework" Version="2.1.1" />
|
||||||
|
<PackageReference Include="coverlet.collector" Version="1.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
|
||||||
|
<Version>3.3.0</Version>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="StyleCop.Analyzers">
|
||||||
|
<Version>1.1.118</Version>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="..\..\codeAnalysis\GlobalSuppressions.cs">
|
<Compile Include="..\..\codeAnalysis\GlobalSuppressions.cs">
|
||||||
<Link>GlobalSuppressions.cs</Link>
|
<Link>GlobalSuppressions.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="InteropTests.cs" />
|
|
||||||
<Compile Include="Generated Files\AssemblyInfo.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<AdditionalFiles Include="..\..\codeAnalysis\StyleCop.json">
|
<AdditionalFiles Include="..\..\codeAnalysis\StyleCop.json">
|
||||||
<Link>StyleCop.json</Link>
|
<Link>StyleCop.json</Link>
|
||||||
</AdditionalFiles>
|
</AdditionalFiles>
|
||||||
<None Include="packages.config" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers">
|
<ProjectReference Include="..\interop\interop.vcxproj" />
|
||||||
<Version>3.3.0</Version>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
<PackageReference Include="StyleCop.Analyzers">
|
|
||||||
<Version>1.1.118</Version>
|
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
|
||||||
<PrivateAssets>all</PrivateAssets>
|
|
||||||
</PackageReference>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\interop\interop.vcxproj">
|
</Project>
|
||||||
<Project>{f055103b-f80b-4d0c-bf48-057c55620033}</Project>
|
|
||||||
<Name>interop</Name>
|
|
||||||
</ProjectReference>
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
|
||||||
<PropertyGroup>
|
|
||||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Error Condition="!Exists('..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.props'))" />
|
|
||||||
<Error Condition="!Exists('..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets'))" />
|
|
||||||
</Target>
|
|
||||||
<Import Project="..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\..\..\packages\MSTest.TestAdapter.2.1.2\build\net45\MSTest.TestAdapter.targets')" />
|
|
||||||
</Project>
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="MSTest.TestAdapter" version="2.1.2" targetFramework="net472" />
|
|
||||||
<package id="MSTest.TestFramework" version="2.1.2" targetFramework="net472" />
|
|
||||||
</packages>
|
|
Loading…
Reference in New Issue
Block a user