From f39315771e4930c12be77b3817e4d7466b3e2f67 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 11 Aug 2017 07:09:01 -0700 Subject: [PATCH] Generate properties to pass to the next stage of the build (cherry picked from commit 12f8c2377f512d01e53a315e538ab945c5cbe5ba) --- Directory.Build.props | 2 +- build/OutputDirectories.props | 20 ++++++++++--- build/Prepare.targets | 30 ++++++++++++++++++- build/Stage0.props | 14 +++++++-- build/Test.targets | 9 ++++-- build/test/RunTest.proj | 1 + .../dotnet-cli-build/DotNetMSBuildTool.cs | 9 +++++- .../ArgumentForwardingTests.csproj | 3 +- 8 files changed, 75 insertions(+), 13 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 02d0b0406..48625efad 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -47,9 +47,9 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj + - diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 01b5e0a6f..f175698a8 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -1,10 +1,19 @@ - $(RepoRoot)/artifacts/$(Rid) - $(BaseOutputDirectory)/stage2 - $(BaseOutputDirectory)/stage2WithBackwardsCompatibleRuntimes + $([MSBuild]::Add($(CliOuterBuildStage), '1')) + 2 + + + $(RepoRoot)/artifacts/stage$(CliBuildStage)/$(Rid) + $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/bin/$(MSBuildProjectName)')) + + $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)')) + $(BaseOutputDirectory)/dotnet + $(BaseOutputDirectory)/dotnetWithBackwardsCompatibleRuntimes $(OutputDirectory)/sdk/$(SdkVersion) - $(BaseOutputDirectory)/stage2symbols + $(BaseOutputDirectory)/symbols $(SdkOutputDirectory)/Roslyn $(SdkOutputDirectory)/FSharp $(BaseOutputDirectory)/stage2compilation @@ -12,6 +21,7 @@ $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish + $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish $(BaseOutputDirectory)/testpackages/ @@ -19,5 +29,7 @@ $(IntermediateDirectory)/GeneratedMSBuildExtensions $(IntermediateDirectory)/MSBuildExtensionsLayout $(MSBuildExtensionsLayoutDirectory)/MSBuildSdkResolver + + $(BaseOutputDirectory)/PreviousStage.props diff --git a/build/Prepare.targets b/build/Prepare.targets index 942ade9fb..8c3cc1442 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -4,7 +4,7 @@ + DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles;CreatePropsForNextStage" /> + + + + +<Project> + <PropertyGroup> + <PreviousStageDirectory>$(OutputDirectory)</PreviousStageDirectory> + <PreviousStageDotnet>$(DotnetInOutputDirectory)</PreviousStageDotnet> + <CliOuterBuildStage>$(CliBuildStage)</CliOuterBuildStage> + </PropertyGroup> +</Project> + + + + $([System.IO.File]::ReadAllText($(NextStagePropsPath))) + + + false + true + + + + + diff --git a/build/Stage0.props b/build/Stage0.props index e5a6a0b50..1432a048a 100644 --- a/build/Stage0.props +++ b/build/Stage0.props @@ -1,8 +1,18 @@ - + $(RepoRoot)/.dotnet_stage0/$(Architecture) - $(RepoRoot)/.dotnet_stage0PJ/$(Architecture) $(Stage0Directory)/dotnet$(ExeExtension) + + + + + + $(PreviousStageDirectory) + $(PreviousStageDotnet) + + + + False True diff --git a/build/Test.targets b/build/Test.targets index c8f4a8829..2918de1f9 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -26,6 +26,7 @@ Configuration=$(Configuration); TestArtifactsDir=$(TestArtifactsDir); TestPackagesDir=$(TestPackagesDir); + PreviousStageProps=$(NextStagePropsPath); TestProject=%(TestProjects.Identity); TestResultXmlDir=$(TestResultXmlDir); ToolPath=$(OutputDirectory); @@ -54,13 +55,15 @@ DependsOnTargets="PrepareTests; CreateTestAssetPackageNuPkgs;"> + ProjectPath=""$(TestDirectory)/Microsoft.DotNet.Cli.Tests.sln"" + AdditionalParameters="/p:PreviousStageProps=$(NextStagePropsPath)" /> @@ -71,7 +74,7 @@ @@ -79,7 +82,7 @@ ProjectPath="%(TestPackageProject.ProjectPath)" ToolPath="$(OutputDirectory)" VersionSuffix="%(TestPackageProject.VersionSuffix)" - MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages" /> + MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages /p:PreviousStageProps=$(NextStagePropsPath)" /> diff --git a/build/test/RunTest.proj b/build/test/RunTest.proj index cff315a14..0454d8a6f 100644 --- a/build/test/RunTest.proj +++ b/build/test/RunTest.proj @@ -14,6 +14,7 @@ + - + +