Updating deployers for apps using shared runtime

This commit is contained in:
John Luo 2016-04-20 10:52:01 -07:00
parent 0a8f1327b5
commit e874f99791
3 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,11 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Server.Testing
{
public enum ApplicationType
{
Portable,
Standalone
}
}

View File

@ -74,6 +74,8 @@ namespace Microsoft.AspNetCore.Server.Testing
/// </summary> /// </summary>
public bool PublishApplicationBeforeDeployment { get; set; } public bool PublishApplicationBeforeDeployment { get; set; }
public ApplicationType ApplicationType { get; set; }
public string PublishTargetFramework { get; set; } public string PublishTargetFramework { get; set; }
public string PublishedApplicationRootPath { get; set; } public string PublishedApplicationRootPath { get; set; }

View File

@ -52,7 +52,9 @@ namespace Microsoft.AspNetCore.Server.Testing
string executableArgs = string.Empty; string executableArgs = string.Empty;
if (DeploymentParameters.PublishApplicationBeforeDeployment) if (DeploymentParameters.PublishApplicationBeforeDeployment)
{ {
var executableExtension = DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" : ""; var executableExtension =
DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr ? ".exe" :
DeploymentParameters.ApplicationType == ApplicationType.Portable ? ".dll" : "";
var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension); var executable = Path.Combine(DeploymentParameters.PublishedApplicationRootPath, new DirectoryInfo(DeploymentParameters.ApplicationPath).Name + executableExtension);
if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && PlatformServices.Default.Runtime.OperatingSystemPlatform != Platform.Windows) if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.Clr && PlatformServices.Default.Runtime.OperatingSystemPlatform != Platform.Windows)
@ -60,6 +62,11 @@ namespace Microsoft.AspNetCore.Server.Testing
executableName = "mono"; executableName = "mono";
executableArgs = executable; executableArgs = executable;
} }
else if (DeploymentParameters.RuntimeFlavor == RuntimeFlavor.CoreClr && DeploymentParameters.ApplicationType == ApplicationType.Portable)
{
executableName = "dotnet";
executableArgs = executable;
}
else else
{ {
executableName = executable; executableName = executable;