download fxr installer file, use it in pkg targets

This commit is contained in:
Bryan Thornbury 2016-06-09 15:45:00 -07:00
parent e3c53c18fd
commit 0f640a32e3
3 changed files with 19 additions and 25 deletions

View file

@ -20,6 +20,7 @@ namespace Microsoft.DotNet.Cli.Build
public static string CLISdkComponentId { get; set; } public static string CLISdkComponentId { get; set; }
public static string CLISdkPkgId { get; set; } public static string CLISdkPkgId { get; set; }
public static string CLISdkNugetVersion { get; set; } public static string CLISdkNugetVersion { get; set; }
public static string HostFxrComponentId { get; set; }
[Target] [Target]
[BuildPlatforms(BuildPlatform.OSX)] [BuildPlatforms(BuildPlatform.OSX)]
@ -29,6 +30,7 @@ namespace Microsoft.DotNet.Cli.Build
Directory.CreateDirectory(PkgsIntermediateDir); Directory.CreateDirectory(PkgsIntermediateDir);
SharedHostComponentId = $"com.microsoft.dotnet.sharedhost.component.osx.x64"; SharedHostComponentId = $"com.microsoft.dotnet.sharedhost.component.osx.x64";
HostFxrComponentId = $"com.microsoft.dotnet.hostfxr.component.osx.x64";
string sharedFrameworkNugetName = Monikers.SharedFrameworkName; string sharedFrameworkNugetName = Monikers.SharedFrameworkName;
SharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion; SharedFrameworkNugetVersion = CliDependencyVersions.SharedFrameworkVersion;
@ -59,10 +61,12 @@ namespace Microsoft.DotNet.Cli.Build
// Copy SharedFX and host installers in the correct place // Copy SharedFX and host installers in the correct place
var sharedFrameworkPkgIntermediatePath = Path.Combine(PkgsIntermediateDir, $"{SharedFxComponentId}.pkg"); var sharedFrameworkPkgIntermediatePath = Path.Combine(PkgsIntermediateDir, $"{SharedFxComponentId}.pkg");
var sharedHostPkgIntermediatePath = Path.Combine(PkgsIntermediateDir, $"{SharedHostComponentId}.pkg"); var sharedHostPkgIntermediatePath = Path.Combine(PkgsIntermediateDir, $"{SharedHostComponentId}.pkg");
var hostFxrPkgIntermediatePath = Path.Combine(PkgsIntermediateDir, $"{HostFxrComponentId}.pkg");
File.Copy(c.BuildContext.Get<string>("SharedFrameworkInstallerFile"), sharedFrameworkPkgIntermediatePath, true); File.Copy(c.BuildContext.Get<string>("SharedFrameworkInstallerFile"), sharedFrameworkPkgIntermediatePath, true);
File.Copy(c.BuildContext.Get<string>("SharedHostInstallerFile"), sharedHostPkgIntermediatePath, true); File.Copy(c.BuildContext.Get<string>("SharedHostInstallerFile"), sharedHostPkgIntermediatePath, true);
File.Copy(c.BuildContext.Get<string>("HostFxrInstallerFile"), hostFxrPkgIntermediatePath, true);
string inputDistTemplatePath = Path.Combine( string inputDistTemplatePath = Path.Combine(
Dirs.RepoRoot, Dirs.RepoRoot,
@ -75,11 +79,13 @@ namespace Microsoft.DotNet.Cli.Build
string formattedDistContents = string formattedDistContents =
distTemplate.Replace("{SharedFxComponentId}", SharedFxComponentId) distTemplate.Replace("{SharedFxComponentId}", SharedFxComponentId)
.Replace("{SharedHostComponentId}", SharedHostComponentId) .Replace("{SharedHostComponentId}", SharedHostComponentId)
.Replace("{HostFxrComponentId}", HostFxrComponentId)
.Replace("{CLISdkComponentId}", CLISdkComponentId) .Replace("{CLISdkComponentId}", CLISdkComponentId)
.Replace("{CLISdkNugetVersion}", CLISdkNugetVersion) .Replace("{CLISdkNugetVersion}", CLISdkNugetVersion)
.Replace("{CLISdkBrandName}", Monikers.CLISdkBrandName) .Replace("{CLISdkBrandName}", Monikers.CLISdkBrandName)
.Replace("{SharedFxBrandName}", Monikers.SharedFxBrandName) .Replace("{SharedFxBrandName}", Monikers.SharedFxBrandName)
.Replace("{SharedHostBrandName}", Monikers.SharedHostBrandName); .Replace("{SharedHostBrandName}", Monikers.SharedHostBrandName)
.Replace("{HostFxrBrandName}", Monikers.HostFxrBrandName);
File.WriteAllText(distributionPath, formattedDistContents); File.WriteAllText(distributionPath, formattedDistContents);
Cmd("productbuild", Cmd("productbuild",

View file

@ -13,6 +13,7 @@ namespace Microsoft.DotNet.Cli.Build
public const string CLISdkBrandName = "Microsoft .NET Core 1.0.0 - SDK Preview 2"; public const string CLISdkBrandName = "Microsoft .NET Core 1.0.0 - SDK Preview 2";
public const string SharedFxBrandName = "Microsoft .NET Core 1.0.0 - Runtime"; public const string SharedFxBrandName = "Microsoft .NET Core 1.0.0 - Runtime";
public const string SharedHostBrandName = "Microsoft .NET Core 1.0.0 - Host"; public const string SharedHostBrandName = "Microsoft .NET Core 1.0.0 - Host";
public const string HostFxrBrandName = "Microsoft .NET Core 1.0.0 - Host FX Resolver";
public static string GetProductMoniker(BuildTargetContext c, string artifactPrefix, string version) public static string GetProductMoniker(BuildTargetContext c, string artifactPrefix, string version)
{ {
@ -45,29 +46,6 @@ namespace Microsoft.DotNet.Cli.Build
return $"{CurrentPlatform.Current}_{CurrentArchitecture.Current}"; return $"{CurrentPlatform.Current}_{CurrentArchitecture.Current}";
} }
public static string GetDebianPackageName(BuildTargetContext c)
{
var channel = c.BuildContext.Get<string>("Channel").ToLower();
var packageName = "";
switch (channel)
{
case "dev":
packageName = "dotnet-nightly";
break;
case "beta":
case "rc1":
case "rc2":
case "preview":
case "rtm":
packageName = "dotnet";
break;
default:
throw new Exception($"Unknown channel - {channel}");
}
return packageName;
}
public static string GetSdkDebianPackageName(BuildTargetContext c) public static string GetSdkDebianPackageName(BuildTargetContext c)
{ {
var channel = c.BuildContext.Get<string>("Channel").ToLower(); var channel = c.BuildContext.Get<string>("Channel").ToLower();
@ -93,6 +71,11 @@ namespace Microsoft.DotNet.Cli.Build
return $"{packagePrefix}-dev-{nugetVersion}"; return $"{packagePrefix}-dev-{nugetVersion}";
} }
public static string GetDebianHostFxrPackageName(BuildTargetContext c)
{
return $"dotnet-hostfxr".ToLower();
}
public static string GetDebianSharedFrameworkPackageName(string sharedFrameworkNugetVersion) public static string GetDebianSharedFrameworkPackageName(string sharedFrameworkNugetVersion)
{ {
return $"dotnet-sharedframework-{SharedFrameworkName}-{sharedFrameworkNugetVersion}".ToLower(); return $"dotnet-sharedframework-{SharedFrameworkName}-{sharedFrameworkNugetVersion}".ToLower();

View file

@ -15,12 +15,16 @@
<choices-outline> <choices-outline>
<line choice="{SharedFxComponentId}.pkg" /> <line choice="{SharedFxComponentId}.pkg" />
<line choice="{HostFxrComponentId}.pkg" />
<line choice="{SharedHostComponentId}.pkg" /> <line choice="{SharedHostComponentId}.pkg" />
<line choice="{CLISdkComponentId}.pkg"/> <line choice="{CLISdkComponentId}.pkg"/>
</choices-outline> </choices-outline>
<choice id="{SharedFxComponentId}.pkg" visible="true" title="{SharedFxBrandName} (x64)" description="The .NET Core Shared Framework"> <choice id="{SharedFxComponentId}.pkg" visible="true" title="{SharedFxBrandName} (x64)" description="The .NET Core Shared Framework">
<pkg-ref id="{SharedFxComponentId}.pkg" /> <pkg-ref id="{SharedFxComponentId}.pkg" />
</choice> </choice>
<choice id="{HostFxrComponentId}.pkg" visible="true" title="{HostFxrBrandName} (x64)" description="The .NET Core HostFxr">
<pkg-ref id="{HostFxrComponentId}.pkg" />
</choice>
<choice id="{SharedHostComponentId}.pkg" visible="true" title="{SharedHostBrandName} (x64)" description="The .NET Core Shared Host." > <choice id="{SharedHostComponentId}.pkg" visible="true" title="{SharedHostBrandName} (x64)" description="The .NET Core Shared Host." >
<pkg-ref id="{SharedHostComponentId}.pkg" /> <pkg-ref id="{SharedHostComponentId}.pkg" />
</choice> </choice>
@ -28,6 +32,7 @@
<pkg-ref id="{CLISdkComponentId}.pkg"/> <pkg-ref id="{CLISdkComponentId}.pkg"/>
</choice> </choice>
<pkg-ref id="{SharedFxComponentId}.pkg">{SharedFxComponentId}.pkg</pkg-ref> <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="{SharedHostComponentId}.pkg">{SharedHostComponentId}.pkg</pkg-ref>
<pkg-ref id="{CLISdkComponentId}.pkg">{CLISdkComponentId}.pkg</pkg-ref> <pkg-ref id="{CLISdkComponentId}.pkg">{CLISdkComponentId}.pkg</pkg-ref>
</installer-gui-script> </installer-gui-script>