Move TestProjects.* to src/test. Update resolution of these files to go through RepoD...
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Tue, 22 Oct 2019 23:35:38 +0000 (16:35 -0700)
committerGitHub <noreply@github.com>
Tue, 22 Oct 2019 23:35:38 +0000 (16:35 -0700)
Commit migrated from https://github.com/dotnet/core-setup/commit/45647dc7f3b3f93ee82cd24921411fcaf25d5c4a

src/installer/test/Directory.Build.targets
src/installer/test/TestProjects.props [moved from src/installer/TestProjects.props with 58% similarity]
src/installer/test/TestProjects.targets [moved from src/installer/TestProjects.targets with 100% similarity]
src/installer/test/TestUtils/RepoDirectoriesProvider.cs
src/installer/test/TestUtils/TestProjectFixture.cs

index 701065e..9188a48 100644 (file)
@@ -83,6 +83,7 @@
       <TestContextVariable Include="MNA_VERSION=$(NETCoreAppRuntimePackageVersion)" />
       <TestContextVariable Include="MNA_TFM=$(NETCoreAppFramework)" />
       <TestContextVariable Include="DOTNET_SDK_PATH=$(DotNetRoot)" />
+      <TestContextVariable Include="TEST_PROJECTS_PROPS_TARGETS_FOLDER=$(MSBuildThisFileDirectory)" />
     </ItemGroup>
 
     <WriteLinesToFile
similarity index 58%
rename from src/installer/TestProjects.props
rename to src/installer/test/TestProjects.props
index 877d439..0a7c276 100644 (file)
@@ -2,10 +2,12 @@
   <!--
     This file is imported by the test projects from the artifacts dir or the src/tests dir. It
     provides basic info needed for restore and build with the vanilla SDK.
+    Since this file doesn't include the Arcade SDK, we need to find the root eng folder
+    in a different manner than using the $(RepositoryEngineeringDir) variable.
   -->
 
-  <Import Project="eng\Versions.props" />
-  <Import Project="src\test\Assets\TestProjects\MNADeprecationWorkaround.props" />
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),global.json))\eng\Versions.props" />
+  <Import Project="Assets\TestProjects\MNADeprecationWorkaround.props" />
 
   <PropertyGroup>
     <!--
index f30695f..8f1060b 100644 (file)
@@ -13,6 +13,7 @@ namespace Microsoft.DotNet.CoreSetup.Test
         public string BuildArchitecture { get; }
         public string TargetRID { get; }
         public string MicrosoftNETCoreAppVersion { get; }
+        public string TestProjectsMSBuildFilesFolder { get; }
         public string Configuration { get; }
         public string RepoRoot { get; }
         public string BaseArtifactsFolder { get; }
@@ -57,6 +58,7 @@ namespace Microsoft.DotNet.CoreSetup.Test
             BuildRID = GetTestContextVariable("BUILDRID");
             BuildArchitecture = GetTestContextVariable("BUILD_ARCHITECTURE");
             MicrosoftNETCoreAppVersion = microsoftNETCoreAppVersion ?? GetTestContextVariable("MNA_VERSION");
+            TestProjectsMSBuildFilesFolder = GetTestContextVariable("TEST_PROJECTS_PROPS_TARGETS_FOLDER");
 
             Configuration = GetTestContextVariable("BUILD_CONFIGURATION");
             string osPlatformConfig = $"{BuildRID}.{Configuration}";
index e69ef93..e682a9a 100644 (file)
@@ -98,7 +98,7 @@ namespace Microsoft.DotNet.CoreSetup.Test
             string.Join(
                 Environment.NewLine,
                 "<Project>",
-                $"  <Import Project=\"$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), TestProjects.{type}))\\TestProjects.{type}\" />",
+                $"  <Import Project=\"{RepoDirProvider.TestProjectsMSBuildFilesFolder}/TestProjects.{type}\" />",
                 "</Project>"));
 
         private void EnsureFileWithContent(string path, string content)