Update files copied into shared framework staging directory

We need additional files from the corehost directory
This commit is contained in:
Eric Mellino 2016-03-14 14:41:30 -07:00
parent 622cb17d7c
commit 05ebf6f842

View file

@ -17,6 +17,8 @@ namespace Microsoft.DotNet.Cli.Build
public const string SharedFrameworkName = "Microsoft.NETCore.App";
private const string CoreHostBaseName = "corehost";
private const string DotnetHostFxrBaseName = "hostfxr";
private const string HostPolicyBaseName = "hostpolicy";
[Target(nameof(PackageSharedFramework), nameof(CrossGenAllManagedAssemblies))]
public static BuildTargetResult PublishSharedFramework(BuildTargetContext c)
@ -68,11 +70,13 @@ namespace Microsoft.DotNet.Cli.Build
File.Move(Path.Combine(SharedFrameworkNameAndVersionRoot, "framework.deps"), Path.Combine(SharedFrameworkNameAndVersionRoot, $"{SharedFrameworkName}.deps"));
File.Move(Path.Combine(SharedFrameworkNameAndVersionRoot, "framework.deps.json"), Path.Combine(SharedFrameworkNameAndVersionRoot, $"{SharedFrameworkName}.deps.json"));
// corehost will be renamed to dotnet at some point and then this can be removed.
File.Move(Path.Combine(SharedFrameworkNameAndVersionRoot, $"{CoreHostBaseName}{Constants.ExeSuffix}"), Path.Combine(SharedFrameworkNameAndVersionRoot, $"dotnet{Constants.ExeSuffix}"));
// hostpolicy will be renamed to dotnet at some point and then this can be removed.
File.Move(Path.Combine(SharedFrameworkNameAndVersionRoot, $"{Constants.DynamicLibPrefix}hostpolicy{Constants.DynamicLibSuffix}"), Path.Combine(SharedFrameworkNameAndVersionRoot, $"{Constants.DynamicLibPrefix}dotnethostimpl{Constants.DynamicLibSuffix}"));
// corehost will be renamed to dotnet at some point and then we will not need to rename it here.
File.Copy(
Path.Combine(Dirs.Corehost, $"{CoreHostBaseName}{Constants.ExeSuffix}"),
Path.Combine(SharedFrameworkNameAndVersionRoot, $"dotnet{Constants.ExeSuffix}"));
File.Copy(
Path.Combine(Dirs.Corehost, $"{Constants.DynamicLibPrefix}{HostPolicyBaseName}{Constants.DynamicLibSuffix}"),
Path.Combine(SharedFrameworkNameAndVersionRoot, $"{Constants.DynamicLibPrefix}{HostPolicyBaseName}{Constants.DynamicLibSuffix}"));
if (File.Exists(Path.Combine(SharedFrameworkNameAndVersionRoot, "mscorlib.ni.dll")))
{
@ -81,10 +85,6 @@ namespace Microsoft.DotNet.Cli.Build
File.Delete(Path.Combine(SharedFrameworkNameAndVersionRoot, "mscorlib.dll"));
c.BuildContext["SharedFrameworkNameAndVersionRoot"] = SharedFrameworkNameAndVersionRoot;
}
else
{
c.Warn("Shared framework will not be crossgen'd because mscorlib.ni.dll does not exist.");
}
return c.Success();
}
@ -94,8 +94,14 @@ namespace Microsoft.DotNet.Cli.Build
{
string SharedHostPublishRoot = Path.Combine(Dirs.Output, "obj", "sharedhost");
Directory.CreateDirectory(SharedHostPublishRoot);
// corehost will be renamed to dotnet at some point and then this can be removed.
File.Copy(Path.Combine(Dirs.Corehost, $"{CoreHostBaseName}{Constants.ExeSuffix}"), Path.Combine(SharedHostPublishRoot, $"dotnet{Constants.ExeSuffix}"));
File.Copy(
Path.Combine(Dirs.Corehost, $"{CoreHostBaseName}{Constants.ExeSuffix}"),
Path.Combine(SharedHostPublishRoot, $"dotnet{Constants.ExeSuffix}"));
File.Copy(
Path.Combine(Dirs.Corehost, $"{Constants.DynamicLibPrefix}{DotnetHostFxrBaseName}{Constants.DynamicLibSuffix}"),
Path.Combine(SharedHostPublishRoot, $"{Constants.DynamicLibPrefix}{DotnetHostFxrBaseName}{Constants.DynamicLibSuffix}"));
c.BuildContext["SharedHostPublishRoot"] = SharedHostPublishRoot;