Refactor SDK Build Steps
Prefix the SDK build stuff with "Sdk" to make it easier to add other sorts of packages (e.g. the shared host and the shared framework).
This commit is contained in:
parent
88c1340f6d
commit
29bc612565
6 changed files with 54 additions and 47 deletions
|
@ -22,9 +22,9 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
}
|
||||
}
|
||||
|
||||
private static string Msi { get; set; }
|
||||
private static string SdkMsi { get; set; }
|
||||
|
||||
private static string Bundle { get; set; }
|
||||
private static string SdkBundle { get; set; }
|
||||
|
||||
private static string Engine { get; set; }
|
||||
|
||||
|
@ -60,9 +60,9 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[BuildPlatforms(BuildPlatform.Windows)]
|
||||
public static BuildTargetResult InitMsi(BuildTargetContext c)
|
||||
{
|
||||
Bundle = c.BuildContext.Get<string>("InstallerFile");
|
||||
Msi = Path.ChangeExtension(Bundle, "msi");
|
||||
Engine = Path.Combine(Path.GetDirectoryName(Bundle), ENGINE);
|
||||
SdkBundle = c.BuildContext.Get<string>("SdkInstallerFile");
|
||||
SdkMsi = Path.ChangeExtension(SdkBundle, "msi");
|
||||
Engine = Path.Combine(Path.GetDirectoryName(SdkBundle), ENGINE);
|
||||
|
||||
var buildVersion = c.BuildContext.Get<BuildVersion>("BuildVersion");
|
||||
MsiVersion = buildVersion.GenerateMsiVersion();
|
||||
|
@ -76,7 +76,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[Target(nameof(MsiTargets.InitMsi),
|
||||
nameof(GenerateDotnetMuxerMsi),
|
||||
nameof(GenerateDotnetSharedFxMsi),
|
||||
nameof(GenerateCLISDKMsi))]
|
||||
nameof(GenerateCliSdkMsi))]
|
||||
[BuildPlatforms(BuildPlatform.Windows)]
|
||||
public static BuildTargetResult GenerateMsis(BuildTargetContext c)
|
||||
{
|
||||
|
@ -85,11 +85,11 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
|
||||
[Target]
|
||||
[BuildPlatforms(BuildPlatform.Windows)]
|
||||
public static BuildTargetResult GenerateCLISDKMsi(BuildTargetContext c)
|
||||
public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c)
|
||||
{
|
||||
Cmd("powershell", "-NoProfile", "-NoLogo",
|
||||
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"),
|
||||
Dirs.Stage2, Msi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||
Dirs.Stage2, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
return c.Success();
|
||||
|
@ -116,7 +116,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
{
|
||||
Cmd("powershell", "-NoProfile", "-NoLogo",
|
||||
Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatebundle.ps1"),
|
||||
Msi, Bundle, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||
SdkMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel)
|
||||
.EnvironmentVariable("Stage2Dir", Dirs.Stage2)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
|
@ -127,7 +127,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[BuildPlatforms(BuildPlatform.Windows)]
|
||||
public static BuildTargetResult ExtractEngineFromBundle(BuildTargetContext c)
|
||||
{
|
||||
Cmd($"{WixRoot}\\insignia.exe", "-ib", Bundle, "-o", Engine)
|
||||
Cmd($"{WixRoot}\\insignia.exe", "-ib", SdkBundle, "-o", Engine)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
return c.Success();
|
||||
|
@ -137,7 +137,7 @@ namespace Microsoft.DotNet.Cli.Build
|
|||
[BuildPlatforms(BuildPlatform.Windows)]
|
||||
public static BuildTargetResult ReattachEngineToBundle(BuildTargetContext c)
|
||||
{
|
||||
Cmd($"{WixRoot}\\insignia.exe", "-ab", Engine, Bundle, "-o", Bundle)
|
||||
Cmd($"{WixRoot}\\insignia.exe", "-ab", Engine, SdkBundle, "-o", SdkBundle)
|
||||
.Execute()
|
||||
.EnsureSuccessful();
|
||||
return c.Success();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue