-
Notifications
You must be signed in to change notification settings - Fork 121
Support incremental code generation in Visual Studio 2022 #355
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
42defdc
Move Microsoft.Windows.CsWin32 content to a shared project
sharwell c603af7
Create a separate project for packaging
sharwell 1f81a80
Rename assembly to indicate Roslyn version
sharwell 8a41134
Add package to support Roslyn 4.0
sharwell 61fcdde
Update Microsoft.Windows.CsWin32.Roslyn40 to Roslyn 4.0
sharwell b7abbee
Make LanguageVersion an incremental value
sharwell 39dca00
Make configuration files an incremental value
sharwell 2f79360
Make global configuration an incremental value
sharwell 518637c
Merge remote-tracking branch 'microsoft/main' into roslyn4
sharwell 0c06196
Use Roslyn component versioning for 4.0+
sharwell 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
31 changes: 31 additions & 0 deletions
31
src/Microsoft.Windows.CsWin32.Package/Microsoft.Windows.CsWin32.Package.csproj
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,31 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>netstandard2.0</TargetFramework> | ||
| <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
| <GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
|
|
||
| <!-- Special properties for analyzer packages. --> | ||
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <IncludeSymbols>false</IncludeSymbols> | ||
| <NoWarn>$(NoWarn);NU5128;NU5127</NoWarn> | ||
| </PropertyGroup> | ||
|
|
||
| <PropertyGroup> | ||
| <NuSpecFile>Microsoft.Windows.CsWin32.nuspec</NuSpecFile> | ||
|
|
||
| <PackageId>Microsoft.Windows.CsWin32</PackageId> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\Microsoft.Windows.CsWin32\Roslyn38\Microsoft.Windows.CsWin32.Roslyn38.csproj" Private="true" ReferenceOutputAssembly="false" /> | ||
| <ProjectReference Include="..\Microsoft.Windows.CsWin32\Roslyn40\Microsoft.Windows.CsWin32.Roslyn40.csproj" Private="true" ReferenceOutputAssembly="false" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <None Update="readme.txt" Pack="true" PackagePath="" /> | ||
| <None Include="build\**" Pack="true" PackagePath="build\" /> | ||
| </ItemGroup> | ||
|
|
||
| <Import Project="$(MSBuildProjectName).targets" /> | ||
| </Project> | ||
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
70 changes: 70 additions & 0 deletions
70
src/Microsoft.Windows.CsWin32.Package/Microsoft.Windows.CsWin32.nuspec
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,70 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd"> | ||
| <metadata> | ||
| <id>Microsoft.Windows.CsWin32</id> | ||
| <version>$version$</version> | ||
| <authors>Microsoft</authors> | ||
| <developmentDependency>true</developmentDependency> | ||
| <requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
| <license type="expression">MIT</license> | ||
| <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl> | ||
| <projectUrl>https://github.com/Microsoft/CsWin32</projectUrl> | ||
| <description>Microsoft Windows SDK Win32 API Source Generator</description> | ||
| <releaseNotes>$PackageReleaseNotes$</releaseNotes> | ||
| <readme>README.md</readme> | ||
| <copyright>© Microsoft Corporation. All rights reserved.</copyright> | ||
| <repository type="git" url="https://github.com/microsoft/CsWin32.git" commit="$commit$" /> | ||
| <dependencies> | ||
| <group targetFramework="net20"> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Metadata" version="$MetadataVersion$" include="buildTransitive" /> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Docs" version="$ApiDocsVersion$" include="buildTransitive" /> | ||
| </group> | ||
| <group targetFramework="net45"> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Metadata" version="$MetadataVersion$" include="buildTransitive" /> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Docs" version="$ApiDocsVersion$" include="buildTransitive" /> | ||
| <dependency id="System.Memory" version="4.5.4" include="All" /> | ||
| </group> | ||
| <group targetFramework=".NETStandard1.1"> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Metadata" version="$MetadataVersion$" include="buildTransitive" /> | ||
| <dependency id="Microsoft.Windows.SDK.Win32Docs" version="$ApiDocsVersion$" include="buildTransitive" /> | ||
| <dependency id="System.Memory" version="4.5.4" include="All" /> | ||
| </group> | ||
| </dependencies> | ||
| </metadata> | ||
| <files> | ||
| <!-- Roslyn 3.8 --> | ||
| <file src="$BaseOutputPath38$Microsoft.Windows.SDK.Win32Docs.dll" target="build\analyzers\dotnet\roslyn3.8\cs\Microsoft.Windows.SDK.Win32Docs.dll" /> | ||
| <file src="$BaseOutputPath38$Microsoft.Windows.CsWin32.Roslyn38.dll" target="build\analyzers\dotnet\roslyn3.8\cs\Microsoft.Windows.CsWin32.dll" /> | ||
| <file src="$BaseOutputPath38$MessagePack.dll" target="build\analyzers\dotnet\roslyn3.8\cs\MessagePack.dll" /> | ||
| <file src="$BaseOutputPath38$MessagePack.Annotations.dll" target="build\analyzers\dotnet\roslyn3.8\cs\MessagePack.Annotations.dll" /> | ||
| <file src="$BaseOutputPath38$Microsoft.Bcl.AsyncInterfaces.dll" target="build\analyzers\dotnet\roslyn3.8\cs\Microsoft.Bcl.AsyncInterfaces.dll" /> | ||
| <file src="$BaseOutputPath38$System.Text.Json.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Text.Json.dll" /> | ||
| <file src="$BaseOutputPath38$System.Text.Encodings.Web.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Text.Encodings.Web.dll" /> | ||
| <file src="$BaseOutputPath38$System.Numerics.Vectors.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Numerics.Vectors.dll" /> | ||
| <file src="$BaseOutputPath38$System.Threading.Tasks.Extensions.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Threading.Tasks.Extensions.dll" /> | ||
| <file src="$BaseOutputPath38$System.Memory.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Memory.dll" /> | ||
| <file src="$BaseOutputPath38$System.Buffers.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Buffers.dll" /> | ||
| <file src="$BaseOutputPath38$System.Runtime.CompilerServices.Unsafe.dll" target="build\analyzers\dotnet\roslyn3.8\cs\System.Runtime.CompilerServices.Unsafe.dll" /> | ||
|
|
||
| <!-- Roslyn 4.0 --> | ||
| <file src="$BaseOutputPath40$Microsoft.Windows.SDK.Win32Docs.dll" target="build\analyzers\dotnet\roslyn4.0\cs\Microsoft.Windows.SDK.Win32Docs.dll" /> | ||
| <file src="$BaseOutputPath40$Microsoft.Windows.CsWin32.Roslyn40.dll" target="build\analyzers\dotnet\roslyn4.0\cs\Microsoft.Windows.CsWin32.dll" /> | ||
| <file src="$BaseOutputPath40$MessagePack.dll" target="build\analyzers\dotnet\roslyn4.0\cs\MessagePack.dll" /> | ||
| <file src="$BaseOutputPath40$MessagePack.Annotations.dll" target="build\analyzers\dotnet\roslyn4.0\cs\MessagePack.Annotations.dll" /> | ||
| <file src="$BaseOutputPath40$Microsoft.Bcl.AsyncInterfaces.dll" target="build\analyzers\dotnet\roslyn4.0\cs\Microsoft.Bcl.AsyncInterfaces.dll" /> | ||
| <file src="$BaseOutputPath40$System.Text.Json.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Text.Json.dll" /> | ||
| <file src="$BaseOutputPath40$System.Text.Encodings.Web.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Text.Encodings.Web.dll" /> | ||
| <file src="$BaseOutputPath40$System.Numerics.Vectors.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Numerics.Vectors.dll" /> | ||
| <file src="$BaseOutputPath40$System.Threading.Tasks.Extensions.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Threading.Tasks.Extensions.dll" /> | ||
| <file src="$BaseOutputPath40$System.Memory.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Memory.dll" /> | ||
| <file src="$BaseOutputPath40$System.Buffers.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Buffers.dll" /> | ||
| <file src="$BaseOutputPath40$System.Runtime.CompilerServices.Unsafe.dll" target="build\analyzers\dotnet\roslyn4.0\cs\System.Runtime.CompilerServices.Unsafe.dll" /> | ||
|
|
||
| <!-- Common files --> | ||
| <file src="readme.txt" target="readme.txt" /> | ||
| <file src="..\..\README.md" target="README.md" /> | ||
| <file src="..\..\NOTICE.txt" target="NOTICE.txt" /> | ||
| <file src="build\**" target="build\" /> | ||
| <file src="tools\**" target="tools\" /> | ||
| </files> | ||
| </package> |
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
src/Microsoft.Windows.CsWin32.Package/build/Microsoft.Windows.CsWin32.targets
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,21 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
|
||
| <Target Name="_CsWin32GatherAnalyzers"> | ||
| <ItemGroup> | ||
| <_CsWin32Analyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'Microsoft.Windows.CsWin32'" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| <Target Name="_CsWin32AnalyzerMultiTargeting" | ||
| Condition="'$(SupportsRoslynComponentVersioning)' != 'true'" | ||
| AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets" | ||
| DependsOnTargets="_CsWin32GatherAnalyzers"> | ||
|
|
||
| <ItemGroup> | ||
| <!-- Remove our analyzers targeting roslyn 4+ --> | ||
| <Analyzer Remove="@(_CsWin32Analyzer)" | ||
| Condition="$([System.String]::Copy('%(_CsWin32Analyzer.Identity)').IndexOf('roslyn3')) < 0"/> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| </Project> |
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
src/Microsoft.Windows.CsWin32.Package/build/netstandard1.0/Microsoft.Windows.CsWin32.props
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,3 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="..\$(MSBuildThisFileName)$(MSBuildThisFileExtension)" /> | ||
| </Project> |
3 changes: 3 additions & 0 deletions
3
src/Microsoft.Windows.CsWin32.Package/build/netstandard1.0/Microsoft.Windows.CsWin32.targets
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,3 @@ | ||
| <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <Import Project="..\$(MSBuildThisFileName)$(MSBuildThisFileExtension)" /> | ||
| </Project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 The Roslyn38 and Roslyn40 subfolders seemed the easiest way to achieve all of: