Skip to content

Commit a7336b1

Browse files
authored
Enable interceptors implicitly in binder gen nupkg when generator is enabled (#91469)
* Enable interceptors implicitly in binder gen nupkg when generator is enabled * Simplify impl & remove unneeded target
1 parent 9eb0266 commit a7336b1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/libraries/Microsoft.Extensions.Configuration.Binder/src/buildTransitive/Microsoft.Extensions.Configuration.Binder.targets

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<Project InitialTargets="NETStandardCompatError_Microsoft_Extensions_Configuration_Binder">
2-
<Target Name="_Microsoft_Extensions_Configuration_BinderRemoveAnalyzer"
2+
<PropertyGroup Condition="'$(EnableConfigurationBindingGenerator)' == 'true'">
3+
<!-- The configuration binding source generator uses a preview version of the compiler interceptors feature. Enable it implicitly when the generator is enabled. -->
4+
<InterceptorsPreviewNamespaces>$(InterceptorsPreviewNamespaces);Microsoft.Extensions.Configuration.Binder.SourceGeneration</InterceptorsPreviewNamespaces>
5+
</PropertyGroup>
6+
7+
<Target Name="_Microsoft_Extensions_Configuration_Binder_RemoveAnalyzer"
38
Condition="'$(EnableConfigurationBindingGenerator)' != 'true'"
49
AfterTargets="ResolvePackageDependenciesForBuild;ResolveNuGetPackageAssets">
510

@@ -8,8 +13,8 @@
813
</ItemGroup>
914
</Target>
1015

11-
<Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_Binder"
12-
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
16+
<Target Name="NETStandardCompatError_Microsoft_Extensions_Configuration_Binder"
17+
Condition="'$(SuppressTfmSupportBuildWarnings)' == ''">
1318
<PropertyGroup>
1419
<_Microsoft_Extensions_Configuration_Binder_Compatible_TargetFramework
1520
Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netcoreapp2.0')) AND

0 commit comments

Comments
 (0)