public static BuildTargetResult GenerateHostFxrDeb(BuildTargetContext c) { // Ubuntu 16.04 Jenkins Machines don't have docker or debian package build tools // So we need to skip this target if the tools aren't present. // https://github.com/dotnet/core-setup/issues/167 if (DebuildNotPresent()) { c.Info("Debuild not present, skipping target: {nameof(GenerateHostFxrDeb)}"); return(c.Success()); } var hostFxrVersion = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostFxrVersion.ToString(); var packageName = Monikers.GetDebianHostFxrPackageName(hostFxrVersion); var sharedHostVersion = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString(); var inputRoot = c.BuildContext.Get <string>("HostFxrPublishRoot"); var debFile = c.BuildContext.Get <string>("HostFxrInstallerFile"); var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-hostfxr-debian_config.json"); var debianConfigVariables = new Dictionary <string, string>() { { "HOSTFXR_BRAND_NAME", Monikers.GetHostFxrBrandName(c) }, { "SHARED_HOST_DEBIAN_VERSION", sharedHostVersion }, { "HOSTFXR_NUGET_VERSION", hostFxrVersion }, { "HOSTFXR_DEBIAN_PACKAGE_NAME", packageName } }; var debCreator = new DebPackageCreator( DotNetCli.Stage0, Dirs.Intermediate, dotnetDebToolPackageSource: Dirs.Packages); debCreator.CreateDeb( debianConfigFile, packageName, hostFxrVersion, inputRoot, debianConfigVariables, debFile); return(c.Success()); }
public static BuildTargetResult GenerateDotnetHostFxrMsi(BuildTargetContext c) { var hostVersion = c.BuildContext.Get <HostVersion>("HostVersion"); var hostFxrMsiVersion = hostVersion.LockedHostFxrVersion.GenerateMsiVersion(); var hostFxrNugetVersion = hostVersion.LockedHostFxrVersion.ToString(); var inputDir = c.BuildContext.Get <string>("HostFxrPublishRoot"); var wixObjRoot = Path.Combine(Dirs.Output, "obj", "wix", "hostfxr"); var hostFxrBrandName = $"'{Monikers.GetHostFxrBrandName(c)}'"; if (Directory.Exists(wixObjRoot)) { Utils.DeleteDirectory(wixObjRoot); } Directory.CreateDirectory(wixObjRoot); Cmd("powershell", "-NoProfile", "-NoLogo", Path.Combine(Dirs.RepoRoot, "packaging", "windows", "hostfxr", "generatemsi.ps1"), inputDir, HostFxrMsi, WixRoot, hostFxrBrandName, hostFxrMsiVersion, hostFxrNugetVersion, Arch, wixObjRoot) .Execute() .EnsureSuccessful(); return(c.Success()); }
public static BuildTargetResult GenerateSharedFrameworkProductArchive(BuildTargetContext c) { string resourcePath = Path.Combine(Dirs.RepoRoot, "packaging", "osx", "sharedframework", "resources"); string outFilePath = Path.Combine(PkgsIntermediateDir, c.BuildContext.Get <string>("CombinedMuxerHostFxrFrameworkInstallerFile")); string inputDistTemplatePath = Path.Combine( Dirs.RepoRoot, "packaging", "osx", "sharedframework", "shared-framework-distribution-template.xml"); string distTemplate = File.ReadAllText(inputDistTemplatePath); string distributionPath = Path.Combine(PkgsIntermediateDir, "shared-framework-formatted-distribution.xml"); string formattedDistContents = distTemplate.Replace("{SharedFxComponentId}", SharedFxComponentId) .Replace("{SharedHostComponentId}", SharedHostComponentId) .Replace("{HostFxrComponentId}", HostFxrComponentId) .Replace("{SharedFrameworkNugetName}", Monikers.SharedFrameworkName) .Replace("{SharedFrameworkNugetVersion}", SharedFrameworkNugetVersion) .Replace("{SharedFxBrandName}", Monikers.GetSharedFxBrandName(c)) .Replace("{SharedHostBrandName}", Monikers.GetSharedHostBrandName(c)) .Replace("{HostFxrBrandName}", Monikers.GetHostFxrBrandName(c)); File.WriteAllText(distributionPath, formattedDistContents); Cmd("productbuild", "--version", SharedFrameworkNugetVersion, "--identifier", SharedFxPkgId, "--package-path", PkgsIntermediateDir, "--resources", resourcePath, "--distribution", distributionPath, outFilePath) .Execute() .EnsureSuccessful(); return(c.Success()); }