diff --git a/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj b/TestAssets/DesktopTestProjects/AppWithProjTool2Fx/App.csproj
index f72d85fc6..6b6514fb3 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 d57f09629..bad19bf93 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.0
+ $(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 5afb24921..3a99fed0d 100755
--- a/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj
+++ b/TestAssets/TestProjects/AppWithDirectDepWithOutputName/AppWithDirectDepWithOutputName.csproj
@@ -4,6 +4,7 @@
netcoreapp2.0
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 705cf2077..1410deeb4 100755
--- a/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj
+++ b/TestAssets/TestProjects/AppWithFallbackFolderToolDependency/AppWithFallbackFolderToolDependency.csproj
@@ -4,6 +4,7 @@
netcoreapp2.0
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 9c5447b05..4e7b4cd9d 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 3f8176791..c5748e258 100644
--- a/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj
+++ b/TestAssets/TestProjects/TestAppWithProjDepTool/TestAppWithProjDepTool.csproj
@@ -4,6 +4,7 @@
Exe
netcoreapp2.0
+ $(TEST_PACKAGES)
diff --git a/build.proj b/build.proj
index bac606d59..41ab0f56a 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
- $(RepoRoot)/artifacts/testpackages/
+ $(BaseOutputDirectory)/testpackages/
$(OutputDirectory)/dotnet$(ExeExtension)
$(IntermediateDirectory)/GeneratedMSBuildExtensions
$(IntermediateDirectory)/MSBuildExtensionsLayout
diff --git a/build/Test.targets b/build/Test.targets
index 4fadf70e4..c8f4a8829 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/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 e3fc14baa..d5a7ad5d4 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 ddc23506f..1ec0f52b5 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 da856495c..8049d3f4f 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 31c4e1075..ec1d27ff2 100644
--- a/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj
+++ b/test/ArgumentForwardingTests/ArgumentForwardingTests.csproj
@@ -23,7 +23,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 2f5e1e830..8f5fe78ff 100644
--- a/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs
+++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/RepoDirectoriesProvider.cs
@@ -94,17 +94,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 f8ba58ef9..c1a94e084 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 96bb47c51..b387814e9 100644
--- a/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs
+++ b/test/dotnet-new.Tests/GivenThatIWantANewAppWithSpecifiedType.cs
@@ -50,8 +50,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 6c74212af..133fd9730 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 20e165374..a3863f722 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 af559d0b4..b130414b8 100644
--- a/testAsset.props
+++ b/testAsset.props
@@ -1,6 +1,7 @@
+ $(TEST_PACKAGES)
true