예제 #1
0
        public static BuildTargetResult GenerateSharedHostDeb(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(GenerateSharedHostDeb)}");
                return(c.Success());
            }

            var packageName      = Monikers.GetDebianSharedHostPackageName(c);
            var version          = c.BuildContext.Get <HostVersion>("HostVersion").LockedHostVersion.ToString();
            var inputRoot        = c.BuildContext.Get <string>("SharedHostPublishRoot");
            var debFile          = c.BuildContext.Get <string>("SharedHostInstallerFile");
            var manPagesDir      = Path.Combine(Dirs.RepoRoot, "Documentation", "manpages");
            var debianConfigFile = Path.Combine(Dirs.DebPackagingConfig, "dotnet-sharedhost-debian_config.json");

            var debianConfigVariables = new Dictionary <string, string>()
            {
                { "SHARED_HOST_BRAND_NAME", Monikers.GetSharedHostBrandName(c) }
            };

            var debCreator = new DebPackageCreator(
                DotNetCli.Stage0,
                Dirs.Intermediate,
                dotnetDebToolPackageSource: Dirs.Packages);

            debCreator.CreateDeb(
                debianConfigFile,
                packageName,
                version,
                inputRoot,
                debianConfigVariables,
                debFile,
                manPagesDir);

            return(c.Success());
        }
예제 #2
0
        public static BuildTargetResult GenerateDotnetSharedHostMsi(BuildTargetContext c)
        {
            var hostVersion         = c.BuildContext.Get <HostVersion>("HostVersion");
            var hostMsiVersion      = hostVersion.LockedHostVersion.GenerateMsiVersion();
            var hostNugetVersion    = hostVersion.LockedHostVersion.ToString();
            var inputDir            = c.BuildContext.Get <string>("SharedHostPublishRoot");
            var wixObjRoot          = Path.Combine(Dirs.Output, "obj", "wix", "sharedhost");
            var sharedHostBrandName = $"'{Monikers.GetSharedHostBrandName(c)}'";

            if (Directory.Exists(wixObjRoot))
            {
                Utils.DeleteDirectory(wixObjRoot);
            }
            Directory.CreateDirectory(wixObjRoot);

            Cmd("powershell", "-NoProfile", "-NoLogo",
                Path.Combine(Dirs.RepoRoot, "packaging", "windows", "host", "generatemsi.ps1"),
                inputDir, SharedHostMsi, WixRoot, sharedHostBrandName, hostMsiVersion, hostNugetVersion, Arch, wixObjRoot)
            .Execute()
            .EnsureSuccessful();
            return(c.Success());
        }
예제 #3
0
        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());
        }