Beispiel #1
0
        public static void NuGetPack(this ICakeContext context, FilePath nuspecFilePath, NuGetPackSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var packer = new NuGetPacker(context.FileSystem, context.Environment,
                                         context.Globber, context.ProcessRunner, context.Log);

            packer.Pack(nuspecFilePath, settings);
        }
Beispiel #2
0
        public static void NuGetPack(this ICakeContext context, FilePath filePath, NuGetPackSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            var resolver = new NuGetToolResolver(context.FileSystem, context.Environment, context.Tools);
            var packer   = new NuGetPacker(context.FileSystem, context.Environment, context.ProcessRunner, context.Log, context.Tools, resolver);

            packer.Pack(filePath, settings);
        }
Beispiel #3
0
        public string Pack(bool nuspec = true)
        {
            string content = null;

            ProcessRunner.When(p => p.Start(Arg.Any <FilePath>(), Arg.Any <ProcessSettings>()))
            .Do(info => {
                content = GetContent(info[1] as ProcessSettings);
            });

            var tool = new NuGetPacker(FileSystem, Environment, ProcessRunner, Log, Globber, NuGetToolResolver);

            if (nuspec)
            {
                tool.Pack(NuSpecFilePath, Settings);
            }
            else
            {
                tool.Pack(Settings);
            }

            // Return the content.
            return(content);
        }
Beispiel #4
0
        public void CreatePackagesForAllNuSpecOutputToArtifactsFolder(string fullVersion)
        {
            var files = _globber.GetFiles("./**/*.nuspec").ToList();

            if (files.Count == 0)
            {
                throw new Exception("No .nuspec files found to create packages from");
            }

            var nuGetToolResolver = new NuGetToolResolver(_fileSystem, _environment, _tools);
            var packer            = new NuGetPacker(_fileSystem, _environment, _processRunner, _log, _tools, nuGetToolResolver);

            var output    = new DirectoryPath("./Artifacts");
            var directory = _fileSystem.GetDirectory(output);

            if (!directory.Exists)
            {
                directory.Create();
            }

            var nuGetPackSettings = new NuGetPackSettings
            {
                Version                   = fullVersion,
                OutputDirectory           = output.FullPath,
                IncludeReferencedProjects = true,
                Properties                = new Dictionary <string, string> {
                    { "Configuration", Configuration }
                },
            };

            foreach (var nuspec in files)
            {
                _log.Information(nuspec.FullPath);
                var csproj = nuspec.ChangeExtension(".csproj");
                _log.Information(csproj.FullPath);
                packer.Pack(csproj.FullPath, nuGetPackSettings);
            }
        }
Beispiel #5
0
        public void Pack()
        {
            var tool = new NuGetPacker(FileSystem, Environment, ProcessRunner, Log, NuGetToolResolver);

            tool.Pack(NuSpecFilePath, Settings);
        }
        protected override void RunTool()
        {
            var tool = new NuGetPacker(FileSystem, Environment, ProcessRunner, Log, Globber, Resolver);

            tool.Pack(ProjectFilePath, Settings);
        }
        protected override void RunTool()
        {
            var tool = new NuGetPacker(FileSystem, Environment, ProcessRunner, Log, Tools, Resolver);

            tool.Pack(Settings);
        }