QoL | Enable incremental build in Visual Studio#3993
Open
edwardneal wants to merge 1 commit intodotnet:mainfrom
Open
QoL | Enable incremental build in Visual Studio#3993edwardneal wants to merge 1 commit intodotnet:mainfrom
edwardneal wants to merge 1 commit intodotnet:mainfrom
Conversation
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.
Description
At present, Visual Studio builds are fairly slow - even when changing tests, the SqlClient projects are fully rebuilt. This PR makes the
GenerateThisAssemblyCstarget support incremental build, cutting the rebuild times dramatically (particularly noticeable when changing and running tests.)Variations of GenerateThisAssemblyCs appear in a few places in dotnet/runtime. Microsoft.XmlSerializer.Generator has a fairly similar copy. System.Diagnostics.DiagnosticSource chooses a slightly different wrapper: a simple
_GenerateThisAssemblyInfotarget in the project file. I've hemmed more closely to the first of these places.The core changes are twofold:
InputsandOutputson the target, to indicate that it supports incremental build.ThisAssembly.csto theFileWritesitem, ensuring that a clean will remove it when needed.I also noticed that the license header was missing from the generated file, so added it for completeness' sake. There were also two path separators in the output location, so I removed the second of these.
Issues
None.
Testing
Tested rebuilds with Visual Studio. Confirmed that this file is removed by the Clean target.