Skip to content

Commit 56d721b

Browse files
authored
Add Customizations.props and change extension point (#1188)
* Import Customizations.props after the project file Import Customizations.props after the project file so that it can modify the project content via property or item operations. * Add Customizations.props files for 4 projects
1 parent d3518f3 commit 56d721b

File tree

10 files changed

+49
-24
lines changed

10 files changed

+49
-24
lines changed

src/referencePackages/Directory.Build.props

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@
22

33
<Import Project="..\..\Directory.Build.props" />
44

5-
<PropertyGroup>
6-
<CustomizationsPropsPath>$(MSBuildProjectDirectory)\$(CustomizationsPropsFile)</CustomizationsPropsPath>
7-
<CustomizationsSourcePath>$(MSBuildProjectDirectory)\$(CustomizationsSourceFile)</CustomizationsSourcePath>
8-
</PropertyGroup>
9-
10-
<!-- Customization extension point -->
11-
<Import Project="$(CustomizationsPropsPath)" Condition="Exists('$(CustomizationsPropsPath)')" />
12-
13-
<ItemGroup>
14-
<!-- Attributes for all Reference Packages -->
15-
<Compile Include="$(RepoRoot)src\SourceBuildAssemblyMetdata.cs" />
16-
17-
<!-- Customization extension point -->
18-
<Compile Include="$(CustomizationsSourcePath)" Condition="Exists('$(CustomizationsSourcePath)')" />
19-
</ItemGroup>
20-
215
<PropertyGroup>
226
<!-- Common properties for all Reference Packages -->
237
<DebugType>None</DebugType>

src/referencePackages/Directory.Build.targets

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@
22

33
<Import Project="..\..\Directory.Build.targets" />
44

5+
<PropertyGroup>
6+
<CustomizationsPropsPath>$(MSBuildProjectDirectory)\$(CustomizationsPropsFile)</CustomizationsPropsPath>
7+
<CustomizationsSourcePath>$(MSBuildProjectDirectory)\$(CustomizationsSourceFile)</CustomizationsSourcePath>
8+
</PropertyGroup>
9+
510
<ItemGroup>
611
<Compile Include="ref/$(TargetFramework)/*$(DefaultLanguageSourceExtension)" />
712
<Compile Include="lib/$(TargetFramework)/*$(DefaultLanguageSourceExtension)" />
13+
14+
<!-- Attributes for all Reference Packages -->
15+
<Compile Include="$(RepoRoot)src\SourceBuildAssemblyMetdata.cs" />
16+
17+
<!-- Customization extension point -->
18+
<Compile Include="$(CustomizationsSourcePath)" Condition="Exists('$(CustomizationsSourcePath)')" />
819
</ItemGroup>
920

21+
<!-- Customization extension point -->
22+
<Import Project="$(CustomizationsPropsPath)" Condition="Exists('$(CustomizationsPropsPath)')" />
23+
1024
<!--
1125
### Targeting Packs section ###
1226
Keep in sync with available targeting packs under src/targetPacks/ILsrc.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<!-- Microsoft.VisualStudio.Setup.Configuration.Interop was accidentally exposed by the product. -->
5+
<PackageReference Remove="Microsoft.VisualStudio.Setup.Configuration.Interop" />
6+
</ItemGroup>
7+
8+
</Project>

src/referencePackages/src/microsoft.build.tasks.core/17.8.3/Microsoft.Build.Tasks.Core.17.8.3.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
1515
<PackageReference Include="System.Security.Cryptography.Pkcs" Version="7.0.2" />
1616
<PackageReference Include="System.Security.Cryptography.Xml" Version="7.0.1" />
17-
<!-- Microsoft.VisualStudio.Setup.Configuration.Interop was accidentally exposed by the product.
18-
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" /> -->
17+
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" />
1918
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
2019
</ItemGroup>
2120

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<!-- Microsoft.VisualStudio.Setup.Configuration.Interop was accidentally exposed by the product. -->
5+
<PackageReference Remove="Microsoft.VisualStudio.Setup.Configuration.Interop" />
6+
</ItemGroup>
7+
8+
</Project>

src/referencePackages/src/microsoft.build.utilities.core/17.8.3/Microsoft.Build.Utilities.Core.17.8.3.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
99
<PackageReference Include="Microsoft.Build.Framework" Version="17.8.3" />
1010
<PackageReference Include="Microsoft.NET.StringTools" Version="17.8.3" />
11-
<!-- Microsoft.VisualStudio.Setup.Configuration.Interop was accidentally exposed by the product.
12-
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" /> -->
11+
<PackageReference Include="Microsoft.VisualStudio.Setup.Configuration.Interop" Version="3.2.2146" />
1312
<PackageReference Include="System.Collections.Immutable" Version="7.0.0" />
1413
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
1514
</ItemGroup>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<ItemGroup>
4+
<!-- Analyzers are excluded from SBRPs -->
5+
<PackageReference Remove="Microsoft.CodeAnalysis.Analyzers" />
6+
</ItemGroup>
7+
8+
</Project>

src/referencePackages/src/microsoft.codeanalysis.common/4.1.0/Microsoft.CodeAnalysis.Common.4.1.0.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
10-
<!-- Analyzers are excluded from SBRPs
11-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" /> -->
10+
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" />
1211
<PackageReference Include="System.Collections.Immutable" Version="5.0.0" />
1312
<PackageReference Include="System.Memory" Version="4.5.4" />
1413
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Project>
2+
3+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
4+
<!-- Necessary for PermissionSet types but as a dangling compile-time only reference. -->
5+
<ProjectReference Include="../../system.security.permissions/7.0.0/System.Security.Permissions.7.0.0.csproj" PrivateAssets="all" />
6+
</ItemGroup>
7+
8+
</Project>

src/referencePackages/src/system.configuration.configurationmanager/8.0.0/System.Configuration.ConfigurationManager.8.0.0.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
</ItemGroup>
2222

2323
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
24-
<!-- Necessary for PermissionSet types but as a dangling compile-time only reference. -->
25-
<PackageReference Include="System.Security.Permissions" Version="7.0.0" PrivateAssets="all" />
2624
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
2725
</ItemGroup>
2826

0 commit comments

Comments
 (0)