-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Move VirtualProjectBuilder to FileBasedPrograms source package #54773
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
Merged
jjonescz
merged 41 commits into
dotnet:main
from
jjonescz:78887-sprint-MSBuildWorkspace
Jul 29, 2026
Merged
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
901b2de
Move VirtualProjectBuilder to FileBasedPrograms source package
jjonescz 60921e6
Use interface
jjonescz 1269981
Add GetRawXml API
jjonescz accfe2a
Move utilities out of a subdir
jjonescz 0bf62d8
Fixup dotnet-watch
jjonescz a74e451
Add CoreUtils to cli.slnf
jjonescz e915092
Move `#:ref` handling into `VirtualProjectBuilder`
jjonescz 0f3a87a
Fixup test project's build
jjonescz 3a5ef2a
Fixup API list
jjonescz 6706e73
Add metadata to virtual project references
jjonescz d939b8e
Fix a leak
jjonescz a760d75
Fixup API list
jjonescz 11aa673
Fix broken GC tests
jjonescz b9afbc8
Rename build service
jjonescz e310b9c
Make FileBasedPrograms source package independent on CSharp
jjonescz d532635
Improve TFM condition
jjonescz 2dcbab5
Ensure LanguageService is source-shareable
jjonescz 983b5fa
Revert "Ensure LanguageService is source-shareable"
jjonescz 4d3345f
Revert "Make FileBasedPrograms source package independent on CSharp"
jjonescz 250b879
Revert changes to cli.slnf
jjonescz 50b5fd9
Add global build properties to source package
jjonescz b5a9d32
Merge branch 'release/10.0.4xx' into 78887-sprint-MSBuildWorkspace
jjonescz 6f593ad
Fixup netstandard build
jjonescz e8e2526
Allow customizing temp subdirectory
jjonescz 386bdee
Preserve GetFullPath semantics
jjonescz 9c9241c
Avoid reliance on STJ
jjonescz 6334b0a
Avoid storing computable default properties
jjonescz c0b247f
Allow using default target framework
jjonescz 958b7d0
Document IBuildService
jjonescz 457bbeb
Fixup PublicAPI list
jjonescz ad6e798
Move ProjectRootElement cache into ProjectTools
jjonescz daddbca
Merge global properties inside the API
jjonescz 8d3fb83
Merge branch 'main' into 78887-sprint-MSBuildWorkspace
jjonescz 13afc04
Set root namespace in FBP package
jjonescz a2accd3
Add a comment
jjonescz 9c0641c
Remove blank lines
jjonescz 2a855ee
Get all item metadata values at once
jjonescz ef0e2a5
Fixup project convert command
jjonescz fd9eeb5
Make IBuildService async
jjonescz c38da23
Fixup dotnet-watch
jjonescz 122a847
Add `ConfigureAwait(false)`
jjonescz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| #nullable enable | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace Microsoft.DotNet.Utilities; | ||
|
|
||
| internal static class Extensions | ||
| { | ||
| #if !NET | ||
| public static HashSet<T> ToHashSet<T>(this IEnumerable<T> source, IEqualityComparer<T> comparer) | ||
| { | ||
| return new HashSet<T>(source, comparer); | ||
| } | ||
| #endif | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86 changes: 86 additions & 0 deletions
86
src/Cli/Microsoft.DotNet.FileBasedPrograms/IBuildService.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| #nullable enable | ||
|
|
||
| using System.Collections.Generic; | ||
| using System.Collections.Immutable; | ||
| using System.Threading.Tasks; | ||
| using System.Xml; | ||
|
|
||
| namespace Microsoft.DotNet.FileBasedPrograms; | ||
|
|
||
| /// <summary> | ||
| /// The root interface for our abstraction over MSBuild APIs. | ||
| /// This is used by <c>VirtualProjectBuilder</c> so that it can be used | ||
| /// both by dotnet CLI (which uses MSBuild APIs directly) | ||
| /// and by roslyn IDE (which uses MSBuild through RPC). | ||
| /// </summary> | ||
| #if FILE_BASED_PROGRAMS_PUBLIC | ||
| public | ||
| #else | ||
| internal | ||
| #endif | ||
| interface IBuildService | ||
| { | ||
| /// <summary> | ||
| /// An abstraction over MSBuild's <c>ProjectInstance.FromProjectRootElement</c> method. | ||
| /// </summary> | ||
| /// <param name="additionalGlobalProperties"> | ||
| /// NOTE: Unlike the MSBuild API, these properties are automatically merged with <paramref name="projectCollection"/>'s global properties | ||
| /// (the latter come first, so the former can overwrite them). | ||
| /// </param> | ||
| ValueTask<IProjectInstance> CreateProjectInstanceFromProjectRootElementAsync( | ||
| IProjectRootElement projectRoot, | ||
| IProjectCollection projectCollection, | ||
| IDictionary<string, string>? additionalGlobalProperties); | ||
|
|
||
| /// <summary> | ||
| /// An abstraction over MSBuild's <c>ProjectRootElement.Create</c> method. | ||
| /// </summary> | ||
| IProjectRootElement CreateProjectRootElement(XmlReader xmlReader, IProjectCollection projectCollection, string entryPointFilePath); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An abstraction of MSBuild's <c>ProjectCollection</c>. | ||
| /// </summary> | ||
| /// <seealso cref="IBuildService"/> | ||
| #if FILE_BASED_PROGRAMS_PUBLIC | ||
| public | ||
| #else | ||
| internal | ||
| #endif | ||
| interface IProjectCollection | ||
| { | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An abstraction of MSBuild's <c>ProjectInstance</c>. | ||
| /// </summary> | ||
| /// <seealso cref="IBuildService"/> | ||
| #if FILE_BASED_PROGRAMS_PUBLIC | ||
| public | ||
| #else | ||
| internal | ||
| #endif | ||
| interface IProjectInstance | ||
| { | ||
| ValueTask<ImmutableArray<ImmutableArray<string>>> GetItemMetadataValuesAsync(string itemType, ImmutableArray<string> metadataNames); | ||
| ValueTask<string> GetPropertyValueAsync(string propertyName); | ||
| ValueTask<string> ExpandStringAsync(string value); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// An abstraction of MSBuild's <c>ProjectRootElement</c>. | ||
| /// </summary> | ||
| /// <seealso cref="IBuildService"/> | ||
| #if FILE_BASED_PROGRAMS_PUBLIC | ||
| public | ||
| #else | ||
| internal | ||
| #endif | ||
| interface IProjectRootElement | ||
| { | ||
| string? FullPath { get; set; } | ||
| string GetRawXml(); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.