public void CreateSymbolsPackage(PackageParams ctx) { var symbolsBuilder = symbolsPackageBuilderFor(ctx.Spec, ctx.Version); // remove unnecessary files when building the symbols package ExcludeFilesForSymbolPackage(symbolsBuilder.Files); if (!symbolsBuilder.Files.Any()) { throw new CreateNugetException(symbolsBuilder.Id, true); } var nupkgSymbolsFileName = Path.Combine(ctx.OutputPath, "{0}.{1}.symbols.nupkg".ToFormat(ctx.Spec.Name, ctx.Version)); var package = createPackage(symbolsBuilder, nupkgSymbolsFileName); var issues = package.Validate(Rules); if (issues.Any(x => x.Level == PackageIssueLevel.Error)) { Console.ForegroundColor = ConsoleColor.Red; issues.Each(issue => Console.WriteLine("[{0}] {1} - {2}", issue.Level, issue.Title, issue.Description)); Console.ResetColor(); RippleAssert.Fail("Symbols package failed validation"); } }
public string CreatePackage(PackageParams ctx) { var builder = packageBuilderFor(ctx.Spec, ctx.Version); if (ctx.CreateSymbols) { ExcludeFilesForLibPackage(builder.Files); if (!builder.Files.Any()) { throw new CreateNugetException(builder.Id); } } var nupkgFileName = Path.Combine(ctx.OutputPath, "{0}.{1}.nupkg".ToFormat(ctx.Spec.Name, ctx.Version)); var package = createPackage(builder, nupkgFileName); if (ctx.CreateSymbols) { CreateSymbolsPackage(ctx); } var issues = package.Validate(Rules); if (issues.Any(x => x.Level == PackageIssueLevel.Error)) { Console.ForegroundColor = ConsoleColor.Red; issues.Each(issue => Console.WriteLine("[{0}] {1} - {2}", issue.Level, issue.Title, issue.Description)); Console.ResetColor(); RippleAssert.Fail("Package failed validation"); } return nupkgFileName; }
public string CreatePackage(PackageParams ctx) { var builder = packageBuilderFor(ctx.Spec, ctx.Version); if (ctx.CreateSymbols) { ExcludeFilesForLibPackage(builder.Files); if (!builder.Files.Any()) { throw new CreateNugetException(builder.Id); } } var nupkgFileName = Path.Combine(ctx.OutputPath, "{0}.{1}.nupkg".ToFormat(ctx.Spec.Name, ctx.Version)); var package = createPackage(builder, nupkgFileName); if (ctx.CreateSymbols) { CreateSymbolsPackage(ctx); } var issues = package.Validate(Rules); if (issues.Any(x => x.Level == PackageIssueLevel.Error)) { Console.ForegroundColor = ConsoleColor.Red; issues.Each(issue => Console.WriteLine("[{0}] {1} - {2}", issue.Level, issue.Title, issue.Description)); Console.ResetColor(); RippleAssert.Fail("Package failed validation"); } return(nupkgFileName); }
public string Package(PackageParams ctx) { return(Publisher.CreatePackage(ctx)); }
public void CreateSymbolsPackage(PackageParams ctx) { var symbolsBuilder = symbolsPackageBuilderFor(ctx.Spec, ctx.Version); // remove unnecessary files when building the symbols package ExcludeFilesForSymbolPackage(symbolsBuilder.Files); if (!symbolsBuilder.Files.Any()) { RippleLog.Info("No symbols could be generated for {0} since no symbol files could be found. This is expected if this is a code only package".ToFormat(ctx.Spec.Name)); return; } var nupkgSymbolsFileName = Path.Combine(ctx.OutputPath, "{0}.{1}.symbols.nupkg".ToFormat(ctx.Spec.Name, ctx.Version)); var package = createPackage(symbolsBuilder, nupkgSymbolsFileName); var issues = package.Validate(Rules); if (issues.Any(x => x.Level == PackageIssueLevel.Error)) { Console.ForegroundColor = ConsoleColor.Red; issues.Each(issue => Console.WriteLine("[{0}] {1} - {2}", issue.Level, issue.Title, issue.Description)); Console.ResetColor(); RippleAssert.Fail("Symbols package failed validation"); } }
public string Package(PackageParams ctx) { return Publisher.CreatePackage(ctx); }
public void publishes_the_specification() { var s1 = new NugetSpec("Test1", "Test1.nuspec"); var solution = new Solution(); var service = MockRepository.GenerateStub<IPublishingService>(); service.Stub(x => x.SpecificationsFor(solution)).Return(new[] { s1 }); solution.UsePublisher(service); var version = SemanticVersion.Parse("1.1.2.3"); var ctx = new PackageParams(s1, version, "artifacts", false); solution.Package(ctx); service.AssertWasCalled(x => x.CreatePackage(ctx)); }