public static NupkgFilePath Pack(FilePath dotnetExecutableFilePath, ProjectFilePath projectFilePath, DirectoryPath outputDirectoryPath, ILogger logger)
        {
            // Determine the package ID.
            var packageID = NugetUtilities.GetDefaultPackageID(projectFilePath);

            var packageFilePath = DotnetCommandServicesProvider.Pack(dotnetExecutableFilePath, projectFilePath, outputDirectoryPath, packageID, Enumerable.Empty <string>(), logger);

            return(packageFilePath);
        }
        public static void Pack(FilePath dotnetExecutableFilePath, ProjectFilePath projectFilePath, NupkgFilePath nupkgFilePath, ILogger logger)
        {
            var packageDirectoryPath = PathUtilities.GetDirectoryPath(nupkgFilePath);

            // Use the pack command to get the package file-path created by dotnet.
            var defaultPackageFilePath = DotnetCommandServicesProvider.Pack(dotnetExecutableFilePath, projectFilePath, packageDirectoryPath, logger);

            // If the package file-path created by dotnet is not the same as the specified package file-path, copy the file to the new path.
            if (nupkgFilePath.Value != defaultPackageFilePath.Value)
            {
                File.Copy(defaultPackageFilePath.Value, nupkgFilePath.Value, true);
                File.Delete(defaultPackageFilePath.Value);
            }
        }
        public static NupkgFilePath Pack(this DotnetCommand command, ProjectFilePath projectFilePath, DirectoryPath outputDirectoryPath, PackageID packageID, IEnumerable <string> sources)
        {
            var packageFilePath = DotnetCommandServicesProvider.Pack(command.DotnetExecutableFilePath, projectFilePath, outputDirectoryPath, packageID, sources, command.Logger);

            return(packageFilePath);
        }
        public static NupkgFilePath Pack(this DotnetCommand command, ProjectFilePath projectFilePath, DirectoryPath outputDirectoryPath)
        {
            var packageFilePath = DotnetCommandServicesProvider.Pack(command.DotnetExecutableFilePath, projectFilePath, outputDirectoryPath, command.Logger);

            return(packageFilePath);
        }