Skip to content

Commit

Permalink
Revert "Update sourcebuild configuration to build net previous and ne…
Browse files Browse the repository at this point in the history
…t current (microsoft#4856)"

This reverts commit 98c26a1.
  • Loading branch information
nohwnd committed Jan 31, 2024
1 parent 9326c0c commit 7494640
Show file tree
Hide file tree
Showing 20 changed files with 322 additions and 287 deletions.
6 changes: 0 additions & 6 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@
<!-- Naming is based on dotnet/runtime one -->
<NetFrameworkMinimum>net462</NetFrameworkMinimum>
<NetCoreAppMinimum>netcoreapp3.1</NetCoreAppMinimum>
<!--
Arcade is making things hard to work with. This property is unset when its value is equal to NetMinimum.
https://github.com/dotnet/arcade/blob/66c9c5397d599af40f2a94989241944f5a73442a/src/Microsoft.DotNet.Arcade.Sdk/tools/TargetFrameworkDefaults.props#L16-L18
Because I don't want to complexify further the logic on VSTest just for that, I will set it to NetMinimum.
-->
<NetPrevious Condition=" $(NetPrevious) == '' ">$(NetMinimum)</NetPrevious>
</PropertyGroup>

<!-- Build & pack config -->
Expand Down
20 changes: 6 additions & 14 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,12 @@

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />

<!--
CI source build leg: this needs to build the current and previous source build TFM. Both are
necessary as the output of this leg is used in other CI source build legs. Those could be
targeting NetCurrent or NetPrevious hence we must produce both.
-->
<PropertyGroup Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product' ">
<TargetFrameworks>$(NetPrevious);$(NetCurrent)</TargetFrameworks>
</PropertyGroup>

<!--
Source build the product: this is the all up build of the product which needs only NetCurrent
-->
<PropertyGroup Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product' ">
<TargetFrameworks>$(NetCurrent)</TargetFrameworks>
<!-- Source build properties -->
<PropertyGroup Condition=" '$(DotNetBuildFromSource)' == 'true' ">
<!-- Force setting TargetFrameworks to net7.0 only if it was set -->
<TargetFrameworks Condition=" '$(TargetFrameworks)' != '' ">$(NetCurrent)</TargetFrameworks>
<!-- Force setting TargetFramework to net7.0 only if it was set -->
<TargetFramework Condition=" '$(TargetFramework)' != '' ">$(NetCurrent)</TargetFramework>
</PropertyGroup>

<!-- Test project settings -->
Expand Down
3 changes: 0 additions & 3 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@
<!-- Caused by dependency on System.ComponentModel.Composition.4.5.0. This version is overridden in full source-build. -->
<UsagePattern IdentityGlob="System.Security.Principal.Windows/4.5.0" />
<UsagePattern IdentityGlob="Microsoft.Diagnostics.NETCore.Client/0.2.452401" />
<!-- Caused by multi-targeting source build for repo builds/CI. Product source build only targets NetCurrent. -->
<UsagePattern IdentityGlob="Microsoft.AspNetCore.App.Ref/8.0.0" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Host.linux-x64/8.0.0" />
</IgnorePatterns>
</UsageData>
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<NetStandardImplicitPackageVersion>2.0.0</NetStandardImplicitPackageVersion>
<AssemblyName>Microsoft.TestPlatform.Build</AssemblyName>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<IsTestProject>false</IsTestProject>
<UseBannedApiAnalyzers>true</UseBannedApiAnalyzers>
</PropertyGroup>

<Choose>
<When Condition=" '$(DotNetBuildFromSource)' == 'true' ">
<PropertyGroup>
<Tfm>$(NetCurrent)</Tfm>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<Tfm>netstandard2.0</Tfm>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<!-- This package is included even in source build -->
<IsPackable>true</IsPackable>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' != 'true' ">Microsoft.TestPlatform.Build.nuspec</NuspecFile>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product' ">Microsoft.TestPlatform.Build.sourcebuild.nuspec</NuspecFile>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product' ">Microsoft.TestPlatform.Build.sourcebuild.product.nuspec</NuspecFile>
<NuspecFile>Microsoft.TestPlatform.Build.nuspec</NuspecFile>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<PackageId>Microsoft.TestPlatform.Build</PackageId>
<PackageTags>vstest visual-studio unittest testplatform mstest microsoft test testing</PackageTags>
Expand All @@ -24,16 +36,15 @@
</PackageDescription>
</PropertyGroup>

<ItemGroup Label="NuGet">
<NuspecProperty Include="tfm=$(Tfm)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildFrameworkPackageVersion)" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCorePackageVersion)" />
</ItemGroup>

<ItemGroup Label="NuGet">
<NuspecProperty Include="SourceBuildTfmPrevious=$(NetPrevious)" />
<NuspecProperty Include="SourceBuildTfmCurrent=$(NetCurrent)" />
</ItemGroup>

<ItemGroup>
<Content Include="Microsoft.TestPlatform.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,29 @@
$CommonMetadataElements$

<dependencies>
<group targetFramework="netstandard2.0" />
<group targetFramework="$tfm$" />
</dependencies>
</metadata>

<files>
$CommonFileElements$

<file src="netstandard2.0/Microsoft.TestPlatform.targets" target="runtimes/any/native" />
<file src="netstandard2.0/Microsoft.TestPlatform.Build.dll" target="lib/netstandard2.0" />
<file src="$tfm$/Microsoft.TestPlatform.targets" target="runtimes/any/native" />
<file src="$tfm$/Microsoft.TestPlatform.Build.dll" target="lib/$tfm$" />

<!-- Add localized resources -->
<file src="netstandard2.0/cs/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/cs" />
<file src="netstandard2.0/de/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/de" />
<file src="netstandard2.0/es/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/es" />
<file src="netstandard2.0/fr/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/fr" />
<file src="netstandard2.0/it/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/it" />
<file src="netstandard2.0/ja/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/ja" />
<file src="netstandard2.0/ko/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/ko" />
<file src="netstandard2.0/pl/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/pl" />
<file src="netstandard2.0/pt-BR/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/pt-BR" />
<file src="netstandard2.0/ru/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/ru" />
<file src="netstandard2.0/tr/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/tr" />
<file src="netstandard2.0/zh-Hans/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/zh-Hans" />
<file src="netstandard2.0/zh-Hant/Microsoft.TestPlatform.Build.resources.dll" target="lib/netstandard2.0/zh-Hant" />
<file src="$tfm$/cs/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/cs" />
<file src="$tfm$/de/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/de" />
<file src="$tfm$/es/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/es" />
<file src="$tfm$/fr/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/fr" />
<file src="$tfm$/it/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/it" />
<file src="$tfm$/ja/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/ja" />
<file src="$tfm$/ko/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/ko" />
<file src="$tfm$/pl/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/pl" />
<file src="$tfm$/pt-BR/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/pt-BR" />
<file src="$tfm$/ru/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/ru" />
<file src="$tfm$/tr/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/tr" />
<file src="$tfm$/zh-Hans/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/zh-Hans" />
<file src="$tfm$/zh-Hant/Microsoft.TestPlatform.Build.resources.dll" target="lib/$tfm$/zh-Hant" />
</files>
</package>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Microsoft.TestPlatform.ObjectModel\Microsoft.TestPlatform.ObjectModel.csproj" />
<ProjectReference Include="$(RepoRoot)src\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
<ProjectReference Include="$(RepoRoot)src\Microsoft.TestPlatform.CoreUtilities\Microsoft.TestPlatform.CoreUtilities.csproj" />
</ItemGroup>
<ItemGroup Condition=" '$(DotNetBuildFromSource)' != 'true' ">
<ProjectReference Include="$(RepoRoot)src\DataCollectors\DumpMinitool\DumpMinitool.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@
<TargetFrameworks>$(NetCoreAppMinimum);$(NetFrameworkMinimum);net47;net471;net472;net48</TargetFrameworks>
</PropertyGroup>

<Choose>
<When Condition=" '$(DotNetBuildFromSource)' == 'true' ">
<PropertyGroup>
<NuspecFile>Microsoft.TestPlatform.CLI.sourcebuild.nuspec</NuspecFile>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<NuspecFile>Microsoft.TestPlatform.CLI.nuspec</NuspecFile>
</PropertyGroup>
</Otherwise>
</Choose>

<PropertyGroup>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' != 'true' ">Microsoft.TestPlatform.CLI.nuspec</NuspecFile>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' != 'Product' ">Microsoft.TestPlatform.CLI.sourcebuild.nuspec</NuspecFile>
<NuspecFile Condition=" '$(DotNetBuildFromSource)' == 'true' AND '$(DotNetBuildFromSourceFlavor)' == 'Product' ">Microsoft.TestPlatform.CLI.sourcebuild.product.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
<!-- This package is included even in source build -->
<IsPackable>true</IsPackable>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
<NuspecBasePath>$(OutputPath)</NuspecBasePath>
<PackageId>Microsoft.TestPlatform.CLI</PackageId>
Expand All @@ -23,8 +33,7 @@
<ItemGroup Label="NuGet">
<NuspecProperty Include="SrcPackageFolder=$(SrcPackageFolder)" />
<NuspecProperty Include="TesthostRuntimeconfig=$(RepoRoot)temp\testhost" />
<NuspecProperty Include="SourceBuildTfmPrevious=$(NetPrevious)" />
<NuspecProperty Include="SourceBuildTfmCurrent=$(NetCurrent)" />
<NuspecProperty Include="SourceBuildTfm=$(NetCurrent)" />
</ItemGroup>

<PropertyGroup>
Expand Down
Loading

0 comments on commit 7494640

Please sign in to comment.