From ac99830e120bafaf0a7e81ca102b049a1aedfb69 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Thu, 3 Aug 2017 17:15:57 -0700 Subject: [PATCH 01/23] Support new output directory layout --- build/OutputDirectories.props | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 42e7d255a..d93652724 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -1,20 +1,29 @@ - $(RepoRoot)/artifacts/$(Rid) - $(BaseOutputDirectory)/stage2 - $(BaseOutputDirectory)/stage2WithBackwardsCompatibleRuntimes + 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 + $(BaseOutputDirectory)/compilation $(BaseOutputDirectory)/intermediate $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish + $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish - $(RepoRoot)/artifacts/testpackages/ + $(BaseOutputDirectory)/testpackages/ $(OutputDirectory)/dotnet$(ExeExtension) $(IntermediateDirectory)/GeneratedMSBuildExtensions $(IntermediateDirectory)/MSBuildExtensionsLayout From ae0aa8ed246ab22a74a3e9e1b1a4c9d339661f12 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 4 Aug 2017 00:24:48 -0700 Subject: [PATCH 02/23] Move dir.props to auto-imported Directory.Build.props This is necessary for setting the intermediate output path to work correctly --- dir.props => Directory.Build.props | 15 +++++++++++++++ artifacts/Directory.Build.props | 3 +++ build/BundledTemplates.proj | 1 - build/buildpipeline/security/syncAzure.proj | 1 - build/package/dotnet-deb-tool-consumer.csproj | 2 -- .../Microsoft.DotNet.Cli.Build.Framework.csproj | 1 - .../InvokeWithStage0.proj | 1 - .../dotnet-cli-build/dotnet-cli-build.csproj | 1 - .../shared-build-targets-utils.csproj | 1 - .../Microsoft.DotNet.Archive.csproj | 1 - .../Microsoft.DotNet.Cli.Sln.Internal.csproj | 1 - .../Microsoft.DotNet.Cli.Utils.csproj | 1 - .../Microsoft.DotNet.Configurer.csproj | 1 - .../Microsoft.DotNet.InternalAbstractions.csproj | 1 - .../Microsoft.DotNet.MSBuildSdkResolver.csproj | 1 - .../Microsoft.DotNet.TestFramework.csproj | 1 - src/dotnet/dotnet.csproj | 1 - src/redist/redist.csproj | 1 - src/tool_fsharp/tool_fsc.csproj | 1 - src/tool_msbuild/tool_msbuild.csproj | 1 - src/tool_nuget/tool_nuget.csproj | 1 - src/tool_roslyn/tool_roslyn.csproj | 1 - .../ArgumentForwardingTests.csproj | 1 - test/ArgumentsReflector/ArgumentsReflector.csproj | 1 - test/EndToEnd/EndToEnd.csproj | 2 -- .../Microsoft.DotNet.Cli.Msi.Tests.csproj | 2 -- ...Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj | 2 -- .../Microsoft.DotNet.Cli.Utils.Tests.csproj | 2 -- .../Microsoft.DotNet.Configurer.UnitTests.csproj | 2 -- ...crosoft.DotNet.MSBuildSdkResolver.Tests.csproj | 2 -- .../Microsoft.DotNet.Tools.Tests.Utilities.csproj | 2 -- .../Msbuild.Tests.Utilities.csproj | 2 -- .../binding-redirects.Tests.csproj | 1 - test/crossgen.Tests/crossgen.Tests.csproj | 1 - .../dotnet-add-package.Tests.csproj | 2 -- .../dotnet-add-reference.Tests.csproj | 1 - .../dotnet-back-compat.Tests.csproj | 2 -- test/dotnet-build.Tests/dotnet-build.Tests.csproj | 1 - test/dotnet-clean.Tests/dotnet-clean.Tests.csproj | 2 -- test/dotnet-help.Tests/dotnet-help.Tests.csproj | 2 -- .../dotnet-list-reference.Tests.csproj | 2 -- .../dotnet-migrate.Tests.csproj | 2 -- .../dotnet-msbuild.Tests.csproj | 2 -- test/dotnet-new.Tests/dotnet-new.Tests.csproj | 2 -- .../dotnet-nuget.UnitTests.csproj | 2 -- test/dotnet-pack.Tests/dotnet-pack.Tests.csproj | 2 -- .../dotnet-publish.Tests.csproj | 2 -- .../dotnet-remove-package.Tests.csproj | 2 -- .../dotnet-remove-reference.Tests.csproj | 2 -- .../dotnet-restore.Tests.csproj | 2 -- test/dotnet-run.Tests/dotnet-run.Tests.csproj | 2 -- .../dotnet-sln-add.Tests.csproj | 2 -- .../dotnet-sln-list.Tests.csproj | 2 -- .../dotnet-sln-remove.Tests.csproj | 2 -- test/dotnet-store.Tests/dotnet-store.Tests.csproj | 2 -- test/dotnet-test.Tests/dotnet-test.Tests.csproj | 2 -- .../dotnet-vstest.Tests.csproj | 2 -- test/dotnet.Tests/dotnet.Tests.csproj | 1 - .../msbuild.IntegrationTests.csproj | 2 -- .../CrossGen.Dependencies.csproj | 2 -- .../Signing.Dependencies.csproj | 2 -- 61 files changed, 18 insertions(+), 92 deletions(-) rename dir.props => Directory.Build.props (83%) create mode 100644 artifacts/Directory.Build.props diff --git a/dir.props b/Directory.Build.props similarity index 83% rename from dir.props rename to Directory.Build.props index eb03fece3..b11a199be 100644 --- a/dir.props +++ b/Directory.Build.props @@ -1,5 +1,20 @@ + + $(MSBuildThisFileDirectory) diff --git a/artifacts/Directory.Build.props b/artifacts/Directory.Build.props new file mode 100644 index 000000000..905549edc --- /dev/null +++ b/artifacts/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/build/BundledTemplates.proj b/build/BundledTemplates.proj index 014f5bc92..f9d730107 100644 --- a/build/BundledTemplates.proj +++ b/build/BundledTemplates.proj @@ -1,5 +1,4 @@ - - $(BuildToolsTaskDesktopDir)Microsoft.DotNet.Build.CloudTestTasks.dll diff --git a/build/package/dotnet-deb-tool-consumer.csproj b/build/package/dotnet-deb-tool-consumer.csproj index a48d3d6f2..03e67c852 100644 --- a/build/package/dotnet-deb-tool-consumer.csproj +++ b/build/package/dotnet-deb-tool-consumer.csproj @@ -1,6 +1,4 @@ - - netcoreapp2.0 $(CLI_SharedFrameworkVersion) diff --git a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj index dd2f94e91..fefc8affe 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj +++ b/build_projects/Microsoft.DotNet.Cli.Build.Framework/Microsoft.DotNet.Cli.Build.Framework.csproj @@ -1,5 +1,4 @@  - netstandard1.5 diff --git a/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj b/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj index 6a85183ca..0b16d4b63 100644 --- a/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj +++ b/build_projects/Microsoft.DotNet.Cli.Build.SelfTest/InvokeWithStage0.proj @@ -1,5 +1,4 @@ - diff --git a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj index 872cae995..89d08508f 100644 --- a/build_projects/dotnet-cli-build/dotnet-cli-build.csproj +++ b/build_projects/dotnet-cli-build/dotnet-cli-build.csproj @@ -1,5 +1,4 @@ - Build scripts for dotnet-cli 1.0.0 diff --git a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj index 14a4c4a33..ed7002589 100644 --- a/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj +++ b/build_projects/shared-build-targets-utils/shared-build-targets-utils.csproj @@ -1,5 +1,4 @@  - Build scripts for dotnet-cli diff --git a/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj b/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj index 04b8f25be..0fec393cb 100644 --- a/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj +++ b/src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj @@ -1,5 +1,4 @@  - Archive and compression types. diff --git a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj index 2b23027fd..8f76e2e04 100644 --- a/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj +++ b/src/Microsoft.DotNet.Cli.Sln.Internal/Microsoft.DotNet.Cli.Sln.Internal.csproj @@ -1,5 +1,4 @@  - SLN file reader/writer diff --git a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj index ed1056755..35e9a8f77 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj +++ b/src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj @@ -1,5 +1,4 @@  - $(SdkVersion) diff --git a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj index 25a33c6f8..49f4fceb5 100644 --- a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj +++ b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj @@ -1,5 +1,4 @@  - $(CliVersionPrefix) diff --git a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj b/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj index a5c6d9d6a..c4c930565 100644 --- a/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj +++ b/src/Microsoft.DotNet.InternalAbstractions/Microsoft.DotNet.InternalAbstractions.csproj @@ -1,5 +1,4 @@  - Abstractions for making code that uses file system and environment testable. diff --git a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj index ca8867c75..55d357272 100644 --- a/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj +++ b/src/Microsoft.DotNet.MSBuildSdkResolver/Microsoft.DotNet.MSBuildSdkResolver.csproj @@ -1,5 +1,4 @@  - $(SdkVersion) diff --git a/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj b/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj index 4e9b4a96f..2996edcbb 100644 --- a/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj +++ b/src/Microsoft.DotNet.TestFramework/Microsoft.DotNet.TestFramework.csproj @@ -1,5 +1,4 @@  - Microsoft.DotNet.TestFramework Class Library diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index 71da96676..abe683aee 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -1,5 +1,4 @@  - $(SdkVersion) netcoreapp2.0 diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index a6ad0ac3f..08f6d6ebb 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -1,5 +1,4 @@  - diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj index dcd58965a..2738e5a7b 100644 --- a/src/tool_fsharp/tool_fsc.csproj +++ b/src/tool_fsharp/tool_fsc.csproj @@ -1,5 +1,4 @@  - diff --git a/src/tool_msbuild/tool_msbuild.csproj b/src/tool_msbuild/tool_msbuild.csproj index 7a109b08d..19cf5b7ea 100644 --- a/src/tool_msbuild/tool_msbuild.csproj +++ b/src/tool_msbuild/tool_msbuild.csproj @@ -1,5 +1,4 @@  - $(CliVersionPrefix) diff --git a/src/tool_nuget/tool_nuget.csproj b/src/tool_nuget/tool_nuget.csproj index 5a4e4121f..9d00b23cb 100644 --- a/src/tool_nuget/tool_nuget.csproj +++ b/src/tool_nuget/tool_nuget.csproj @@ -1,5 +1,4 @@  - $(CliVersionPrefix) diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index bd702ca7c..7d79daa26 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -1,5 +1,4 @@  - diff --git a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj index 1a58c07c9..8d8441f26 100644 --- a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj +++ b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/ArgumentsReflector/ArgumentsReflector.csproj b/test/ArgumentsReflector/ArgumentsReflector.csproj index 4ad634f31..012295b52 100644 --- a/test/ArgumentsReflector/ArgumentsReflector.csproj +++ b/test/ArgumentsReflector/ArgumentsReflector.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/EndToEnd/EndToEnd.csproj b/test/EndToEnd/EndToEnd.csproj index 83c4a521a..5d283f2ee 100644 --- a/test/EndToEnd/EndToEnd.csproj +++ b/test/EndToEnd/EndToEnd.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj index e576ed679..25e1911ef 100644 --- a/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj +++ b/test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj @@ -1,6 +1,4 @@  - - net46 true diff --git a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj index 0cc22883c..098c597f1 100644 --- a/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj index dce7b8e2e..2d72b4454 100644 --- a/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj +++ b/test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj index 69269abf5..0a2a49ff8 100644 --- a/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj +++ b/test/Microsoft.DotNet.Configurer.UnitTests/Microsoft.DotNet.Configurer.UnitTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj index a21bb4731..b60f6abe6 100644 --- a/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj +++ b/test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj index c13629f52..123853f23 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj @@ -1,6 +1,4 @@  - - Microsoft.DotNet.Tools.Tests.Utilities Class Library netstandard1.5 diff --git a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj index ded34abd0..b5417dc7d 100644 --- a/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj +++ b/test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj index 7922a876d..26c6e3040 100644 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ b/test/binding-redirects.Tests/binding-redirects.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/crossgen.Tests/crossgen.Tests.csproj b/test/crossgen.Tests/crossgen.Tests.csproj index 980cd78e7..01fb3ded5 100644 --- a/test/crossgen.Tests/crossgen.Tests.csproj +++ b/test/crossgen.Tests/crossgen.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj index 36ec73b00..8ba699d4f 100644 --- a/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj +++ b/test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj index 46b4c5b3a..099a07042 100644 --- a/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj +++ b/test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj b/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj index 0b7b9fa26..69d929277 100644 --- a/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj +++ b/test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-build.Tests/dotnet-build.Tests.csproj b/test/dotnet-build.Tests/dotnet-build.Tests.csproj index d72a8f986..cdbb67581 100644 --- a/test/dotnet-build.Tests/dotnet-build.Tests.csproj +++ b/test/dotnet-build.Tests/dotnet-build.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj b/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj index 831a64d3b..7e95efcdd 100644 --- a/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj +++ b/test/dotnet-clean.Tests/dotnet-clean.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-help.Tests/dotnet-help.Tests.csproj b/test/dotnet-help.Tests/dotnet-help.Tests.csproj index 88443c674..c2a76cf2e 100644 --- a/test/dotnet-help.Tests/dotnet-help.Tests.csproj +++ b/test/dotnet-help.Tests/dotnet-help.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj index c62326007..3203b484b 100644 --- a/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj +++ b/test/dotnet-list-reference.Tests/dotnet-list-reference.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj index 2a9fe2963..6df897b0b 100644 --- a/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj +++ b/test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj index 4a20f6cf9..d0a743263 100644 --- a/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj +++ b/test/dotnet-msbuild.Tests/dotnet-msbuild.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-new.Tests/dotnet-new.Tests.csproj b/test/dotnet-new.Tests/dotnet-new.Tests.csproj index 7dc7368f6..1a855b363 100644 --- a/test/dotnet-new.Tests/dotnet-new.Tests.csproj +++ b/test/dotnet-new.Tests/dotnet-new.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj index 327ad4bec..dc2a0e3b8 100644 --- a/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj +++ b/test/dotnet-nuget.UnitTests/dotnet-nuget.UnitTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj index 755ce3f43..e97c768e7 100644 --- a/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj +++ b/test/dotnet-pack.Tests/dotnet-pack.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj index 5641910fa..0a8f0b444 100644 --- a/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj +++ b/test/dotnet-publish.Tests/dotnet-publish.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj index 84669fe6d..ffc70fbb0 100644 --- a/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj +++ b/test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj index 53a68dce5..e6adf5f46 100644 --- a/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj +++ b/test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj index 812246448..821926ed7 100644 --- a/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj +++ b/test/dotnet-restore.Tests/dotnet-restore.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-run.Tests/dotnet-run.Tests.csproj b/test/dotnet-run.Tests/dotnet-run.Tests.csproj index e1b7fbe50..09a075cdb 100644 --- a/test/dotnet-run.Tests/dotnet-run.Tests.csproj +++ b/test/dotnet-run.Tests/dotnet-run.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj index 6bc9287df..5e4b67f10 100644 --- a/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj +++ b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj @@ -1,6 +1,4 @@ - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj index a7b806863..b0248a430 100644 --- a/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj +++ b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj index 8609bdb05..edb29165f 100644 --- a/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj +++ b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-store.Tests/dotnet-store.Tests.csproj b/test/dotnet-store.Tests/dotnet-store.Tests.csproj index 650b63b6a..cefcfbb5d 100644 --- a/test/dotnet-store.Tests/dotnet-store.Tests.csproj +++ b/test/dotnet-store.Tests/dotnet-store.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-test.Tests/dotnet-test.Tests.csproj b/test/dotnet-test.Tests/dotnet-test.Tests.csproj index a47ee9357..a68e32d3a 100644 --- a/test/dotnet-test.Tests/dotnet-test.Tests.csproj +++ b/test/dotnet-test.Tests/dotnet-test.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj index c774406bd..5d0b60eb5 100644 --- a/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj +++ b/test/dotnet-vstest.Tests/dotnet-vstest.Tests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index 12467295b..f941c7d97 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -1,5 +1,4 @@  - $(CliTargetFramework) diff --git a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj index cab0ce168..a0b313663 100644 --- a/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj +++ b/test/msbuild.IntegrationTests/msbuild.IntegrationTests.csproj @@ -1,6 +1,4 @@  - - $(CliTargetFramework) $(CLI_SharedFrameworkVersion) diff --git a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj index e29aa4cdb..33051ba8e 100644 --- a/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj +++ b/tools/CrossGen.Dependencies/CrossGen.Dependencies.csproj @@ -1,6 +1,4 @@  - - netcoreapp2.0 $(SharedFrameworkRid) diff --git a/tools/Signing.Dependencies/Signing.Dependencies.csproj b/tools/Signing.Dependencies/Signing.Dependencies.csproj index c98ee321a..dc8cd6914 100644 --- a/tools/Signing.Dependencies/Signing.Dependencies.csproj +++ b/tools/Signing.Dependencies/Signing.Dependencies.csproj @@ -1,6 +1,4 @@ - - netcoreapp1.0 From 13da2131835ca951d12900cce3edefe1fb9df12f Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Wed, 9 Aug 2017 22:30:20 -0700 Subject: [PATCH 03/23] Support new artifacts layout in tests and other build logic --- .../AppWithProjTool2Fx/App.csproj | 1 + .../AppWithProjTool2Fx/NuGet.Config | 6 ------ .../LibWithProjTool2Fx/Lib.csproj | 1 + .../LibWithProjTool2Fx/NuGet.Config | 6 ------ TestAssets/Directory.Build.props | 3 +++ TestAssets/TestPackages/NuGet.Config | 6 ------ .../11TestAppWith10CLIToolReferences.csproj | 1 + .../NuGet.Config | 6 ------ .../AppWithDirectDepWithOutputName.csproj | 1 + .../NuGet.Config | 8 -------- ...AppWithFallbackFolderToolDependency.csproj | 1 + .../NuGet.Config | 6 ------ .../DependencyContextFromTool.csproj | 1 + .../DependencyContextFromTool/NuGet.Config | 6 ------ .../TestAppWithProjDepTool/NuGet.Config | 6 ------ .../TestAppWithProjDepTool.csproj | 1 + build.proj | 2 +- build/BundledTemplates.proj | 1 + build/OutputDirectories.props | 2 +- build/Test.targets | 20 +++++++++---------- build/buildpipeline/security/syncAzure.proj | 1 + build/test/RunTest.proj | 7 ++++++- .../InvokeWithStage0.proj | 1 + dir.props | 4 ++++ src/redist/redist.csproj | 2 +- src/tool_fsharp/tool_fsc.csproj | 2 +- src/tool_roslyn/tool_roslyn.csproj | 2 +- .../ArgumentForwardingTests.csproj | 2 +- test/{dir.props => Directory.Build.props} | 2 +- .../Commands/TestCommand.cs | 3 +++ .../RepoDirectoriesProvider.cs | 13 ++++++++---- test/binding-redirects.Tests/NuGet.Config | 6 ------ .../binding-redirects.Tests.csproj | 1 + .../GivenThatIWantANewAppWithSpecifiedType.cs | 8 ++++++-- test/dotnet-new.Tests/dotnet-new.Tests.csproj | 5 +++++ test/dotnet.Tests/dotnet.Tests.csproj | 2 +- testAsset.props | 3 +++ 37 files changed, 67 insertions(+), 82 deletions(-) delete mode 100644 TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config delete mode 100644 TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config create mode 100644 TestAssets/Directory.Build.props delete mode 100644 TestAssets/TestPackages/NuGet.Config delete mode 100644 TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config delete mode 100644 TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config delete mode 100644 TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config create mode 100644 dir.props rename test/{dir.props => Directory.Build.props} (83%) delete mode 100644 test/binding-redirects.Tests/NuGet.Config diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj index 0034bcf80..331a6e75f 100644 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj +++ b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj @@ -6,6 +6,7 @@ Exe $(AssetTargetFallback);portable-net45+win8;dnxcore50 win7-x64;win7-x86;osx.10.10-x64;osx.10.11-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7.2-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj index 1009df7ef..81bd8b767 100644 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj +++ b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/Lib.csproj @@ -3,6 +3,7 @@ netstandard1.6;net451 Library $(AssetTargetFallback);portable-net45+win8;dnxcore50;netcoreapp2.1 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config b/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/LibWithProjTool2Fx/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/Directory.Build.props b/TestAssets/Directory.Build.props new file mode 100644 index 000000000..905549edc --- /dev/null +++ b/TestAssets/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/TestAssets/TestPackages/NuGet.Config b/TestAssets/TestPackages/NuGet.Config deleted file mode 100644 index 0750578cb..000000000 --- a/TestAssets/TestPackages/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj index 6dd25f7f6..c15ae1a16 100644 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj +++ b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/11TestAppWith10CLIToolReferences.csproj @@ -4,6 +4,7 @@ Exe netcoreapp1.1 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config b/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/11TestAppWith10CLIToolReferences/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj index 7685e5e72..4eef16036 100755 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj +++ b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config deleted file mode 100644 index 4da396ac8..000000000 --- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/NuGet.Config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj index 28ef6634e..76195b1ca 100755 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj +++ b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj index a3149221d..2de1535e2 100755 --- a/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj +++ b/TestAssets/TestProjects/DependencyContextFromTool/DependencyContextFromTool.csproj @@ -8,6 +8,7 @@ Exe false $(AssetTargetFallback);dnxcore50;portable-net45+win8 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config b/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/DependencyContextFromTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config b/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/TestAppWithProjDepTool/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj index b17661355..b4e6c9844 100644 --- a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj +++ b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj @@ -4,6 +4,7 @@ Exe netcoreapp2.1 + $(TEST_PACKAGES) diff --git a/build.proj b/build.proj index 3117ddb85..2bbc62e48 100644 --- a/build.proj +++ b/build.proj @@ -1,6 +1,6 @@ - + diff --git a/build/BundledTemplates.proj b/build/BundledTemplates.proj index f9d730107..014f5bc92 100644 --- a/build/BundledTemplates.proj +++ b/build/BundledTemplates.proj @@ -1,4 +1,5 @@ + $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish - $(BaseOutputDirectory)/testpackages/ + $(BaseOutputDirectory)/test/ $(OutputDirectory)/dotnet$(ExeExtension) $(IntermediateDirectory)/GeneratedMSBuildExtensions $(IntermediateDirectory)/MSBuildExtensionsLayout diff --git a/build/Test.targets b/build/Test.targets index 86cd8ea7e..04c6a7f67 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -12,24 +12,20 @@ $(TestOutputDir)/results/ - - - - - - @(TestTaskEnvironmentVariables) - - + + + CLIBuildDll=$(CLIBuildDll); Configuration=$(Configuration); - EnvironmentVariables=$(RunTestEnvironmentVariables); + TestArtifactsDir=$(TestArtifactsDir); + TestPackagesDir=$(TestPackagesDir); TestProject=%(TestProjects.Identity); TestResultXmlDir=$(TestResultXmlDir); ToolPath=$(OutputDirectory); @@ -74,14 +70,16 @@ + ProjectPath="%(TestPackageProject.ProjectPath)" + AdditionalParameters="/p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages" + /> + MsbuildArgs="%(TestPackageProject.MsbuildArgs) /p:SdkNuGetVersion=$(SdkNugetVersion) /p:RestoreAdditionalProjectSources=$(TestOutputDir)/packages" /> diff --git a/build/buildpipeline/security/syncAzure.proj b/build/buildpipeline/security/syncAzure.proj index 938860887..45d7657eb 100644 --- a/build/buildpipeline/security/syncAzure.proj +++ b/build/buildpipeline/security/syncAzure.proj @@ -1,5 +1,6 @@ + $(BuildToolsTaskDesktopDir)Microsoft.DotNet.Build.CloudTestTasks.dll diff --git a/build/test/RunTest.proj b/build/test/RunTest.proj index 8b1ec899f..cff315a14 100644 --- a/build/test/RunTest.proj +++ b/build/test/RunTest.proj @@ -11,7 +11,12 @@ - + + + + + + diff --git a/dir.props b/dir.props new file mode 100644 index 000000000..995f5e985 --- /dev/null +++ b/dir.props @@ -0,0 +1,4 @@ + + + + diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 08f6d6ebb..17d2febbc 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -1,5 +1,5 @@  - + diff --git a/src/tool_fsharp/tool_fsc.csproj b/src/tool_fsharp/tool_fsc.csproj index 2738e5a7b..68bfd019a 100644 --- a/src/tool_fsharp/tool_fsc.csproj +++ b/src/tool_fsharp/tool_fsc.csproj @@ -1,5 +1,5 @@  - + $(CliVersionPrefix) diff --git a/src/tool_roslyn/tool_roslyn.csproj b/src/tool_roslyn/tool_roslyn.csproj index 7d79daa26..bc481ef14 100644 --- a/src/tool_roslyn/tool_roslyn.csproj +++ b/src/tool_roslyn/tool_roslyn.csproj @@ -1,5 +1,5 @@  - + $(CliVersionPrefix) diff --git a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj index 8d8441f26..4c5a4fc06 100644 --- a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj +++ b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj @@ -24,7 +24,7 @@ - + diff --git a/test/dir.props b/test/Directory.Build.props similarity index 83% rename from test/dir.props rename to test/Directory.Build.props index 8d5c8cc42..406c4f8c1 100644 --- a/test/dir.props +++ b/test/Directory.Build.props @@ -1,5 +1,5 @@ - + false diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs index 03ee56d6c..b8f3ca9cc 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/TestCommand.cs @@ -238,6 +238,9 @@ namespace Microsoft.DotNet.Tools.Test.Utilities psi.Environment[item.Key] = item.Value; #endif } + + // Flow the TEST_PACKAGES environment variable to the child process + psi.Environment["TEST_PACKAGES"] = System.Environment.GetEnvironmentVariable("TEST_PACKAGES"); } private void AddWorkingDirectoryTo(ProcessStartInfo psi) diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index dca694eaf..6f465a5b1 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -99,17 +99,22 @@ namespace Microsoft.DotNet.Tools.Test.Utilities string corehostDummyPackages = null, string pjDotnet = null) { - _artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", BuildRid); + _artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", "stage2", BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); _pjDotnet = pjDotnet ?? GetPjDotnetPath(); _stage2Sdk = Directory - .EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")) + .EnumerateDirectories(Path.Combine(_artifacts, "dotnet", "sdk")) .First(d => !d.Contains("NuGetFallbackFolder")); _stage2WithBackwardsCompatibleRuntimesDirectory = - Path.Combine(_artifacts, "stage2WithBackwardsCompatibleRuntimes"); - _testPackages = Path.Combine(RepoRoot, "artifacts", "testpackages", "packages"); + Path.Combine(_artifacts, "dotnetWithBackwardsCompatibleRuntimes"); + + _testPackages = Environment.GetEnvironmentVariable("TEST_PACKAGES"); + if (string.IsNullOrEmpty(_testPackages)) + { + throw new InvalidOperationException("TEST_PACKAGES environment variable not set"); + } } private string GetPjDotnetPath() diff --git a/test/binding-redirects.Tests/NuGet.Config b/test/binding-redirects.Tests/NuGet.Config deleted file mode 100644 index 507db39a6..000000000 --- a/test/binding-redirects.Tests/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test/binding-redirects.Tests/binding-redirects.Tests.csproj b/test/binding-redirects.Tests/binding-redirects.Tests.csproj index 26c6e3040..e34172c40 100644 --- a/test/binding-redirects.Tests/binding-redirects.Tests.csproj +++ b/test/binding-redirects.Tests/binding-redirects.Tests.csproj @@ -6,6 +6,7 @@ true binding-redirects.Tests $(AssetTargetFallback);dotnet5.4;portable-net451+win8 + $(TestOutputDir)/packages diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index fc412edef..ac7a7308b 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -51,8 +51,12 @@ namespace Microsoft.DotNet.New.Tests if (useNuGetConfigForAspNet) { - var configFile = new FileInfo(Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config")); - File.Copy(configFile.FullName, Path.Combine(rootPath, "NuGet.Config")); + string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config"; + using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName)) + using (Stream output = File.OpenWrite(Path.Combine(rootPath, "NuGet.Config"))) + { + input.CopyTo(output); + } } if (skipSpaWebpackSteps) diff --git a/test/dotnet-new.Tests/dotnet-new.Tests.csproj b/test/dotnet-new.Tests/dotnet-new.Tests.csproj index 1a855b363..7a0ca3099 100644 --- a/test/dotnet-new.Tests/dotnet-new.Tests.csproj +++ b/test/dotnet-new.Tests/dotnet-new.Tests.csproj @@ -7,6 +7,11 @@ $(AssetTargetFallback);dnxcore50;portable-net45+win8 + + + + + diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index f941c7d97..e47a3c553 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -22,7 +22,7 @@ PreserveNewest PreserveNewest - + .version PreserveNewest diff --git a/testAsset.props b/testAsset.props index 4c05b30f1..01455d290 100644 --- a/testAsset.props +++ b/testAsset.props @@ -1,3 +1,6 @@ + + $(TEST_PACKAGES) + From 4ccf1b690280e40fe8e79291603f02e454ff14f4 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Wed, 9 Aug 2017 23:46:57 -0700 Subject: [PATCH 04/23] Use separate folders for different cases of a theory --- test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs index bbe339071..ba37b1e73 100644 --- a/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs +++ b/test/dotnet-add-reference.Tests/GivenDotnetAddReference.cs @@ -661,7 +661,7 @@ Commands: [InlineData("nonexistingframeworkname")] public void WhenFrameworkSwitchIsNotMatchingAnyOfTargetedFrameworksItPrintsError(string framework) { - var setup = Setup(); + var setup = Setup(framework); var lib = new ProjDir(setup.LibDir); var net45lib = new ProjDir(Path.Combine(setup.TestRoot, "Net45Lib")); From 61e68e621ab44daf4b1ab6ca06474b60f74b95d0 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Wed, 9 Aug 2017 23:47:36 -0700 Subject: [PATCH 05/23] Show path when directory delete fails in test setup --- src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs index bf75f00c2..4d27d0fe7 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssetInstance.cs @@ -51,7 +51,14 @@ namespace Microsoft.DotNet.TestFramework if (Root.Exists) { - Root.Delete(recursive: true); + try + { + Root.Delete(recursive: true); + } + catch (IOException ex) + { + throw new InvalidOperationException("Unable to delete directory: " + Root.FullName, ex); + } } Root.Create(); From 884a48372d5766fccec13d2107d3554155f1aa7f Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Thu, 10 Aug 2017 22:28:14 -0700 Subject: [PATCH 06/23] Copy empty Directory.Build.props to artifacts folder during build instead of checking it in --- artifacts/Directory.Build.props | 3 --- build/Prepare.targets | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) delete mode 100644 artifacts/Directory.Build.props diff --git a/artifacts/Directory.Build.props b/artifacts/Directory.Build.props deleted file mode 100644 index 905549edc..000000000 --- a/artifacts/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/build/Prepare.targets b/build/Prepare.targets index 214b1f78d..942ade9fb 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -4,7 +4,7 @@ + DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;IsolateArtifactsFromDirectoryBuildFiles" /> + + + From 12f8c2377f512d01e53a315e538ab945c5cbe5ba Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 11 Aug 2017 07:09:01 -0700 Subject: [PATCH 07/23] Generate properties to pass to the next stage of the build --- Directory.Build.props | 2 +- build/OutputDirectories.props | 3 ++ 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, 62 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b11a199be..7271e92ed 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 d13ca56ba..46407809d 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -1,5 +1,6 @@ + $([MSBuild]::Add($(CliOuterBuildStage), '1')) 2 @@ -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 @@ + - + + From e4777c0b9173756f5c48edbbf7a3ff8144b96f41 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 11 Aug 2017 08:37:31 -0700 Subject: [PATCH 08/23] Update expected SDK version test to work with multiple stages --- test/dotnet.Tests/VersionTest.cs | 8 +------ test/dotnet.Tests/dotnet.Tests.csproj | 32 +++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/test/dotnet.Tests/VersionTest.cs b/test/dotnet.Tests/VersionTest.cs index 0192f5fd8..3b0e1c92e 100644 --- a/test/dotnet.Tests/VersionTest.cs +++ b/test/dotnet.Tests/VersionTest.cs @@ -17,7 +17,7 @@ namespace Microsoft.DotNet.Tests [Fact] public void VersionCommandDisplaysCorrectVersion() { - var versionFilePath = Path.Combine(AppContext.BaseDirectory, ".version"); + var versionFilePath = Path.Combine(AppContext.BaseDirectory, "ExpectedSdkVersion.txt"); var version = GetVersionFromFile(versionFilePath); CommandResult result = new DotnetCommand() @@ -31,14 +31,8 @@ namespace Microsoft.DotNet.Tests { using (var reader = new StreamReader(File.OpenRead(versionFilePath))) { - SkipCommit(reader); return reader.ReadLine(); } } - - private void SkipCommit(StreamReader reader) - { - reader.ReadLine(); - } } } diff --git a/test/dotnet.Tests/dotnet.Tests.csproj b/test/dotnet.Tests/dotnet.Tests.csproj index e47a3c553..3f5b89978 100644 --- a/test/dotnet.Tests/dotnet.Tests.csproj +++ b/test/dotnet.Tests/dotnet.Tests.csproj @@ -22,11 +22,35 @@ PreserveNewest PreserveNewest - - .version - PreserveNewest - + + + + + $(IntermediateOutputPath)ExpectedSdkVersion.txt + + $(SdkVersion) + + $([System.IO.File]::ReadAllText($(ExpectedVersionFileInIntermediateFolder))) + + + false + true + + + + + + + + + From c6e4c8f477a4e5c335874eeb3059d4f3796d2559 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 11 Aug 2017 16:13:43 -0700 Subject: [PATCH 09/23] Rename Stage0 build variables to PreviousStage --- Directory.Build.props | 2 +- Microsoft.DotNet.Cli.sln | 2 +- build.proj | 4 ++-- build/BundledTemplates.proj | 2 +- build/MSBuildExtensions.targets | 2 +- build/Prepare.targets | 4 ++-- build/RestoreDependency.proj | 2 +- build/{Stage0.props => SetupPreviousStage.props} | 10 ++-------- build/Test.targets | 4 ++-- build/package/Installer.DEB.proj | 4 ++-- build/package/Installer.MSI.targets | 2 +- build/package/Nupkg.targets | 4 ++-- build/prepare/CheckPrereqs.targets | 4 ++-- src/redist/redist.csproj | 8 ++++---- 14 files changed, 24 insertions(+), 30 deletions(-) rename build/{Stage0.props => SetupPreviousStage.props} (50%) diff --git a/Directory.Build.props b/Directory.Build.props index 7271e92ed..5906f578a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -47,7 +47,7 @@ tools\TestAssetsDependencies\TestAssetsDependencies.csproj - + diff --git a/Microsoft.DotNet.Cli.sln b/Microsoft.DotNet.Cli.sln index 5929564f2..d459a1cbc 100644 --- a/Microsoft.DotNet.Cli.sln +++ b/Microsoft.DotNet.Cli.sln @@ -54,7 +54,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{89905EC4 build\RestoreDependency.proj = build\RestoreDependency.proj build\sdks\sdks.csproj = build\sdks\sdks.csproj build\Signing.proj = build\Signing.proj - build\Stage0.props = build\Stage0.props + build\SetupPreviousStage.props = build\SetupPreviousStage.props build\Test.targets = build\Test.targets build\Version.props = build\Version.props build\VersionBadge.props = build\VersionBadge.props diff --git a/build.proj b/build.proj index 2bbc62e48..837cf150e 100644 --- a/build.proj +++ b/build.proj @@ -20,7 +20,7 @@ DependsOnTargets="MSBuildWorkaroundTarget; RestoreDotnetCliBuildFramework"> - @@ -39,7 +39,7 @@ $(ExtraRestoreArgs) --disable-parallel - diff --git a/build/BundledTemplates.proj b/build/BundledTemplates.proj index 014f5bc92..dfc66e111 100644 --- a/build/BundledTemplates.proj +++ b/build/BundledTemplates.proj @@ -23,7 +23,7 @@ - diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index c6dd9f7ae..e24b2225b 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -75,7 +75,7 @@ NuGetPackagesDir=$(NuGetPackagesDir); DependencyPackageName=%(ExtensionPackageToRestore.Identity); DependencyPackageVersion=%(ExtensionPackageToRestore.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory) diff --git a/build/Prepare.targets b/build/Prepare.targets index 8c3cc1442..67ae12cab 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -54,7 +54,7 @@ - @@ -79,7 +79,7 @@ - diff --git a/build/RestoreDependency.proj b/build/RestoreDependency.proj index 142f5e929..19f209ce0 100644 --- a/build/RestoreDependency.proj +++ b/build/RestoreDependency.proj @@ -33,7 +33,7 @@ - diff --git a/build/Stage0.props b/build/SetupPreviousStage.props similarity index 50% rename from build/Stage0.props rename to build/SetupPreviousStage.props index 1432a048a..4798cf582 100644 --- a/build/Stage0.props +++ b/build/SetupPreviousStage.props @@ -1,16 +1,10 @@ - $(RepoRoot)/.dotnet_stage0/$(Architecture) - $(Stage0Directory)/dotnet$(ExeExtension) + $(RepoRoot)/.dotnet_stage0/$(Architecture) + $(PreviousStageDirectory)/dotnet$(ExeExtension) - - - $(PreviousStageDirectory) - $(PreviousStageDotnet) - - False diff --git a/build/Test.targets b/build/Test.targets index 9c31620aa..388a2e1fe 100644 --- a/build/Test.targets +++ b/build/Test.targets @@ -88,11 +88,11 @@ + ToolPath="$(PreviousStageDirectory)" /> + ToolPath="$(PreviousStageDirectory)" /> diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index 66300c4df..d06be6a30 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -64,7 +64,7 @@ Mode="u+x" /> - - diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 2a4e131b8..8721c4673 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -199,7 +199,7 @@ + -DotnetDir '$(PreviousStageDirectory)'" /> @@ -34,7 +34,7 @@ - diff --git a/build/prepare/CheckPrereqs.targets b/build/prepare/CheckPrereqs.targets index 1e7454410..03d743c35 100644 --- a/build/prepare/CheckPrereqs.targets +++ b/build/prepare/CheckPrereqs.targets @@ -8,8 +8,8 @@ DependsOnTargets="CheckUbuntuAptGetDependencies; CheckCentOsYumDependencies;"> - - + + - @@ -81,7 +81,7 @@ - @@ -159,7 +159,7 @@ SdkLayoutDirectory=$(SdkOutputDirectory)/Sdks/%(BundledSdk.Identity); DependencyPackageName=%(BundledSdk.Identity); DependencyPackageVersion=%(BundledSdk.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory) @@ -178,7 +178,7 @@ TemplateLayoutDirectory=$(SdkOutputDirectory)/Templates; TemplatePackageName=%(BundledTemplate.Identity); TemplatePackageVersion=%(BundledTemplate.Version); - Stage0Directory=$(Stage0Directory) + PreviousStageDirectory=$(PreviousStageDirectory) From 2222290394babb75cb92a72a14bbb5f4f11d7557 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Mon, 14 Aug 2017 17:42:07 -0700 Subject: [PATCH 10/23] Update MSI tests to use new output directory layout --- build/package/Installer.MSI.targets | 3 ++- test/Installer/testmsi.ps1 | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 8721c4673..ea98d309a 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -199,7 +199,8 @@ + -DotnetDir '$(PreviousStageDirectory)' + -TestDir '$(TestOutputDir)'" /> Date: Mon, 28 Aug 2017 12:39:12 -0700 Subject: [PATCH 11/23] Fix DotNetRestore after merging upstream changes --- build_projects/dotnet-cli-build/DotNetRestore.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/build_projects/dotnet-cli-build/DotNetRestore.cs b/build_projects/dotnet-cli-build/DotNetRestore.cs index 88bca5e22..d7d984be3 100644 --- a/build_projects/dotnet-cli-build/DotNetRestore.cs +++ b/build_projects/dotnet-cli-build/DotNetRestore.cs @@ -12,13 +12,11 @@ namespace Microsoft.DotNet.Cli.Build protected override string Args { - get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; } + get { return $"{base.Args} {GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {AdditionalParameters}"; } } public string ConfigFile { get; set; } - public string AdditionalParameters { get; set; } - public string ProjectPath { get; set; } public string Source { get; set; } @@ -88,10 +86,5 @@ namespace Microsoft.DotNet.Cli.Build return null; } - - private string GetAdditionalParameters() - { - return AdditionalParameters; - } } } From dcb3a7ade75c360d9a1673e0c22cfe046ad50e34 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Mon, 28 Aug 2017 16:38:55 -0700 Subject: [PATCH 12/23] Use shorter output paths to avoid max path issues on Windows For example, "out/2" instead of "artifacts/stage2" --- .gitignore | 1 + build/InitRepo.props | 2 +- build/OutputDirectories.props | 2 +- build/Prepare.targets | 2 +- .../RepoDirectoriesProvider.cs | 7 +++++-- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7bed92752..a5216b7f7 100644 --- a/.gitignore +++ b/.gitignore @@ -96,6 +96,7 @@ dlldata.c # DNX project.lock.json artifacts/ +out/ *_i.c *_p.c diff --git a/build/InitRepo.props b/build/InitRepo.props index 3a17534a9..ff909b2c9 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -1,6 +1,6 @@ - $(RepoRoot)/artifacts/obj + $(RepoRoot)/out/obj $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 46407809d..1c9ce7c76 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -6,7 +6,7 @@ - $(RepoRoot)/artifacts/stage$(CliBuildStage)/$(Rid) + $(RepoRoot)/out/$(CliBuildStage)/$(Rid) $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/bin/$(MSBuildProjectName)')) $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)')) diff --git a/build/Prepare.targets b/build/Prepare.targets index 67ae12cab..8858e03b3 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -100,7 +100,7 @@ diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index 6f465a5b1..9baccc2bf 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities { if (string.IsNullOrEmpty(s_buildRid)) { - var buildInfoPath = Path.Combine(RepoRoot, "artifacts", "obj", "BuildInfo.props"); + var buildInfoPath = Path.Combine(RepoRoot, "out", "obj", "BuildInfo.props"); var root = XDocument.Load(buildInfoPath).Root; var ns = root.Name.Namespace; @@ -99,7 +99,10 @@ namespace Microsoft.DotNet.Tools.Test.Utilities string corehostDummyPackages = null, string pjDotnet = null) { - _artifacts = artifacts ?? Path.Combine(RepoRoot, "artifacts", "stage2", BuildRid); + _artifacts = artifacts ?? Path.Combine(RepoRoot, + "out", + "2", // Stage - ideally this would come from the "previous stage" + BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); _pjDotnet = pjDotnet ?? GetPjDotnetPath(); From 103b8a6ec4495fbc441ec3dba08b9d8373144c6b Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 29 Aug 2017 09:59:38 -0700 Subject: [PATCH 13/23] Fix test asset that had NuGet.Config pointing to incorrect directory --- .../TestProjects/MSBuildTestApp/MSBuildTestApp.csproj | 1 + TestAssets/TestProjects/MSBuildTestApp/NuGet.Config | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 TestAssets/TestProjects/MSBuildTestApp/NuGet.Config diff --git a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj index b68fa804c..0bfe9b1e3 100644 --- a/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj +++ b/TestAssets/TestProjects/MSBuildTestApp/MSBuildTestApp.csproj @@ -5,6 +5,7 @@ Exe netcoreapp2.1 win7-x64;win7-x86;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;centos.7-x64;rhel.7-x64;debian.8-x64;fedora.24-x64;opensuse.42.1-x64 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config b/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/MSBuildTestApp/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 9fb5f746ae8ebc51a8bdf11a81a2d9a1ce7f0304 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 29 Aug 2017 11:26:28 -0700 Subject: [PATCH 14/23] Fix multiple tests using same output path --- test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs index 351e73539..96aa81ab6 100644 --- a/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs +++ b/test/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs @@ -131,7 +131,7 @@ namespace Microsoft.DotNet.Cli.Build.Tests { var testAppName = "MSBuildTestApp"; var testInstance = TestAssets.Get(testAppName) - .CreateInstance(testAppName) + .CreateInstance() .WithSourceFiles() .WithRestoreFiles(); From fd66cdcc2fe1da99f241e95b72257df980f72322 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 29 Aug 2017 11:27:29 -0700 Subject: [PATCH 15/23] Fix test assets with NuGet.Config files pointing to old layout --- .../AppWithRedirectsAndConfig.csproj | 1 + .../AppWithRedirectsNoConfig.csproj | 1 + .../DesktopTestProjects/BindingRedirectSample/NuGet.Config | 6 ------ .../AppWithDepOnToolWithOutputName.csproj | 1 + .../AppWithDepOnToolWithOutputName/NuGet.Config | 6 ------ .../AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj | 1 + .../TestProjects/AppWithDirectAndToolDep/NuGet.Config | 6 ------ .../TestProjects/AppWithDirectDep/AppWithDirectDep.csproj | 1 + TestAssets/TestProjects/AppWithDirectDep/NuGet.Config | 6 ------ .../MSBuildAppWithMultipleFrameworksAndTools.csproj | 1 + .../TestProjects/AppWithMultipleFxAndTools/NuGet.Config | 6 ------ .../AppWithToolDependency/AppWithToolDependency.csproj | 1 + TestAssets/TestProjects/AppWithToolDependency/NuGet.Config | 6 ------ TestAssets/TestProjects/NuGet.Config | 6 ------ TestAssets/TestProjects/global.json | 3 --- 15 files changed, 7 insertions(+), 45 deletions(-) delete mode 100644 TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithDirectDep/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config delete mode 100644 TestAssets/TestProjects/AppWithToolDependency/NuGet.Config delete mode 100644 TestAssets/TestProjects/NuGet.Config delete mode 100644 TestAssets/TestProjects/global.json diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj index 82a5ad25d..287b089bb 100644 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj +++ b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsAndConfig/AppWithRedirectsAndConfig.csproj @@ -4,6 +4,7 @@ AppWithRedirectsAndConfig Exe win7-x64;win7-x86 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj index 94b99d56b..8e5fc172e 100644 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj +++ b/TestAssets/DesktopTestProjects/BindingRedirectSample/AppWithRedirectsNoConfig/AppWithRedirectsNoConfig.csproj @@ -4,6 +4,7 @@ AppWithRedirectsNoConfig Exe win7-x64;win7-x86 + $(TEST_PACKAGES) diff --git a/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config b/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/DesktopTestProjects/BindingRedirectSample/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj index b4d5af2e5..4ea5be23c 100755 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj +++ b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/AppWithDepOnToolWithOutputName.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config b/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithDepOnToolWithOutputName/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj index 748181c2b..afcfb340e 100755 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectAndToolDep/AppWithDirectAndToolDep.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config deleted file mode 100644 index dd7ccd7af..000000000 --- a/TestAssets/TestProjects/AppWithDirectAndToolDep/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj index ba0d8a628..5b5c0f757 100755 --- a/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj +++ b/TestAssets/TestProjects/AppWithDirectDep/AppWithDirectDep.csproj @@ -7,6 +7,7 @@ AppWithDirectDep Exe false + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config b/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config deleted file mode 100644 index dd7ccd7af..000000000 --- a/TestAssets/TestProjects/AppWithDirectDep/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj index b0a9a3aa0..abda3b8a9 100644 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj +++ b/TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj @@ -4,6 +4,7 @@ Exe net451;netcoreapp2.1 + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config b/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithMultipleFxAndTools/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj index 17f43a432..a18ee9852 100755 --- a/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj +++ b/TestAssets/TestProjects/AppWithToolDependency/AppWithToolDependency.csproj @@ -4,6 +4,7 @@ netcoreapp2.1 Exe + $(TEST_PACKAGES) diff --git a/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config b/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config deleted file mode 100644 index b8e876fcb..000000000 --- a/TestAssets/TestProjects/AppWithToolDependency/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/NuGet.Config b/TestAssets/TestProjects/NuGet.Config deleted file mode 100644 index b03d4d16c..000000000 --- a/TestAssets/TestProjects/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/TestAssets/TestProjects/global.json b/TestAssets/TestProjects/global.json deleted file mode 100644 index 09f20328d..000000000 --- a/TestAssets/TestProjects/global.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "projects": [ ".", "../../src" ] -} \ No newline at end of file From 4c3b13e4a8e8c3f074c0b385ae1b9938a454b5b5 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Tue, 29 Aug 2017 17:59:34 -0700 Subject: [PATCH 16/23] Use a shorter path for test working directories, get rid of Stage 0 project.json based CLI --- run-build.ps1 | 20 -- run-build.sh | 13 -- .../TestAssetInfo.cs | 28 +-- .../TestAssets.cs | 45 +---- .../Commands/BuildPJCommand.cs | 183 ------------------ .../Commands/RestoreProjectJsonCommand.cs | 28 --- .../RepoDirectoriesProvider.cs | 26 +-- .../TestBase.cs | 2 +- 8 files changed, 32 insertions(+), 313 deletions(-) delete mode 100644 test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs delete mode 100644 test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs diff --git a/run-build.ps1 b/run-build.ps1 index 137c93d65..cd68ca54b 100644 --- a/run-build.ps1 +++ b/run-build.ps1 @@ -53,18 +53,6 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR)) mkdir $env:DOTNET_INSTALL_DIR | Out-Null } -# We also need to pull down a project.json based CLI that is used by some tests -# so create another directory for that. -if (!$env:DOTNET_INSTALL_DIR_PJ) -{ - $env:DOTNET_INSTALL_DIR_PJ="$RepoRoot\.dotnet_stage0PJ\$Architecture" -} - -if (!(Test-Path $env:DOTNET_INSTALL_DIR_PJ)) -{ - mkdir $env:DOTNET_INSTALL_DIR_PJ | Out-Null -} - # Disable first run since we want to control all package sources @@ -88,14 +76,6 @@ if ($LastExitCode -ne 0) exit $LastExitCode } -Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" -Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177" -if ($LastExitCode -ne 0) -{ - Write-Output "The .NET CLI installation failed with exit code $LastExitCode" - exit $LastExitCode -} - # Put the stage0 on the path $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH" diff --git a/run-build.sh b/run-build.sh index dd011e544..02ce271ab 100755 --- a/run-build.sh +++ b/run-build.sh @@ -139,11 +139,6 @@ args=($temp) [ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$ARCHITECTURE [ -d "$DOTNET_INSTALL_DIR" ] || mkdir -p $DOTNET_INSTALL_DIR -# We also need to pull down a project.json based CLI that is used by some tests -# so create another directory for that. -[ -z "$DOTNET_INSTALL_DIR_PJ" ] && export DOTNET_INSTALL_DIR_PJ=$REPOROOT/.dotnet_stage0PJ/$ARCHITECTURE -[ -d "$DOTNET_INSTALL_DIR_PJ" ] || mkdir -p $DOTNET_INSTALL_DIR_PJ - export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 # Enable verbose VS Test Console logging @@ -163,14 +158,6 @@ if [ $EXIT_CODE != 0 ]; then exit $EXIT_CODE fi -# Install a project.json based CLI for use by tests -(set -x ; "$REPOROOT/scripts/obtain/dotnet-install.sh" --channel "master" --install-dir "$DOTNET_INSTALL_DIR_PJ" --architecture "$ARCHITECTURE" --version "1.0.0-preview2-1-003177") -EXIT_CODE=$? -if [ $EXIT_CODE != 0 ]; then - echo "run-build: Error: installing project-json based cli failed with exit code $EXIT_CODE." >&2 - exit $EXIT_CODE -fi - # Put stage 0 on the PATH (for this shell only) PATH="$DOTNET_INSTALL_DIR:$PATH" diff --git a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs b/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs index f5ca0aebe..bec0b5729 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssetInfo.cs @@ -15,13 +15,15 @@ namespace Microsoft.DotNet.TestFramework public string AssetName { get; private set; } - public FileInfo DotnetExeFile { get; private set; } + public FileInfo DotnetExeFile => _testAssets.DotnetCsprojExe; - public string ProjectFilePattern { get; private set; } + public string ProjectFilePattern => "*.csproj"; public DirectoryInfo Root { get; private set; } - internal TestAssetInfo(DirectoryInfo root, string assetName, FileInfo dotnetExeFile, string projectFilePattern) + private TestAssets _testAssets { get; } + + internal TestAssetInfo(DirectoryInfo root, string assetName, TestAssets testAssets) { if (root == null) { @@ -33,23 +35,16 @@ namespace Microsoft.DotNet.TestFramework throw new ArgumentException("Argument cannot be null or whitespace", nameof(assetName)); } - if (dotnetExeFile == null) + if (testAssets == null) { - throw new ArgumentNullException(nameof(dotnetExeFile)); - } - - if (string.IsNullOrWhiteSpace(projectFilePattern)) - { - throw new ArgumentException("Argument cannot be null or whitespace", nameof(projectFilePattern)); + throw new ArgumentNullException(nameof(testAssets)); } Root = root; AssetName = assetName; - DotnetExeFile = dotnetExeFile; - - ProjectFilePattern = projectFilePattern; + _testAssets = testAssets; } public TestAssetInstance CreateInstance([CallerMemberName] string callingMethod = "", string identifier = "") @@ -71,12 +66,7 @@ namespace Microsoft.DotNet.TestFramework private DirectoryInfo GetTestDestinationDirectory(string callingMethod, string identifier) { -#if NET451 - string baseDirectory = AppDomain.CurrentDomain.BaseDirectory; -#else - string baseDirectory = AppContext.BaseDirectory; -#endif - return new DirectoryInfo(Path.Combine(baseDirectory, callingMethod + identifier, AssetName)); + return _testAssets.CreateTestDirectory(AssetName, callingMethod, identifier); } private void ThrowIfTestAssetDoesNotExist() diff --git a/src/Microsoft.DotNet.TestFramework/TestAssets.cs b/src/Microsoft.DotNet.TestFramework/TestAssets.cs index 0e47e3ba9..6d05788fd 100644 --- a/src/Microsoft.DotNet.TestFramework/TestAssets.cs +++ b/src/Microsoft.DotNet.TestFramework/TestAssets.cs @@ -17,13 +17,11 @@ namespace Microsoft.DotNet.TestFramework private FileInfo _dotnetCsprojExe; - private FileInfo _dotnetProjectJsonExe; + private string _testWorkingFolder; - private const string ProjectJsonSearchPattern = "project.json"; + public FileInfo DotnetCsprojExe => _dotnetCsprojExe; - private const string CsprojSearchPattern = "*.csproj"; - - public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, FileInfo dotnetProjectJsonExe) + public TestAssets(DirectoryInfo assetsRoot, FileInfo dotnetCsprojExe, string testWorkingFolder) { if (assetsRoot == null) { @@ -35,11 +33,6 @@ namespace Microsoft.DotNet.TestFramework throw new ArgumentNullException(nameof(dotnetCsprojExe)); } - if (dotnetProjectJsonExe == null) - { - throw new ArgumentNullException(nameof(dotnetProjectJsonExe)); - } - if (!assetsRoot.Exists) { throw new DirectoryNotFoundException($"Directory not found at '{assetsRoot}'"); @@ -50,16 +43,10 @@ namespace Microsoft.DotNet.TestFramework throw new FileNotFoundException("Csproj dotnet executable must exist", dotnetCsprojExe.FullName); } - if (!dotnetProjectJsonExe.Exists) - { - throw new FileNotFoundException("project.json dotnet executable must exist", dotnetProjectJsonExe.FullName); - } - _root = assetsRoot; _dotnetCsprojExe = dotnetCsprojExe; - - _dotnetProjectJsonExe = dotnetProjectJsonExe; + _testWorkingFolder = testWorkingFolder; } public TestAssetInfo Get(string name) @@ -74,24 +61,7 @@ namespace Microsoft.DotNet.TestFramework return new TestAssetInfo( assetDirectory, name, - _dotnetCsprojExe, - CsprojSearchPattern); - } - - public TestAssetInfo GetProjectJson(string name) - { - return GetProjectJson(TestAssetKinds.TestProjects, name); - } - - public TestAssetInfo GetProjectJson(string kind, string name) - { - var assetDirectory = new DirectoryInfo(Path.Combine(_root.FullName, kind, name)); - - return new TestAssetInfo( - assetDirectory, - name, - _dotnetProjectJsonExe, - ProjectJsonSearchPattern); + this); } public DirectoryInfo CreateTestDirectory(string testProjectName = "temp", [CallerMemberName] string callingMethod = "", string identifier = "") @@ -112,7 +82,10 @@ namespace Microsoft.DotNet.TestFramework #else string baseDirectory = AppContext.BaseDirectory; #endif - return Path.Combine(baseDirectory, callingMethod + identifier, testProjectName); + // Find the name of the assembly the test comes from based on the the base directory and how the output path has been constructed + string testAssemblyName = new DirectoryInfo(baseDirectory).Parent.Parent.Name; + + return Path.Combine(_testWorkingFolder, testAssemblyName, callingMethod + identifier, testProjectName); } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs deleted file mode 100644 index 6b05edfe8..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/BuildPJCommand.cs +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using System.IO; -using Microsoft.DotNet.Cli.Utils; -using NuGet.Frameworks; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class BuildPJCommand : TestCommand - { - - private bool _captureOutput; - - private string _configuration; - - private NuGetFramework _framework; - - private string _runtime; - - private bool _noDependencies; - - private DirectoryInfo _outputPath; - - private FileInfo _projectFile; - - private DirectoryInfo _workingDirectory; - - public BuildPJCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args = "") - { - args = $"build {GetNoDependencies()} {GetProjectFile()} {GetOutputPath()} {GetConfiguration()} {GetFramework()} {GetRuntime()} {args}"; - - if (_workingDirectory != null) - { - this.WithWorkingDirectory(_workingDirectory.FullName); - } - - if (_captureOutput) - { - return base.ExecuteWithCapturedOutput(args); - } - else - { - return base.Execute(args); - } - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - WithCapturedOutput(); - - return Execute(args); - } - - public BuildPJCommand WithCapturedOutput() - { - _captureOutput = true; - - return this; - } - - public BuildPJCommand WithConfiguration(string configuration) - { - _configuration = configuration; - - return this; - } - - public BuildPJCommand WithFramework(NuGetFramework framework) - { - _framework = framework; - - return this; - } - - public BuildPJCommand WithRuntime(string runtime) - { - _runtime = runtime; - - return this; - } - - public BuildPJCommand WithNoDependencies() - { - _noDependencies = true; - - return this; - } - - public BuildPJCommand WithOutputPath(DirectoryInfo outputPath) - { - _outputPath = outputPath; - - return this; - } - - public BuildPJCommand WithProjectDirectory(DirectoryInfo projectDirectory) - { - _workingDirectory = projectDirectory; - - return this; - } - - public BuildPJCommand WithProjectFile(FileInfo projectFile) - { - _projectFile = projectFile; - - return this; - } - - public BuildPJCommand WithWorkingDirectory(DirectoryInfo workingDirectory) - { - _workingDirectory = workingDirectory; - - return this; - } - - private string GetConfiguration() - { - if (_configuration == null) - { - return null; - } - - return $"--configuration {_configuration}"; - } - - private string GetFramework() - { - if (_framework == null) - { - return null; - } - - return $"--framework {_framework.GetShortFolderName()}"; - } - - private string GetRuntime() - { - if (_runtime == null) - { - return null; - } - - return $"--runtime {_runtime}"; - } - - private string GetNoDependencies() - { - if (!_noDependencies) - { - return null; - } - - return "--no-dependencies"; - } - - private string GetOutputPath() - { - if (_outputPath == null) - { - return null; - } - - return $"\"{_outputPath.FullName}\""; - } - - private string GetProjectFile() - { - if (_projectFile == null) - { - return null; - } - - return $"\"{_projectFile.FullName}\""; - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs deleted file mode 100644 index a54d89605..000000000 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/Commands/RestoreProjectJsonCommand.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. -// Licensed under the MIT license. See LICENSE file in the project root for full license information. - -using Microsoft.DotNet.Cli.Utils; - -namespace Microsoft.DotNet.Tools.Test.Utilities -{ - public sealed class RestoreProjectJsonCommand : TestCommand - { - public RestoreProjectJsonCommand() - : base(new RepoDirectoriesProvider().PjDotnet) - { - } - - public override CommandResult Execute(string args="") - { - args = $"restore {args}"; - - return base.Execute(args); - } - - public override CommandResult ExecuteWithCapturedOutput(string args = "") - { - args = $"restore {args}"; - return base.ExecuteWithCapturedOutput(args); - } - } -} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index 9baccc2bf..afacb335c 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -20,7 +20,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities private string _stage2Sdk; private string _stage2WithBackwardsCompatibleRuntimesDirectory; private string _testPackages; - private string _pjDotnet; + private string _testWorkingFolder; public static string RepoRoot { @@ -86,26 +86,27 @@ namespace Microsoft.DotNet.Tools.Test.Utilities public string Artifacts => _artifacts; public string BuiltDotnet => _builtDotnet; public string NugetPackages => _nugetPackages; - public string PjDotnet => _pjDotnet; public string Stage2Sdk => _stage2Sdk; public string Stage2WithBackwardsCompatibleRuntimesDirectory => _stage2WithBackwardsCompatibleRuntimesDirectory; public string TestPackages => _testPackages; + public string TestWorkingFolder => _testWorkingFolder; public RepoDirectoriesProvider( string artifacts = null, string builtDotnet = null, string nugetPackages = null, string corehostPackages = null, - string corehostDummyPackages = null, - string pjDotnet = null) + string corehostDummyPackages = null) { + // Ideally this wouldn't be hardcoded, so that you could use stage n to build stage n + 1, and then use stage n + 1 to run tests + int previousStage = 2; + _artifacts = artifacts ?? Path.Combine(RepoRoot, "out", - "2", // Stage - ideally this would come from the "previous stage" + previousStage.ToString(), BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); _nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages"); - _pjDotnet = pjDotnet ?? GetPjDotnetPath(); _stage2Sdk = Directory .EnumerateDirectories(Path.Combine(_artifacts, "dotnet", "sdk")) .First(d => !d.Contains("NuGetFallbackFolder")); @@ -118,14 +119,13 @@ namespace Microsoft.DotNet.Tools.Test.Utilities { throw new InvalidOperationException("TEST_PACKAGES environment variable not set"); } - } - private string GetPjDotnetPath() - { - return new DirectoryInfo(Path.Combine(RepoRoot, ".dotnet_stage0PJ")) - .GetDirectories().First() - .GetFiles("dotnet*").First() - .FullName; + _testWorkingFolder = Path.Combine(RepoRoot, + "out", + (previousStage + 1).ToString(), + BuildRid, + "test"); + } } } diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs index b377b4331..6c2c43346 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs @@ -53,7 +53,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities s_testAssets = new TestAssets( new DirectoryInfo(assetsRoot), new FileInfo(new Muxer().MuxerPath), - new FileInfo(new RepoDirectoriesProvider().PjDotnet)); + new RepoDirectoriesProvider().TestWorkingFolder); } return s_testAssets; From ac67434ea4654cea2c7a9856e460d37d6acd0bbb Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 12:12:10 -0700 Subject: [PATCH 17/23] Fix debian package generation Previously, dotnet-deb-tool-consumer.csproj was copied to the out/artifacts folder before being restored. This no longer works as it depends on repo properties, and there is a Directory.Build.props in teh out directory to stop projects inside it from getting the repo properties. So this change restores it in-place instead. --- build/package/Installer.DEB.proj | 12 +----------- build/package/Installer.DEB.targets | 3 +-- .../dotnet-deb-tool-consumer.csproj | 0 3 files changed, 2 insertions(+), 13 deletions(-) rename build/package/{ => dotnet-deb-tool-consumer}/dotnet-deb-tool-consumer.csproj (100%) diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index d06be6a30..4b684d161 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -156,22 +156,12 @@ - + - - - - - - diff --git a/build/package/Installer.DEB.targets b/build/package/Installer.DEB.targets index d25e10331..cb157cc40 100644 --- a/build/package/Installer.DEB.targets +++ b/build/package/Installer.DEB.targets @@ -8,8 +8,7 @@ - dotnet-deb-tool-consumer.csproj - $(IntermediateDirectory)/$(DotnetDebToolConsumerProjectName) + $(MSBuildThisFileDirectory)/dotnet-deb-tool-consumer $(NuGetPackagesDir)/dotnet-deb-tool/$(DotnetDebToolVersion)/lib/netcoreapp2.0/tool/package_tool diff --git a/build/package/dotnet-deb-tool-consumer.csproj b/build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj similarity index 100% rename from build/package/dotnet-deb-tool-consumer.csproj rename to build/package/dotnet-deb-tool-consumer/dotnet-deb-tool-consumer.csproj From 546eff28c2ce6b1d25f69ae9d04123e25ec335de Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 13:50:01 -0700 Subject: [PATCH 18/23] Delete outdated comment --- build/OutputDirectories.props | 1 - 1 file changed, 1 deletion(-) diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 1c9ce7c76..24781a476 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -21,7 +21,6 @@ $(BaseOutputDirectory)/packages $(IntermediateDirectory)/sharedFrameworkPublish - $(BaseOutputDirectory)/AspRT $(IntermediateDirectory)/backwardsCompatibleSharedFrameworksPublish $(BaseOutputDirectory)/test/ From 27dc8032dd8a725b85a486e8608f55d07a7a21e7 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 13:53:17 -0700 Subject: [PATCH 19/23] Fix test that depended on old output directory layout --- .../AspNetNuGetConfiguration.cs | 17 +++++++++++++++++ test/dotnet-new.Tests/GivenThatIWantANewApp.cs | 3 ++- .../GivenThatIWantANewAppWithSpecifiedType.cs | 7 +------ 3 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 test/dotnet-new.Tests/AspNetNuGetConfiguration.cs diff --git a/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs b/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs new file mode 100644 index 000000000..b49c81009 --- /dev/null +++ b/test/dotnet-new.Tests/AspNetNuGetConfiguration.cs @@ -0,0 +1,17 @@ +using System.IO; + +namespace Microsoft.DotNet.New.Tests +{ + public class AspNetNuGetConfiguration + { + public static void WriteNuGetConfigWithAspNetPrivateFeeds(string path) + { + string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config"; + using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName)) + using (Stream output = File.OpenWrite(path)) + { + input.CopyTo(output); + } + } + } +} \ No newline at end of file diff --git a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs index d5f80ede3..8488febfc 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewApp.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewApp.cs @@ -45,7 +45,8 @@ namespace Microsoft.DotNet.New.Tests var packagesDirectory = Path.Combine(rootPath, "packages"); // For testing the 2.1 templates - some of their packages are currently only in private feeds. - var configFile = Path.Combine(rootPath, "..", "..", "..", "..", "..", "NuGet.tempaspnetpatch.config"); + var configFile = Path.Combine(rootPath, "NuGet.Config"); + AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(configFile); // For "normal" builds, once the packages needed for 2.1 templates are in the public feeds //var configFile = Path.Combine(RepoDirectoriesProvider.RepoRoot, "NuGet.Config"); diff --git a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs index bf147fb6f..e1c1fea85 100644 --- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs +++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs @@ -51,12 +51,7 @@ namespace Microsoft.DotNet.New.Tests if (useNuGetConfigForAspNet) { - string resourceName = "dotnet-new.Tests.NuGet.tempaspnetpatch.config"; - using (Stream input = typeof(GivenThatIWantANewAppWithSpecifiedType).Assembly.GetManifestResourceStream(resourceName)) - using (Stream output = File.OpenWrite(Path.Combine(rootPath, "NuGet.Config"))) - { - input.CopyTo(output); - } + AspNetNuGetConfiguration.WriteNuGetConfigWithAspNetPrivateFeeds(Path.Combine(rootPath, "NuGet.Config")); } if (skipSpaWebpackSteps) From 97b7553e31261dc87d82109566ae9afc66d0c7de Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 14:04:52 -0700 Subject: [PATCH 20/23] Rename output folder from out to bin --- .gitignore | 2 +- build/InitRepo.props | 2 +- build/OutputDirectories.props | 2 +- build/Prepare.targets | 2 +- .../RepoDirectoriesProvider.cs | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index a5216b7f7..a9597138b 100644 --- a/.gitignore +++ b/.gitignore @@ -96,7 +96,7 @@ dlldata.c # DNX project.lock.json artifacts/ -out/ +bin/ *_i.c *_p.c diff --git a/build/InitRepo.props b/build/InitRepo.props index ff909b2c9..f917b88c2 100644 --- a/build/InitRepo.props +++ b/build/InitRepo.props @@ -1,6 +1,6 @@ - $(RepoRoot)/out/obj + $(RepoRoot)/bin/obj $(GeneratedPropsDir)/GitCommitInfo.props $(GeneratedPropsDir)/HostInfo.props $(GeneratedPropsDir)/BuildInfo.props diff --git a/build/OutputDirectories.props b/build/OutputDirectories.props index 24781a476..74c002c6b 100644 --- a/build/OutputDirectories.props +++ b/build/OutputDirectories.props @@ -6,7 +6,7 @@ - $(RepoRoot)/out/$(CliBuildStage)/$(Rid) + $(RepoRoot)/bin/$(CliBuildStage)/$(Rid) $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/bin/$(MSBuildProjectName)')) $([System.IO.Path]::GetFullPath('$(BaseOutputDirectory)/obj/$(MSBuildProjectName)')) diff --git a/build/Prepare.targets b/build/Prepare.targets index 8858e03b3..3b373ecfc 100644 --- a/build/Prepare.targets +++ b/build/Prepare.targets @@ -100,7 +100,7 @@ diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs index afacb335c..056b1c197 100644 --- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs @@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities { if (string.IsNullOrEmpty(s_buildRid)) { - var buildInfoPath = Path.Combine(RepoRoot, "out", "obj", "BuildInfo.props"); + var buildInfoPath = Path.Combine(RepoRoot, "bin", "obj", "BuildInfo.props"); var root = XDocument.Load(buildInfoPath).Root; var ns = root.Name.Namespace; @@ -102,7 +102,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities int previousStage = 2; _artifacts = artifacts ?? Path.Combine(RepoRoot, - "out", + "bin", previousStage.ToString(), BuildRid); _builtDotnet = builtDotnet ?? Path.Combine(_artifacts, "intermediate", "sharedFrameworkPublish"); @@ -121,7 +121,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities } _testWorkingFolder = Path.Combine(RepoRoot, - "out", + "bin", (previousStage + 1).ToString(), BuildRid, "test"); From 88319a71f3f56fdcedc0919351f190e525e7ecaa Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 16:43:40 -0700 Subject: [PATCH 21/23] Remove duplicate import --- build/sdks/sdks.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/build/sdks/sdks.csproj b/build/sdks/sdks.csproj index da276047e..f246e1f9d 100755 --- a/build/sdks/sdks.csproj +++ b/build/sdks/sdks.csproj @@ -1,6 +1,5 @@  - Library From 728cea22f133976098f10bd4dee9b173f298b5b1 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 17:17:33 -0700 Subject: [PATCH 22/23] Update signing.proj to use new output paths, and import common repo props --- build/MicroBuild.props | 3 --- build/Signing.proj | 24 ++---------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/build/MicroBuild.props b/build/MicroBuild.props index 1cf77f45b..f55a5eea1 100644 --- a/build/MicroBuild.props +++ b/build/MicroBuild.props @@ -1,9 +1,6 @@ - - $(MSBuildThisFileDirectory)/.. - $(NUGET_PACKAGES) $(RepoRoot)/.nuget/packages $(NuGetPackagesDir)/microbuild.core/$(MicroBuildVersion)/build/ diff --git a/build/Signing.proj b/build/Signing.proj index e3bef0122..3982962d6 100644 --- a/build/Signing.proj +++ b/build/Signing.proj @@ -1,9 +1,8 @@ + - - @@ -13,10 +12,6 @@ - $(RepoRoot)/artifacts/$(Rid) - $(BaseOutputDirectory)/stage2 - $(BaseOutputDirectory)/stage2compilation - $(BaseOutputDirectory)/packages $(BaseOutputDirectory)/intermediate/MSBuildExtensionsLayout/MSBuildSdkResolver - + $(InternalCertificateId) @@ -76,9 +68,6 @@ - - $(SdkResolverOutputDirectory) - $(InternalCertificateId) @@ -89,9 +78,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) @@ -105,9 +91,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) @@ -118,9 +101,6 @@ - - $(PackagesDirectory) - $(InternalCertificateId) From 6e0646f7bfba739a4ef3d8bacebcbd545a324a32 Mon Sep 17 00:00:00 2001 From: Daniel Plaisted Date: Fri, 1 Sep 2017 18:21:25 -0700 Subject: [PATCH 23/23] Update environment variables for EndToEnd test run on Debian package --- build/package/Installer.DEB.targets | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/package/Installer.DEB.targets b/build/package/Installer.DEB.targets index cb157cc40..7f6c707fd 100644 --- a/build/package/Installer.DEB.targets +++ b/build/package/Installer.DEB.targets @@ -110,6 +110,9 @@ + + +