From 9b983cdb25004589ec70295e3c487ec6ebeefe25 Mon Sep 17 00:00:00 2001 From: Nirmal Guru Date: Thu, 21 Jan 2021 08:16:08 +0530 Subject: [PATCH] Adding necessary targets for solution support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design and Target Graph not final — WIP --- .../Core/MSBuild.Core.targets | 189 +++++++++++++ .../Core/MSBuild.Core.targets | 262 ++++++++++++++++++ .../Core/MSBuild.Defaults.targets | 15 + .../Core/MSBuild.Defaults.targets | 39 +++ 4 files changed, 505 insertions(+) diff --git a/Sources/MSBuild.Common.Sdk/Core/MSBuild.Core.targets b/Sources/MSBuild.Common.Sdk/Core/MSBuild.Core.targets index 8d1670f6..0f469fc4 100644 --- a/Sources/MSBuild.Common.Sdk/Core/MSBuild.Core.targets +++ b/Sources/MSBuild.Common.Sdk/Core/MSBuild.Core.targets @@ -6,4 +6,193 @@ + + + + + + + + + + + + + + + + + + CollectProjectReferences;CollectPackageReferences + + PrepareProjectReferences;PreparePackageReferences + + ResolveProjectReferences;ResolvePackageReferences + + + + + RestoreCheck;ResolveReferences + + BuildCheck;BuildOnlySettings;ResolveReferences + + BuildCheck;CleanBuildFolder;PublishCheck;CleanPublishFolder;PrepareReferences + + + + + BuildCheck;Build + + BuildCheck;Build + + BuildCheck;Build + + + + + ResolveReferences + + ResolveReferences + + ResolveReferences + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + false + false + + + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectInSolution Condition="'$(MSBuildSolutionDirectory)' != ''">$(MSBuildProjectDirectory.StartsWith('$(MSBuildSolutionDirectory)')) + <_ProjectDirectory Condition="'$(MSBuildSolutionDirectory)' != '' AND '$(_ProjectInSolution)' == 'true'">$([MSBuild]::MakeRelative('$(MSBuildSolutionDirectory)', '$(MSBuildProjectDirectory)')) + <_ProjectDirectory Condition="'$(_ProjectDirectory)' == ''">$(MSBuildProjectDirectory) + + + + + <_ProjectMetadata Include="$(MSBuildProjectName)"> + $(MSBuildProjectType) + $(_ProjectDirectory) + $(_ProjectInSolution) + $(UsingMSBuildSdk) + $(Configurations) + $(Platforms) + + + + + + <_ProjectDirectory/> + <_ProjectInSolution/> + + + \ No newline at end of file diff --git a/Sources/MSBuild.Core.Sdk/Core/MSBuild.Core.targets b/Sources/MSBuild.Core.Sdk/Core/MSBuild.Core.targets index 8d1670f6..7881769d 100644 --- a/Sources/MSBuild.Core.Sdk/Core/MSBuild.Core.targets +++ b/Sources/MSBuild.Core.Sdk/Core/MSBuild.Core.targets @@ -6,4 +6,266 @@ + + + + + + + + + + + + + + + + + + CollectProjectReferences;CollectPackageReferences + + PrepareProjectReferences;PreparePackageReferences + + ResolveProjectReferences;ResolvePackageReferences + + + + + RestoreCheck;ResolveReferences + + BuildCheck;BuildOnlySettings;ResolveReferences + + BuildCheck;CleanBuildFolder;PublishCheck;CleanPublishFolder;PrepareReferences + + + + + BuildCheck;Build + + BuildCheck;Build + + BuildCheck;Build + + + + + ResolveReferences + + ResolveReferences + + ResolveReferences + + + + + + + + + + + + + <_ResolvedPackage Include="@(PackageReference->ClearMetadata())"> + + %(PackageReference.Restore) + %(PackageReference.Pack) + %(PackageReference.Publish) + + %(PackageReference.Platform) + $(MSBuildSolutionDirectory) + + + + + + + + + + + + + + + <_ResolvedProject Include="@(ProjectReference->ClearMetadata())"> + + %(ProjectReference.Restore) + %(ProjectReference.Build) + %(ProjectReference.Clean) + %(ProjectReference.Rebuild) + %(ProjectReference.Test) + %(ProjectReference.Pack) + %(ProjectReference.Publish) + + Configuration=%(ProjectReference.Configuration) + %(_ResolvedProject.Properties);Platform=%(ProjectReference.Platform) + %(_ResolvedProject.Properties);%(ProjectReference.AdditionalProperties) + %(_ResolvedProject.Properties);MSBuildSolutionDirectory=$(MSBuildSolutionDirectory) + + + <_ProjectItemMetadata Include="@(ProjectItem->'%(Filename)')"> + %(ProjectItem.Identity) + %(ProjectItem.FullPath) + + + + <_ResolvedProject Condition="'%(Identity)' != '' AND '@(_ResolvedProject)' != '' AND '@(_ProjectItemMetadata)' != ''"> + + @(_ProjectItemMetadata->'%(ProjectFullPath)') + + + <_ProjectItemMetadata Remove="@(_ProjectItemMetadata)"/> + + + + + + + + + + + + + + + + + + + + + + + false + false + false + + + + + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Sources/MSBuild.Project.Sdk/Core/MSBuild.Defaults.targets b/Sources/MSBuild.Project.Sdk/Core/MSBuild.Defaults.targets index 1d86a92c..7452ad61 100644 --- a/Sources/MSBuild.Project.Sdk/Core/MSBuild.Defaults.targets +++ b/Sources/MSBuild.Project.Sdk/Core/MSBuild.Defaults.targets @@ -33,6 +33,21 @@ ======================================================================================================================== --> + + + + + + + + + + + ResolveReferences + + ResolveReferences + + diff --git a/Sources/MSBuild.Solution.Sdk/Core/MSBuild.Defaults.targets b/Sources/MSBuild.Solution.Sdk/Core/MSBuild.Defaults.targets index fa8ecba5..39176cfb 100644 --- a/Sources/MSBuild.Solution.Sdk/Core/MSBuild.Defaults.targets +++ b/Sources/MSBuild.Solution.Sdk/Core/MSBuild.Defaults.targets @@ -32,9 +32,36 @@ ======================================================================================================================== --> + + + + + + + + + + + ResolveReferences + + ResolveReferences + + + + + + @@ -42,6 +69,18 @@ + + + + \ No newline at end of file