Removing the additional shared framework from the official stage2 build of the CLI. Instead, I also create a stage2 build with the legacy runtime so that we can continue to run tests tthat depend on it, but most importantly, we will be able to run backwards compatibility tests using it.

This commit is contained in:
Livar Cunha 2017-04-06 13:43:26 -07:00
parent 95a367136c
commit 772e838ff8
16 changed files with 203 additions and 68 deletions

View file

@ -2,11 +2,12 @@
<PropertyGroup>
<CLITargets Condition=" '$(CLITargets)' == '' ">Prepare;Compile;Test;Package;Publish</CLITargets>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<HasAdditionalSharedFramework Condition="'$(Rid)' != 'linux-x64'">true</HasAdditionalSharedFramework>
<HasAdditionalSharedFramework Condition=" '$(HasAdditionalSharedFramework)' == '' ">false</HasAdditionalSharedFramework>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' AND '$(HasAdditionalSharedFramework)' == 'true' ">true</IncludeAdditionalSharedFrameworks>
<IncludeAdditionalSharedFrameworks Condition=" '$(IncludeAdditionalSharedFrameworks)' == '' ">false</IncludeAdditionalSharedFrameworks>
<IncludeNuGetPackageArchive Condition=" '$(IncludeNuGetPackageArchive)' == '' ">true</IncludeNuGetPackageArchive>
<SkipBuildingInstallers Condition=" '$(SkipBuildingInstallers)' == '' ">false</SkipBuildingInstallers>
<UsePortableLinuxSharedFramework Condition=" '$(UsePortableLinuxSharedFramework)' == '' AND '$(OSPlatform)' == 'linux' ">true</UsePortableLinuxSharedFramework>
<IncludeLegacySharedFramework Condition=" '$(Rid)' != 'linux-x64' ">true</IncludeLegacySharedFramework>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,57 @@
<Project>
<PropertyGroup Condition=" '$(IncludeLegacySharedFramework)' == 'true' ">
<Legacy110CoreSetupChannel>release/1.1.0</Legacy110CoreSetupChannel>
<Legacy110SharedFrameworkVersion>1.1.1</Legacy110SharedFrameworkVersion>
<Legacy110SharedHostVersion>1.1.0</Legacy110SharedHostVersion>
<Legacy110HostFxrVersion>1.1.0</Legacy110HostFxrVersion>
<Legacy110DownloadedSharedHostInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-host-$(ProductMonikerRid).$(Legacy110SharedHostVersion)$(InstallerExtension)</Legacy110DownloadedSharedHostInstallerFileName>
<Legacy110DownloadedSharedHostInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(Legacy110DownloadedSharedHostInstallerFileName)</Legacy110DownloadedSharedHostInstallerFile>
<Legacy110DownloadedHostFxrInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-hostfxr-$(ProductMonikerRid).$(Legacy110HostFxrVersion)$(InstallerExtension)</Legacy110DownloadedHostFxrInstallerFileName>
<Legacy110DownloadedHostFxrInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(Legacy110DownloadedHostFxrInstallerFileName)</Legacy110DownloadedHostFxrInstallerFile>
<Legacy110DownloadedSharedFrameworkInstallerFileName Condition=" '$(InstallerExtension)' != '' ">dotnet-sharedframework-$(ProductMonikerRid).$(Legacy110SharedFrameworkVersion)$(InstallerExtension)</Legacy110DownloadedSharedFrameworkInstallerFileName>
<Legacy110DownloadedSharedFrameworkInstallerFile Condition=" '$(InstallerExtension)' != '' ">$(PackagesDirectory)/$(Legacy110DownloadedSharedFrameworkInstallerFileName)</Legacy110DownloadedSharedFrameworkInstallerFile>
<Legacy110CombinedFrameworkHostCompressedFileName>dotnet-$(ProductMonikerRid).$(Legacy110SharedFrameworkVersion)$(ArchiveExtension)</Legacy110CombinedFrameworkHostCompressedFileName>
<Legacy110CoreSetupBlobRootUrlWithChannel>$(CoreSetupBlobRootUrl)$(Legacy110CoreSetupChannel)</Legacy110CoreSetupBlobRootUrlWithChannel>
<Legacy110SharedFrameworkArchiveBlobRootUrl>$(Legacy110CoreSetupBlobRootUrlWithChannel)/Binaries/$(Legacy110SharedFrameworkVersion)</Legacy110SharedFrameworkArchiveBlobRootUrl>
<Legacy110CoreSetupInstallerBlobRootUrl>$(Legacy110CoreSetupBlobRootUrlWithChannel)/Installers</Legacy110CoreSetupInstallerBlobRootUrl>
<Legacy110CoreSetupDownloadDirectory>$(IntermediateDirectory)/coreSetupDownload/$(Legacy110SharedFrameworkVersion)</Legacy110CoreSetupDownloadDirectory>
<Legacy110CombinedSharedHostAndFrameworkArchive>$(Legacy110CoreSetupDownloadDirectory)/combinedSharedHostAndFrameworkArchive</Legacy110CombinedSharedHostAndFrameworkArchive>
</PropertyGroup>
<ItemGroup Condition=" '$(IncludeLegacySharedFramework)' == 'true' ">
<_DownloadAndExtractItem Include="Legacy110CombinedSharedHostAndFrameworkArchive"
Condition="!Exists('$(Legacy110CombinedSharedHostAndFrameworkArchive)')">
<Url>$(Legacy110SharedFrameworkArchiveBlobRootUrl)/$(Legacy110CombinedFrameworkHostCompressedFileName)</Url>
<DownloadFileName>$(Legacy110CombinedSharedHostAndFrameworkArchive)</DownloadFileName>
<ExtractDestination>$(LegacySharedFrameworkPublishDirectory)</ExtractDestination>
<!-- don't overwrite the destination because there can be multiple shared fx's and they need to be combined -->
<OverwriteDestination>False</OverwriteDestination>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="Legacy110DownloadedSharedFrameworkInstallerFile"
Condition="!Exists('$(Legacy110DownloadedSharedFrameworkInstallerFile)') And '$(InstallerExtension)' != ''">
<Url>$(Legacy110CoreSetupInstallerBlobRootUrl)/$(Legacy110SharedFrameworkVersion)/$(Legacy110DownloadedSharedFrameworkInstallerFileName)</Url>
<DownloadFileName>$(Legacy110DownloadedSharedFrameworkInstallerFile)</DownloadFileName>
<ExtractDestination></ExtractDestination>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="Legacy110DownloadedSharedHostInstallerFile"
Condition="!Exists('$(Legacy110DownloadedSharedHostInstallerFile)') And '$(InstallerExtension)' != ''">
<Url>$(Legacy110CoreSetupInstallerBlobRootUrl)/$(Legacy110SharedHostVersion)/$(Legacy110DownloadedSharedHostInstallerFileName)</Url>
<DownloadFileName>$(Legacy110DownloadedSharedHostInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="Legacy110DownloadedHostFxrInstallerFile"
Condition="!Exists('$(Legacy110DownloadedHostFxrInstallerFile)') And '$(InstallerExtension)' != ''">
<Url>$(Legacy110CoreSetupInstallerBlobRootUrl)/$(Legacy110HostFxrVersion)/$(Legacy110DownloadedHostFxrInstallerFileName)</Url>
<DownloadFileName>$(Legacy110DownloadedHostFxrInstallerFile)</DownloadFileName>
<ExtractDestintation></ExtractDestintation>
</_DownloadAndExtractItem>
</ItemGroup>
</Project>

View file

@ -2,6 +2,7 @@
<PropertyGroup>
<BaseOutputDirectory>$(RepoRoot)/artifacts/$(Rid)</BaseOutputDirectory>
<OutputDirectory>$(BaseOutputDirectory)/stage2</OutputDirectory>
<Stage2WithLegacyRuntimeOutputDirectory>$(BaseOutputDirectory)/stage2WithLegacyRuntime</Stage2WithLegacyRuntimeOutputDirectory>
<SdkOutputDirectory>$(OutputDirectory)/sdk/$(SdkVersion)</SdkOutputDirectory>
<SymbolsDirectory>$(BaseOutputDirectory)/stage2symbols</SymbolsDirectory>
<RoslynDirectory>$(SdkOutputDirectory)/Roslyn</RoslynDirectory>
@ -9,6 +10,7 @@
<IntermediateDirectory>$(BaseOutputDirectory)/intermediate</IntermediateDirectory>
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
<LegacySharedFrameworkPublishDirectory>$(IntermediateDirectory)/legacySharedFrameworkPublish</LegacySharedFrameworkPublishDirectory>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
<DotnetInOutputDirectory>$(OutputDirectory)/dotnet$(ExeExtension)</DotnetInOutputDirectory>
<GeneratedMSBuildExtensionsDirectory>$(IntermediateDirectory)/GeneratedMSBuildExtensions</GeneratedMSBuildExtensionsDirectory>

View file

@ -21,6 +21,7 @@
<SdkProductArchiveResourcesDirectory>$(SdkPkgSourcesRootDirectory)/resources</SdkProductArchiveResourcesDirectory>
<SdkProductArchiveDistributionTemplateFile>$(SdkPkgSourcesRootDirectory)/Distribution-Template</SdkProductArchiveDistributionTemplateFile>
<SdkProductArchiveDistributionTemplateFile Condition=" '$(IncludeAdditionalSharedFrameworks)' == 'true' ">$(SdkPkgSourcesRootDirectory)/Distribution-TemplateWithAdditionalRuntime</SdkProductArchiveDistributionTemplateFile>
<SdkProductArchiveDistributionFile>$(PkgIntermediateDirectory)/CLI-SDK-Formatted-Distribution-Template.xml</SdkProductArchiveDistributionFile>
<SdkPkgIntermediatePath>$(PkgIntermediateDirectory)/$(SdkComponentId).pkg</SdkPkgIntermediatePath>
@ -44,15 +45,6 @@
<DistributionTemplateReplacement Include="{HostFxrComponentId}">
<ReplacementString>$(HostFxrComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalSharedFxComponentId}">
<ReplacementString>$(AdditionalSharedFrameworkComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalSharedHostComponentId}">
<ReplacementString>$(AdditionalSharedHostComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalHostFxrComponentId}">
<ReplacementString>$(AdditionalHostFxrComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{CLISdkComponentId}">
<ReplacementString>$(SdkComponentId)</ReplacementString>
</DistributionTemplateReplacement>
@ -71,6 +63,19 @@
<DistributionTemplateReplacement Include="{HostFxrBrandName}">
<ReplacementString>$(HostFxrBrandName)</ReplacementString>
</DistributionTemplateReplacement>
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAdditionalSharedFrameworks)' == 'true' ">
<DistributionTemplateReplacement Include="{AdditionalSharedFxComponentId}">
<ReplacementString>$(AdditionalSharedFrameworkComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalSharedHostComponentId}">
<ReplacementString>$(AdditionalSharedHostComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalHostFxrComponentId}">
<ReplacementString>$(AdditionalHostFxrComponentId)</ReplacementString>
</DistributionTemplateReplacement>
<DistributionTemplateReplacement Include="{AdditionalSharedFxBrandName}">
<ReplacementString>$(AdditionalSharedFrameworkBrandName)</ReplacementString>
</DistributionTemplateReplacement>
@ -97,7 +102,9 @@
<GenerateSdkProductArchiveInputs Include="$(DownloadedSharedHostInstallerFile)" />
<GenerateSdkProductArchiveInputs Include="$(SdkProductArchiveDistributionTemplateFile)" />
<GenerateSdkProductArchiveInputs Include="$(SdkProductArchiveResourcesDirectory)/**/*" />
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAdditionalSharedFrameworks)' == 'true' ">
<GenerateSdkProductArchiveInputs Include="$(AdditionalDownloadedSharedFrameworkInstallerFile)" />
<GenerateSdkProductArchiveInputs Include="$(AdditionalDownloadedHostFxrInstallerFile)" />
<GenerateSdkProductArchiveInputs Include="$(AdditionalDownloadedSharedHostInstallerFile)" />
@ -124,22 +131,28 @@
Outputs="$(CombinedFrameworkSdkHostInstallerFile)"
DependsOnTargets="GenerateSdkPkg"
Condition=" '$(OSName)' == 'osx' ">
<ItemGroup>
<PkgComponentsSourceFiles Include="$(SdkInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile)" />
<PkgComponentsDestinationFiles Include="$(SdkPkgIntermediatePath);
$(SharedFrameworkPkgIntermediatePath);
$(HostFxrPkgIntermediatePath);
$(SharedHostPkgIntermediatePath)" />
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAdditionalSharedFrameworks)' == 'true' ">
<PkgComponentsSourceFiles Include="$(AdditionalDownloadedSharedFrameworkInstallerFile);
$(AdditionalDownloadedHostFxrInstallerFile);
$(AdditionalDownloadedSharedHostInstallerFile)" />
<PkgComponentsDestinationFiles Include="$(AdditionalSharedFrameworkPkgIntermediatePath);
$(AdditionalHostFxrPkgIntermediatePath);
$(AdditionalSharedHostPkgIntermediatePath)" />
</ItemGroup>
<!-- Move ProductArchive pkg components into place with component ids in the filenames -->
<Copy
SourceFiles="$(SdkInstallerFile);
$(DownloadedSharedFrameworkInstallerFile);
$(DownloadedHostFxrInstallerFile);
$(DownloadedSharedHostInstallerFile);
$(AdditionalDownloadedSharedFrameworkInstallerFile);
$(AdditionalDownloadedHostFxrInstallerFile);
$(AdditionalDownloadedSharedHostInstallerFile);"
DestinationFiles="$(SdkPkgIntermediatePath);
$(SharedFrameworkPkgIntermediatePath);
$(HostFxrPkgIntermediatePath);
$(SharedHostPkgIntermediatePath);
$(AdditionalSharedFrameworkPkgIntermediatePath);
$(AdditionalHostFxrPkgIntermediatePath);
$(AdditionalSharedHostPkgIntermediatePath);" />
<Copy SourceFiles="@(PkgComponentsSourceFiles)" DestinationFiles="@(PkgComponentsDestinationFiles)" />
<!-- Fill out parameters in the Distribution Template -->
<ReplaceFileContents

View file

@ -36,6 +36,7 @@
<Import Project="build/CrossGen.props" />
<Import Project="build/VersionBadge.props" />
<Import Project="build/BundledRuntimes.props" />
<Import Project="build/LegacyRuntimes.props" />
<Import Project="build/AzureInfo.props" />
<Import Project="build/InstallerInfo.props" />

View file

@ -17,9 +17,6 @@
<line choice="{SharedFxComponentId}.pkg" />
<line choice="{HostFxrComponentId}.pkg" />
<line choice="{SharedHostComponentId}.pkg" />
<line choice="{AdditionalSharedFxComponentId}.pkg" />
<line choice="{AdditionalHostFxrComponentId}.pkg" />
<line choice="{AdditionalSharedHostComponentId}.pkg" />
<line choice="{CLISdkComponentId}.pkg"/>
</choices-outline>
<choice id="{SharedFxComponentId}.pkg" visible="true" title="{SharedFxBrandName} (x64)" description="The .NET Core Shared Framework">
@ -31,23 +28,11 @@
<choice id="{SharedHostComponentId}.pkg" visible="true" title="{SharedHostBrandName} (x64)" description="The .NET Core Shared Host." >
<pkg-ref id="{SharedHostComponentId}.pkg" />
</choice>
<choice id="{AdditionalSharedFxComponentId}.pkg" visible="true" title="{AdditionalSharedFxBrandName} (x64)" description="The .NET Core Shared Framework">
<pkg-ref id="{AdditionalSharedFxComponentId}.pkg" />
</choice>
<choice id="{AdditionalHostFxrComponentId}.pkg" visible="true" title="{AdditionalHostFxrBrandName} (x64)" description="The .NET Core Host FX Resolver">
<pkg-ref id="{AdditionalHostFxrComponentId}.pkg" />
</choice>
<choice id="{AdditionalSharedHostComponentId}.pkg" visible="true" title="{AdditionalSharedHostBrandName} (x64)" description="The .NET Core Shared Host." >
<pkg-ref id="{AdditionalSharedHostComponentId}.pkg" />
</choice>
<choice id="{CLISdkComponentId}.pkg" visible="true" title="{CLISdkBrandName} (x64)" description="The .NET Core SDK">
<pkg-ref id="{CLISdkComponentId}.pkg"/>
</choice>
<pkg-ref id="{SharedFxComponentId}.pkg">{SharedFxComponentId}.pkg</pkg-ref>
<pkg-ref id="{HostFxrComponentId}.pkg">{HostFxrComponentId}.pkg</pkg-ref>
<pkg-ref id="{SharedHostComponentId}.pkg">{SharedHostComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalSharedFxComponentId}.pkg">{AdditionalSharedFxComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalHostFxrComponentId}.pkg">{AdditionalHostFxrComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalSharedHostComponentId}.pkg">{AdditionalSharedHostComponentId}.pkg</pkg-ref>
<pkg-ref id="{CLISdkComponentId}.pkg">{CLISdkComponentId}.pkg</pkg-ref>
</installer-gui-script>

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<installer-gui-script minSpecVersion="1">
<title>{CLISdkBrandName} (x64)</title>
<license file="eula.rtf" mime-type="application/rtf" />
<background file="dotnetbackground.png" mime-type="image/png"/>
<options customize="never" require-scripts="false" />
<welcome file="welcome.html" mime-type="text/html" />
<conclusion file="conclusion.html" mime-type="text/html" />
<volume-check>
<allowed-os-version>
<os-version min="10.10" />
</allowed-os-version>
</volume-check>
<choices-outline>
<line choice="{SharedFxComponentId}.pkg" />
<line choice="{HostFxrComponentId}.pkg" />
<line choice="{SharedHostComponentId}.pkg" />
<line choice="{AdditionalSharedFxComponentId}.pkg" />
<line choice="{AdditionalHostFxrComponentId}.pkg" />
<line choice="{AdditionalSharedHostComponentId}.pkg" />
<line choice="{CLISdkComponentId}.pkg"/>
</choices-outline>
<choice id="{SharedFxComponentId}.pkg" visible="true" title="{SharedFxBrandName} (x64)" description="The .NET Core Shared Framework">
<pkg-ref id="{SharedFxComponentId}.pkg" />
</choice>
<choice id="{HostFxrComponentId}.pkg" visible="true" title="{HostFxrBrandName} (x64)" description="The .NET Core Host FX Resolver">
<pkg-ref id="{HostFxrComponentId}.pkg" />
</choice>
<choice id="{SharedHostComponentId}.pkg" visible="true" title="{SharedHostBrandName} (x64)" description="The .NET Core Shared Host." >
<pkg-ref id="{SharedHostComponentId}.pkg" />
</choice>
<choice id="{AdditionalSharedFxComponentId}.pkg" visible="true" title="{AdditionalSharedFxBrandName} (x64)" description="The .NET Core Shared Framework">
<pkg-ref id="{AdditionalSharedFxComponentId}.pkg" />
</choice>
<choice id="{AdditionalHostFxrComponentId}.pkg" visible="true" title="{AdditionalHostFxrBrandName} (x64)" description="The .NET Core Host FX Resolver">
<pkg-ref id="{AdditionalHostFxrComponentId}.pkg" />
</choice>
<choice id="{AdditionalSharedHostComponentId}.pkg" visible="true" title="{AdditionalSharedHostBrandName} (x64)" description="The .NET Core Shared Host." >
<pkg-ref id="{AdditionalSharedHostComponentId}.pkg" />
</choice>
<choice id="{CLISdkComponentId}.pkg" visible="true" title="{CLISdkBrandName} (x64)" description="The .NET Core SDK">
<pkg-ref id="{CLISdkComponentId}.pkg"/>
</choice>
<pkg-ref id="{SharedFxComponentId}.pkg">{SharedFxComponentId}.pkg</pkg-ref>
<pkg-ref id="{HostFxrComponentId}.pkg">{HostFxrComponentId}.pkg</pkg-ref>
<pkg-ref id="{SharedHostComponentId}.pkg">{SharedHostComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalSharedFxComponentId}.pkg">{AdditionalSharedFxComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalHostFxrComponentId}.pkg">{AdditionalHostFxrComponentId}.pkg</pkg-ref>
<pkg-ref id="{AdditionalSharedHostComponentId}.pkg">{AdditionalSharedHostComponentId}.pkg</pkg-ref>
<pkg-ref id="{CLISdkComponentId}.pkg">{CLISdkComponentId}.pkg</pkg-ref>
</installer-gui-script>

View file

@ -223,4 +223,21 @@
<Delete Files="@(PdbsToClean)" />
</Target>
<Target Name="PublishStage2WithLegacyRuntime"
AfterTargets="RemovePdbsFromPublishDir;">
<ItemGroup>
<LegacySharedFramework Remove="*" />
<LegacySharedFramework Include="$(LegacySharedFrameworkPublishDirectory)/**/*" />
<Stage2Cli Remove="*" />
<Stage2Cli Include="$(OutputDirectory)/**/*" />
</ItemGroup>
<Copy SourceFiles="@(LegacySharedFramework)"
DestinationFiles="@(LegacySharedFramework->'$(Stage2WithLegacyRuntimeOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
<Copy SourceFiles="@(Stage2Cli)"
DestinationFiles="@(Stage2Cli->'$(Stage2WithLegacyRuntimeOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
</Project>

View file

@ -109,7 +109,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
.Should()
.Pass();
new DotnetCommand()
new DotnetCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(testProjectDirectory)
.ExecuteWithCapturedOutput(
$"-d dependency-tool-invoker -c {configuration} -f netcoreapp2.0 portable")

View file

@ -9,6 +9,14 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
{
public class DependencyToolInvokerCommand : DotnetCommand
{
public DependencyToolInvokerCommand() : base()
{
}
public DependencyToolInvokerCommand(string dotnetUnderTest) : base(dotnetUnderTest)
{
}
public CommandResult Execute(string commandName, string framework, string additionalArgs)
{
var args = $"dependency-tool-invoker {commandName} --framework {framework} {additionalArgs}";

View file

@ -8,9 +8,13 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public class DotnetCommand : TestCommand
{
public DotnetCommand()
: base(DotnetUnderTest.FullName)
: this(DotnetUnderTest.FullName)
{
}
public DotnetCommand(string dotnetUnderTest)
: base(dotnetUnderTest)
{
}
}
}

View file

@ -2,6 +2,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
@ -22,5 +23,13 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return _pathToDotnetUnderTest;
}
}
public static string WithLegacyRuntime
{
get
{
return Path.Combine(new RepoDirectoriesProvider().Stage2WithLegacyRuntimeDirectory, "dotnet");
}
}
}
}

View file

@ -18,6 +18,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
private string _builtDotnet;
private string _nugetPackages;
private string _stage2Sdk;
private string _stage2WithLegacyRuntimeDirectory;
private string _testPackages;
private string _pjDotnet;
@ -82,6 +83,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public string NugetPackages => _nugetPackages;
public string PjDotnet => _pjDotnet;
public string Stage2Sdk => _stage2Sdk;
public string Stage2WithLegacyRuntimeDirectory => _stage2WithLegacyRuntimeDirectory;
public string TestPackages => _testPackages;
public RepoDirectoriesProvider(
@ -97,6 +99,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
_nugetPackages = nugetPackages ?? Path.Combine(RepoRoot, ".nuget", "packages");
_pjDotnet = pjDotnet ?? GetPjDotnetPath();
_stage2Sdk = Directory.EnumerateDirectories(Path.Combine(_artifacts, "stage2", "sdk")).First();
_stage2WithLegacyRuntimeDirectory = Path.Combine(_artifacts, "stage2WithLegacyRuntime");
_testPackages = Path.Combine(RepoRoot, "artifacts", "testpackages", "packages");
}

View file

@ -431,13 +431,7 @@ namespace Microsoft.DotNet.Migration.Tests
.Execute("build -c Debug")
.Should().Pass();
if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1"))
{
// running the app requires netcoreapp1.1
return;
}
var cmd = new DotnetCommand()
var cmd = new DotnetCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("run -c Debug");
cmd.Should().Pass();
@ -454,7 +448,7 @@ namespace Microsoft.DotNet.Migration.Tests
.Root
.GetDirectory("project");
var cmd = new DotnetCommand()
var cmd = new DotnetCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("migrate");
@ -489,13 +483,7 @@ namespace Microsoft.DotNet.Migration.Tests
.Execute("build -c Debug")
.Should().Pass();
if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1"))
{
// running the app requires netcoreapp1.1
return;
}
var cmd = new DotnetCommand()
var cmd = new DotnetCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("run -c Debug");
cmd.Should().Pass();
@ -546,13 +534,7 @@ namespace Microsoft.DotNet.Migration.Tests
.Execute("build -c Debug")
.Should().Pass();
if (!EnvironmentInfo.HasSharedFramework("netcoreapp1.1"))
{
// running the app requires netcoreapp1.1
return;
}
var cmd = new DotnetCommand()
var cmd = new DotnetCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput("run -c Debug");
cmd.Should().Pass();

View file

@ -759,7 +759,7 @@ namespace Microsoft.DotNet.Migration.Tests
foreach (var dll in runnableDlls)
{
new TestCommand("dotnet").ExecuteWithCapturedOutput($"\"{dll.FullName}\"").Should().Pass();
new DotnetCommand(DotnetUnderTest.WithLegacyRuntime).ExecuteWithCapturedOutput($"\"{dll.FullName}\"").Should().Pass();
}
}

View file

@ -128,7 +128,7 @@ namespace Microsoft.DotNet.Tests
.Execute()
.Should().Pass();
new DependencyToolInvokerCommand()
new DependencyToolInvokerCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(testInstance.Root)
.WithEnvironmentVariable(CommandContext.Variables.Verbose, "true")
.ExecuteWithCapturedOutput($"tool-with-output-name", framework, "")
@ -250,7 +250,7 @@ namespace Microsoft.DotNet.Tests
.WithSourceFiles()
.WithRestoreFiles();
new DependencyContextTestCommand()
new DependencyContextTestCommand(DotnetUnderTest.WithLegacyRuntime)
.WithWorkingDirectory(testInstance.Root)
.Execute("")
.Should().Pass();
@ -417,7 +417,7 @@ namespace Microsoft.DotNet.Tests
class DependencyContextTestCommand : DotnetCommand
{
public DependencyContextTestCommand()
public DependencyContextTestCommand(string dotnetUnderTest) : base(dotnetUnderTest)
{
}