Skip to content

Commit 78c5c6e

Browse files
committed
Integrate Solution SDK into legacy solutions
- This starts small with very specific properties set. - A little bit improvisation in recognition of un-supported projects and eliminating them from the Build process.
1 parent d9c591f commit 78c5c6e

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

Directory.Build.rsp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
-NoLogo
2-
-Restore
32
-MaxCPUCount
43
-BinaryLogger
54
-NodeReuse:False

Directory.Solution.props

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
<RestoreUseStaticGraphEvaluation>True</RestoreUseStaticGraphEvaluation>
77
</PropertyGroup>
88

9-
<PropertyGroup Label="Solution">
10-
<ImportByWildcardAfterSolution>False</ImportByWildcardAfterSolution>
11-
<ImportByWildcardBeforeSolution>False</ImportByWildcardBeforeSolution>
12-
</PropertyGroup>
9+
<!-- Integrate with the Solution SDK for Legacy Solution files -->
10+
<Import Sdk="MSBuild.Solution.Sdk" Project="Sdk.Legacy.props"/>
1311

1412
</Project>

Directory.Solution.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project>
22

3-
<!-- Enable Solution-wide Package Restore through our SDK -->
4-
<Import Sdk="MSBuild.NET.Legacy.Sdk" Project="NuGet.Restore.targets"/>
3+
<!-- Integrate with the Solution SDK for Legacy Solution files -->
4+
<Import Sdk="MSBuild.Solution.Sdk" Project="Sdk.Legacy.targets"/>
55

66
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Project>
2+
3+
<PropertyGroup Label="Solution">
4+
<ImportByWildcardAfterSolution>False</ImportByWildcardAfterSolution>
5+
<ImportByWildcardBeforeSolution>False</ImportByWildcardBeforeSolution>
6+
</PropertyGroup>
7+
8+
<!-- Enable Solution-wide Central Package Management through our SDK -->
9+
<Import Sdk="NuGet.Build.Sdk" Project="Sdk.Extensions.props"/>
10+
11+
</Project>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project>
2+
3+
<Target Name="RemoveUnSupportedProjectsFromRestore"
4+
BeforeTargets="Restore;_LoadRestoreGraphEntryPoints;_GenerateProjectRestoreGraphPerFramework;_GenerateRestoreProjectPathItemsPerFramework">
5+
<ItemGroup>
6+
<UnSupportedProjectReference Include="@(ProjectReference->WithMetadataValue('Extension', '.nuproj'))" />
7+
<ProjectReference Remove="@(UnSupportedProjectReference)" />
8+
</ItemGroup>
9+
<Message Importance="High" Condition="@(UnSupportedProjectReference->Count()) > 0"
10+
Text="Restore is not currently supported for NuGet packaging projects (i.e., MSBuild projects with file extension 'nuproj')."/>
11+
</Target>
12+
13+
<!-- Enable Solution-wide Package Restore through our SDK -->
14+
<Import Sdk="NuGet.Build.Sdk" Project="Sdk.Restore.targets" />
15+
16+
</Project>

global.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{
44
"MSBuild.Core.Sdk": "1.0.0-dev.*",
55
"MSBuild.Common.Sdk": "1.0.0-dev.*",
6+
"MSBuild.Solution.Sdk": "1.0.0-dev.*",
67

78
"MSBuild.NET.Sdk": "1.0.0-dev.*",
89
"MSBuild.NET.Legacy.Sdk": "1.0.0-dev.*",

0 commit comments

Comments
 (0)