Exemplo n.º 1
0
        private void generateNuspec(string targetFile)
        {
            var nuspec = new NuspecDocument(targetFile);
            _dependencies.Each(token =>
            {
                var dependency = token.Create();
                nuspec.AddDependency(dependency);
            });

            nuspec.SaveChanges();
        }
Exemplo n.º 2
0
            public void Publishes(string name, Action<PublishesExpression> configure)
            {
                var packagingDir = _solution.NugetSpecFolder;
                var specFile = Path.Combine(packagingDir, "{0}.nuspec".ToFormat(name));

                var nuspec = GetType()
                    .Assembly
                    .GetManifestResourceStream(GetType(), "NuspecTemplate.txt")
                    .ReadAllText();

                _fileSystem.WriteStringToFile(specFile, nuspec.Replace("${Name}", name));

                var document = new NuspecDocument(specFile);
                document.Name = name;

                var expression = new PublishesExpression(document, _solution);

                if (configure == null)
                {
                    expression.Assembly("{0}.dll".ToFormat(name));
                }
                else
                {
                    configure(expression);
                }

                document.SaveChanges();
            }