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

Upstream changes from Vertical Build PoC #71666

Merged
merged 17 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<Target Name="ConfigureInnerBuildArg" BeforeTargets="GetSourceBuildCommandConfiguration">
<PropertyGroup>
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)\Roslyn.sln"</InnerBuildArgs>
<InnerBuildArgs>$(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)Roslyn.sln"</InnerBuildArgs>
</PropertyGroup>
</Target>

Expand Down
3 changes: 1 addition & 2 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,7 @@ try {
Setup-IntegrationTestRun
}

$global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet"
InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet
$dotnet = (InitializeDotNetCli -install:$true)
}

if ($restore) {
Expand Down
10 changes: 10 additions & 0 deletions eng/targets/Imports.BeforeArcade.targets
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@
<UseAppHost>false</UseAppHost>
</PropertyGroup>

<!-- TODO: Remove when roslyn updates to Arcade 9.
Arcade provides the IsTestUtilityProject handling natively there,
setting IsShipping=false in those cases, and excluding them from the build
when in source build or vertical build modes. Note, at a later date tests will
be built by default in vertical mode. -->
<PropertyGroup Condition="'$(IsTestUtilityProject)' == 'true'">
<IsShipping>false</IsShipping>
mmitche marked this conversation as resolved.
Show resolved Hide resolved
<ExcludeFromBuild Condition="'$(DotNetBuildFromSource)' == 'true' or '$(DotNetBuildVertical)' == 'true'">true</ExcludeFromBuild>
mmitche marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Microsoft.CodeAnalysis</RootNamespace>
<TargetFramework>net472</TargetFramework>
<DefineConstants>$(DefineConstants),CODE_STYLE</DefineConstants>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\Features\DiagnosticsTestUtilities\CodeActionsLegacy\AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs" Link="TestFramework\AbstractCodeActionOrUserDiagnosticTest_NoEditor.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Microsoft.CodeAnalysis</RootNamespace>
<TargetFramework>net472</TargetFramework>
<DefineConstants>$(DefineConstants),CODE_STYLE</DefineConstants>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\Features\DiagnosticsTestUtilities\CodeActions\AnalyzerProperty.cs" Link="AnalyzerProperty.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<OutputType>Library</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks>
<IsShipping>false</IsShipping>
<IsPackable>true</IsPackable>
<PackageId>Microsoft.CodeAnalysis.Test.Utilities</PackageId>
<PackageDescription>This is an internal package for testing. Not meant for external or production uses. The API can and will break at our discretion.</PackageDescription>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Compilers\Test\Resources\Core\Microsoft.CodeAnalysis.Compiler.Test.Resources.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<RootNamespace></RootNamespace>
<EnableDefaultItems>false</EnableDefaultItems>
<IsShipping>false</IsShipping>
<IsPackable>true</IsPackable>
<PackageId>Microsoft.CodeAnalysis.Compiler.Test.Resources</PackageId>
<PackageDescription>This is an internal package for testing. Not meant for external or production uses. The API can and will break at our discretion.</PackageDescription>
<NoWarn>NU5100,NU5106,CS1591</NoWarn>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<TargetFrameworks>$(NetRoslyn);net472</TargetFrameworks>
<NoStdLib>true</NoStdLib>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Microsoft.CodeAnalysis.VisualBasic.UnitTests</RootNamespace>
<NoWarn>$(NoWarn);42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
<TargetFrameworks>$(NetRoslyn);net472</TargetFrameworks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\..\Test\PdbUtilities\Roslyn.Test.PdbUtilities.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<!-- Prevents ambiguity caused by InternalsVisibleTo from dependent assemblies. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<RootNamespace></RootNamespace>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler.Utilities</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="File References">
<Reference Include="System" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AssemblyName>Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>net472</TargetFramework>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>

<!-- Disable CA1825 (Avoid unnecessary zero-length array allocations. Use Array.Empty<X>() instead) as Array.Empty not available in one of the targets for this shared project -->
<NoWarn>$(NoWarn);CA1825</NoWarn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<!-- Prevents ambiguity caused by InternalsVisibleTo from dependent assemblies. -->
Expand Down
4 changes: 4 additions & 0 deletions src/NuGet/VisualStudio/VS.ExternalAPIs.Roslyn.Package.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"The assembly '...' is not inside the 'lib' folder and hence it won't be added as a reference when the package is installed into a project."
-->
<NoWarn>$(NoWarn);NU5100</NoWarn>

<!-- Work around missing project dependencies. VS features not needed at this time:
https://github.com/dotnet/source-build/issues/3981. -->
<ExcludeFromVerticalBuild>true</ExcludeFromVerticalBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFrameworks>net472;$(NetRoslyn)</TargetFrameworks>
<NoStdLib>true</NoStdLib>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@
</Copy>
</Target>

<!-- TODO: https://github.com/dotnet/source-build/issues/3981 for where this should be excluded in vertical modes. -->
<Target Name="_GenerateSwrFile"
AfterTargets="Build"
BeforeTargets="SwixBuild"
DependsOnTargets="_SetSwrFilePath;InitializeDesktopCompilerArtifacts;_PrepareDesktopCompilerArtifactsForOptimization;ApplyOptimizations"
Outputs="$(_SwrFilePath)"
Condition="'$(DotNetBuildFromSource)' != 'true'">
Condition="'$(DotNetBuildFromSource)' != 'true' and '$(DotNetBuildVertical)' != 'true'">

<ItemGroup>
<_File Include="@(DesktopCompilerArtifact)">
Expand Down
3 changes: 3 additions & 0 deletions src/Setup/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<!-- TODO: https://github.com/dotnet/source-build/issues/3981
Remove if necessary. -->
<ExcludeFromVerticalBuild>true</ExcludeFromVerticalBuild>
Copy link
Member

Choose a reason for hiding this comment

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

Having both properties seems unnecessary. What code is excuded from the vertical build but included in source build?

Copy link
Member Author

Choose a reason for hiding this comment

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

Expect this to go away when the new Unified build controls come to this repo. That will happen after the implementation is complete (very soon) and when Roslyn moves to .NET 9 Arcade (late). Whenever you see both of these conditions, they would be replaced by ExcludeFromDotNetBuild

</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion src/Test/PdbUtilities/Roslyn.Test.PdbUtilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Roslyn.Test.PdbUtilities</RootNamespace>
<TargetFrameworks>$(NetRoslynAll);net472</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests" />
Expand Down
3 changes: 3 additions & 0 deletions src/Tools/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<!-- TODO: https://github.com/dotnet/source-build/issues/3981
Remove if necessary. -->
<ExcludeFromVerticalBuild>true</ExcludeFromVerticalBuild>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
A supporting package for ASP.NET Core:
https://github.com/dotnet/aspnetcore
</PackageDescription>
<!-- Referenced by dotnet/aspnetcore and included in SDK. Requires source build -->
<!-- Referenced by dotnet/aspnetcore and included in SDK. Required for source build/vertical build. -->
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
<ExcludeFromVerticalBuild>false</ExcludeFromVerticalBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
A supporting package for Razor:
https://github.com/dotnet/razor
</PackageDescription>
<ExcludeFromVerticalBuild>false</ExcludeFromVerticalBuild>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<OutputType Condition="'$(TargetFramework)' != 'netstandard2.0'">Exe</OutputType>
<RuntimeIdentifiers>$(RoslynPortableRuntimeIdentifiers)</RuntimeIdentifiers>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>false</ExcludeFromSourceBuild>
</PropertyGroup>
<ItemGroup>
<!-- Make sure to reference the same version of Microsoft.CodeAnalysis.Analyzers as the rest of the build -->
Expand Down
2 changes: 1 addition & 1 deletion src/Tools/Source/RunTests/RunTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<OutputType>Exe</OutputType>
<TargetFramework>$(NetRoslyn)</TargetFramework>
<SignAssembly>false</SignAssembly>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
Expand Down
3 changes: 3 additions & 0 deletions src/VisualStudio/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<!-- TODO: https://github.com/dotnet/source-build/issues/3981
Remove if necessary. -->
<ExcludeFromVerticalBuild>true</ExcludeFromVerticalBuild>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<TargetFramework>net472</TargetFramework>
<UseWpf>true</UseWpf>
<RootNamespace></RootNamespace>
<IsShipping>false</IsShipping>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
<OutputType>Library</OutputType>
<RootNamespace>Microsoft.CodeAnalysis.UnitTests</RootNamespace>
<TargetFrameworks>$(NetVS);net472</TargetFrameworks>
<IsShipping>false</IsShipping>
<ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
<IsTestUtilityProject>true</IsTestUtilityProject>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Test\Core\Microsoft.CodeAnalysis.Test.Utilities.csproj" />
Expand Down
Loading