Skip to content

Commit

Permalink
Enroll Testing.Platform project to source build (#4295)
Browse files Browse the repository at this point in the history
Co-authored-by: Amaury Levé <[email protected]>
  • Loading branch information
nohwnd and Evangelink authored Dec 10, 2024
1 parent ab879c4 commit 056912d
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 32 deletions.
8 changes: 7 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,11 @@
<AssemblyVersion>14.0.0.0</AssemblyVersion>
<AssemblyFileVersion>14.0.0.0</AssemblyFileVersion>
</PropertyGroup>


<!--
CI source build leg: this needs to build only the current TFM.
-->
<PropertyGroup Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">
<TargetFrameworks>$(NetCurrent)</TargetFrameworks>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ stages:
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enableTelemetry: true
enableSourceBuild: true
jobs:
- job: Windows
timeoutInMinutes: 90
Expand Down
3 changes: 2 additions & 1 deletion eng/Analyzers.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup>

<ItemGroup>
<!-- Source build requires that everything needed for build is source-buildable, so we don't use analyzers for source build. -->
<ItemGroup Condition=" '$(DotNetBuildSourceOnly)' != 'true' ">
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="all" Condition="'$(IsSourceProject)' == 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" PrivateAssets="all" />

Expand Down
69 changes: 39 additions & 30 deletions eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,47 @@
<ProductsToBuild Condition=" '$(ProductsToBuild)' == '' ">all</ProductsToBuild>
</PropertyGroup>

<!-- When building all products on windows OS -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'all' AND '$(OS)' == 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)TestFx.sln" />
</ItemGroup>
<Choose>
<When Condition=" '$(DotNetBuildSourceOnly)' == 'true' ">
<!-- When building for source build we only want to build the platform, this is the only component shared to dotnet/sdk. -->
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)src/Platform/Microsoft.Testing.Platform/Microsoft.Testing.Platform.csproj" />
</ItemGroup>
</When>
<Otherwise>
<!-- When building all products on windows OS -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'all' AND '$(OS)' == 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)TestFx.sln" />
</ItemGroup>

<!-- When building all products on non-windows OSes -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'all' AND '$(OS)' != 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)src/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/MSTest.Analyzers.UnitTests/MSTest.Analyzers.UnitTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/Microsoft.Testing.*/Microsoft.Testing.*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSTest.Acceptance.IntegrationTests.csproj" />
</ItemGroup>
<!-- When building all products on non-windows OSes -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'all' AND '$(OS)' != 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)src/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/MSTest.Analyzers.UnitTests/MSTest.Analyzers.UnitTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/Microsoft.Testing.*/Microsoft.Testing.*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests/Microsoft.Testing.Platform.Acceptance.IntegrationTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSTest.Acceptance.IntegrationTests.csproj" />
</ItemGroup>

<!-- When building MSTest only on windows OS -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'mstest' AND '$(OS)' == 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)MSTest.slnf" />
</ItemGroup>
<!-- When building MSTest only on windows OS -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'mstest' AND '$(OS)' == 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)MSTest.slnf" />
</ItemGroup>

<!-- When building MSTest only on non-windows OSes -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'mstest' AND '$(OS)' != 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)src/Adapter/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/Analyzers/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/Package/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/TestFramework/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/MSTest.Analyzers.UnitTests/MSTest.Analyzers.UnitTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSTest.Acceptance.IntegrationTests.csproj" />
</ItemGroup>

<!-- When building Microsoft.Testing.Platform only -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'testing-platform' ">
<ProjectToBuild Include="$(RepoRoot)Microsoft.Testing.Platform.slnf" />
</ItemGroup>
<!-- When building MSTest only on non-windows OSes -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'mstest' AND '$(OS)' != 'Windows_NT' ">
<ProjectToBuild Include="$(RepoRoot)src/Adapter/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/Analyzers/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/Package/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)src/TestFramework/**/*.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/UnitTests/MSTest.Analyzers.UnitTests/MSTest.Analyzers.UnitTests.csproj" />
<ProjectToBuild Include="$(RepoRoot)test/IntegrationTests/MSTest.Acceptance.IntegrationTests/MSTest.Acceptance.IntegrationTests.csproj" />
</ItemGroup>

<!-- When building Microsoft.Testing.Platform only -->
<ItemGroup Condition=" '$(ProductsToBuild)' == 'testing-platform' ">
<ProjectToBuild Include="$(RepoRoot)Microsoft.Testing.Platform.slnf" />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
10 changes: 10 additions & 0 deletions eng/DotNetBuild.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!-- When altering this file, please include @dotnet/product-construction as a reviewer. -->

<Project>

<PropertyGroup>
<GitHubRepositoryName>testfx</GitHubRepositoryName>
<SourceBuildManagedOnly>true</SourceBuildManagedOnly>
</PropertyGroup>

</Project>
9 changes: 9 additions & 0 deletions eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- When altering this file or making other Source Build related changes, include @dotnet/source-build as a reviewer. -->
<!-- See aka.ms/dotnet/prebuilts for guidance on what pre-builts are and how to eliminate them. -->

<UsageData>
<IgnorePatterns>
<!-- These are coming in via runtime but the source-build infra isn't able to automatically pick up the right intermediate. -->
<UsagePattern IdentityGlob="Microsoft.NET.ILLink.Tasks/*9.0.*" />
</IgnorePatterns>
</UsageData>
24 changes: 24 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,29 @@
<Uri>https://github.com/microsoft/testanywhere</Uri>
<Sha>aa2fcc8616d988b234bc1d218465b20c56d0b82f</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.diagnostics" Version="9.0.0-preview.24566.1">
<Uri>https://github.com/dotnet/diagnostics</Uri>
<Sha>8c505ca6921b5f7e9b8acc234cc8f15035537ee4</Sha>
<SourceBuild RepoName="diagnostics" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24175.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
<Sha>4df883d781a4290873b3b968afc0ff0df7132507</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="10.0.561001">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>94798e07efab2663f2d1a71862780bc365d2e3ab</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.24604.4">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>45d845e04c05fbe5da9838c454bbc3af1df6be81</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
</ToolsetDependencies>
</Dependencies>

0 comments on commit 056912d

Please sign in to comment.