Repository navigation
Exclude snapshot files from the build - #2034
Open
SimonCropp wants to merge 2 commits into
Open
SimonCropp wants to merge 2 commits into
SimonCropp wants to merge 2 commits into
Conversation
A snapshot can have any extension, and many extensions mean something to the build: .verified.cs is compiled, .verified.resx embedded, .xaml compiled as a page, .razor/.cshtml compiled, and the Web and Worker SDKs copy .json and .config snapshots to the output and publish directories. Snapshots are now removed from the default Compile, EmbeddedResource, Content, Page, ApplicationDefinition, MauiXaml and AvaloniaXaml items and left as None. Content snapshots move to None with their metadata, keeping any DependentUpon but not their copy settings. Opt out with DisableVerifySnapshotExclusion.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A snapshot can have any extension, and many extensions mean something to the build:
.verified.cs/.verified.vbare compiled.verified.resxis embedded.verified.xamlis compiled as a page.verified.razor/.verified.cshtmlare compiled as components and views.verified.jsonand.verified.configto the output and publish directoriesVerify.targetsnow removes snapshot files from the defaultCompile,EmbeddedResource,Content,Page,ApplicationDefinition,MauiXamlandAvaloniaXamlitems and leaves them asNone, so they still show nested in the IDE.Verify.targets, notVerify.AfterMicrosoftNetSdk.props, because the Razor, Web and Worker SDKs glob theirContentafter that props file.Contentsnapshot is moved toNonewith its metadata, so it keeps its nesting and any explicitDependentUpon. Its copy settings are cleared.EnableDefaultCompileItems=false).<DisableVerifySnapshotExclusion>true</DisableVerifySnapshotExclusion>.Behaviour change: a project that explicitly includes snapshots as
Contentnow gets them asNone, since MSBuild cannot tell those apart from the SDK's default items. The opt-out restores the old behaviour.FileNestingTestsnow also reportCompileandEmbeddedResourceitems and copy metadata, with new cases for source/resource snapshots, Razor/cshtml snapshots and the opt-out. The opt-out case shows the current behaviour:.verified.csis compiled and.verified.resxembedded.Once this ships,
build/Verify.SourceGenerators.targetsin Verify.SourceGenerators is redundant: it only removes*.verified.cs/*.received.csfromCompile.