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

[WIP]Make TestFx repo CPS Based #411

Closed
wants to merge 13 commits into from
Closed
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
4 changes: 4 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<Project>
<!-- Workaround for https://github.com/dotnet/sdk/pull/908 -->
<Target Name="GetPackagingOutputs" />
</Project>
1 change: 0 additions & 1 deletion Nuget.config
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
</activePackageSource>
<config>
<!-- This path is relative as a workaround to https://github.com/NuGet/Home/issues/2831 -->
<!-- <add key="globalPackagesFolder" value="packages" /> -->
<add key="repositoryPath" value="packages" />
</config>
</configuration>
4 changes: 2 additions & 2 deletions Templates/CSharp/Desktop/MSTestDesktopCSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we separate them?

<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -71,7 +71,7 @@
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<PreBuildEvent>
IF EXIST "$(ProjectDir)ProjectTemplates\CSharp\Test\DesktopUnitTestTemplate.zip" DEL /q /s "$(ProjectDir)ProjectTemplates\CSharp\Test\DesktopUnitTestTemplate.zip"
Expand Down
4 changes: 2 additions & 2 deletions Templates/CSharp/UWP/MSTestUWPCSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -71,7 +71,7 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<PreBuildEvent>
IF EXIST "$(ProjectDir)ProjectTemplates\CSharp\Windows UAP\UWP.zip" DEL /q /s "$(ProjectDir)ProjectTemplates\CSharp\Windows UAP\UWP.zip"
Expand Down
4 changes: 2 additions & 2 deletions Templates/VisualBasic/Desktop/MSTestDesktopVB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -71,7 +71,7 @@
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<PreBuildEvent>
IF EXIST "$(ProjectDir)ProjectTemplates\VisualBasic\Test\VBDesktopUnitTestTemplate.zip" DEL /q /s "$(ProjectDir)ProjectTemplates\VisualBasic\Test\VBDesktopUnitTestTemplate.zip"
Expand Down
4 changes: 2 additions & 2 deletions Templates/VisualBasic/UWP/MSTestUWPVB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -71,7 +71,7 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<PreBuildEvent>
IF EXIST "$(ProjectDir)ProjectTemplates\VisualBasic\Windows UAP\UWP_VB.zip" DEL /q /s "$(ProjectDir)ProjectTemplates\VisualBasic\Windows UAP\UWP_VB.zip"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -65,5 +65,5 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -69,7 +69,7 @@
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
</ProjectReference>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<RunCodeAnalysisOnThisProject>false</RunCodeAnalysisOnThisProject>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -87,5 +87,5 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.Templates.targets" />
<PropertyGroup>
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down Expand Up @@ -69,7 +69,7 @@
<IncludeOutputGroupsInVSIX>BuiltProjectOutputGroup</IncludeOutputGroupsInVSIX>
</ProjectReference>
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
<Import Project="$(TestFxRoot)scripts\build\TestFx.Templates.targets" />
<PropertyGroup>
<RunCodeAnalysisOnThisProject>false</RunCodeAnalysisOnThisProject>
</PropertyGroup>
Expand Down
34 changes: 3 additions & 31 deletions samples/FxExtensibility/FxExtensibility.csproj
Original file line number Diff line number Diff line change
@@ -1,48 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
</PropertyGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.Settings.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A82770C0-1FF5-43C7-8790-471D5E4F8D6E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MSTest.Extensibility.Samples</RootNamespace>
<AssemblyName>MSTest.Extensibility.Samples</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TargetFrameworks>net452</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="AssertEx.cs" />
<Compile Include="AssertIs.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\TestFramework\MSTest.Core\MSTest.Core.csproj">
<Project>{7252d9e3-267d-442c-96bc-c73aef3241d6}</Project>
<Name>MSTest.Core</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\TestFramework\MSTest.Core\MSTest.Core.csproj" />
</ItemGroup>
<Import Project="$(TestFxRoot)scripts\build\TestFx.targets" />
</Project>
7 changes: 5 additions & 2 deletions scripts/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -294,17 +294,20 @@ function Create-NugetPackages
$stagingDir = Join-Path $env:TF_OUT_DIR $TFB_Configuration
$packageOutDir = Join-Path $stagingDir "MSTestPackages"
$tfSrcPackageDir = Join-Path $env:TF_SRC_DIR "Package"
$tfSrcNugetPropsDir = Join-Path $env:TF_SRC_DIR "Adapter\Build"

# Copy over the nuspecs to the staging directory
if($TFB_Official)
{
$nuspecFiles = @("MSTest.TestAdapter.Dotnet.nuspec", "MSTest.TestAdapter.nuspec", "MSTest.TestAdapter.symbols.nuspec", "MSTest.TestFramework.nuspec", "MSTest.TestFramework.symbols.nuspec", "MSTest.Internal.TestFx.Documentation.nuspec")
$nuspecFiles = @("MSTest.TestAdapter.nuspec", "MSTest.TestAdapter.symbols.nuspec", "MSTest.TestFramework.nuspec", "MSTest.TestFramework.symbols.nuspec", "MSTest.Internal.TestFx.Documentation.nuspec")
}
else
{
$nuspecFiles = @("MSTest.TestAdapter.Enu.nuspec","MSTest.TestFramework.enu.nuspec", "MSTest.TestAdapter.Dotnet.nuspec")
$nuspecFiles = @("MSTest.TestAdapter.Enu.nuspec","MSTest.TestFramework.enu.nuspec")
}

Copy-Item -Path $tfSrcNugetPropsDir -Recurse -Destination $stagingDir -Container -Force

foreach ($file in $nuspecFiles) {
Copy-Item $tfSrcPackageDir\$file $stagingDir -Force
}
Expand Down
39 changes: 39 additions & 0 deletions scripts/build/TestFx.Settings.Templates.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
<RepoRoot>..\..\</RepoRoot>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') and $(FrameworkIdentifier) != 'NetCore'" />
<!-- Import props/targets with $(RepoRoot) since msbuild takes the relative path based on settings.targets and not with respect to the project. -->
<Import Project="$(RepoRoot)packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props" Condition="Exists('$(RepoRoot)packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" />
<Import Project="$(RepoRoot)packages\microsoft.vssdk.buildtools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props" Condition=" $(IsVsixProj) == 'true' and Exists('$(RepoRoot)packages\microsoft.vssdk.buildtools.15.0.26201\build\Microsoft.VSSDK.BuildTools.props')" />

<PropertyGroup>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<DefaultLanguage>en-US</DefaultLanguage>
<FileAlignment>512</FileAlignment>
<GenerateLCE>true</GenerateLCE>
<AssemblyOriginatorKeyFile>$(TestFxRoot)scripts\build\key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition="'$(IsLocalizedBuild)' == '' or '$(IsLocalizedBuild)' != 'true'">true</PublicSign>
<!-- Temporarily turning on Delay signing for Localized builds because publickey = true is not passed on to the assembler to create resource assmblies.-->
<DelaySign Condition="'$(IsLocalizedBuild)' == 'true'">true</DelaySign>
<OutputPath Condition="$(OutputPath) == ''">$(TestFxRoot)artifacts\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
<IntermediatePath Condition="$(IntermediatePath) == ''">$(TestFxRoot)artifacts\$(Configuration)\$(MSBuildProjectName)\obj\</IntermediatePath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<IsTest Condition="$(MSBuildProjectDirectory.Contains('\test\'))">true</IsTest>
</PropertyGroup>

<!-- Code analysis settings -->
<PropertyGroup>
<RunCodeAnalysis>false</RunCodeAnalysis>
<CodeAnalysisRuleSet>$(TestFxRoot)scripts/build/stylecop.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="$(IsTest) == 'true'">$(TestFxRoot)scripts/build/stylecop.test.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>
41 changes: 39 additions & 2 deletions scripts/build/TestFx.Settings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
<TestFxRoot Condition="$(TestFxRoot) == ''">..\..\</TestFxRoot>
<RepoRoot>..\..\</RepoRoot>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') and $(FrameworkIdentifier) != 'NetCore'" />
<!-- Import props/targets with $(RepoRoot) since msbuild takes the relative path based on settings.targets and not with respect to the project. -->

<Import Project="$(RepoRoot)packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props" Condition="Exists('$(RepoRoot)packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" />
<Import Project="$(RepoRoot)packages\microsoft.vssdk.buildtools.15.8.3247\build\Microsoft.VSSDK.BuildTools.props" Condition=" $(IsVsixProj) == 'true' and Exists('$(RepoRoot)packages\microsoft.vssdk.buildtools.15.8.3247\build\Microsoft.VSSDK.BuildTools.props')" />

Expand All @@ -24,6 +23,44 @@
<OutputPath Condition="$(OutputPath) == ''">$(TestFxRoot)artifacts\$(Configuration)\$(MSBuildProjectName)\</OutputPath>
<IntermediatePath Condition="$(IntermediatePath) == ''">$(TestFxRoot)artifacts\$(Configuration)\$(MSBuildProjectName)\obj\</IntermediatePath>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

<TFBuildNumber Condition=" '$(TFBuildNumber)' == '' ">0.1</TFBuildNumber>
<MajorVersion>14.0</MajorVersion>
<AssemblyVersion>$(MajorVersion).0.0</AssemblyVersion>
<BuildVersion Condition=" '$(BuildVersion)' == '' ">$(MajorVersion).$(TFBuildNumber)</BuildVersion>
<FileVersion>$(BuildVersion)</FileVersion>
<InformationalVersion>$(BuildVersion)</InformationalVersion>

<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>

<!-- Disable default inclusion of .resx file. We generate files in the Resources directory only
if localization is enabled, default inclusion ends up including the generated files by default. -->
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>

<!-- .NetStandardLibrary1.6.0 brings in dependencies which are supported in UWP,
any higher version will bring in dependencies which are not supported by current UWP version -->
<NetStandardImplicitPackageVersion>1.6.0</NetStandardImplicitPackageVersion>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>

<PropertyGroup>
Expand Down
Loading