public override void Run(BuildContext context) { context.EnsureDirectoryExists(Paths.Nuget); var portableNuspecFile = Paths.Nuspec.CombineWithFilePath("GitVersion.Portable.nuspec"); if (!context.FileExists(portableNuspecFile)) { return; } var artifactPath = context.MakeAbsolute(Paths.ArtifactsBinPortable).FullPath; var chocolateySettings = new ChocolateyPackSettings { LimitOutput = true, Version = context.Version?.SemVersion, OutputDirectory = Paths.Nuget, Files = context.GetFiles(artifactPath + "/**/*.*") .Select(file => new ChocolateyNuSpecContent { Source = file.FullPath, Target = file.FullPath.Replace(artifactPath, "") }) .ToArray() }; context.ChocolateyPack(portableNuspecFile, chocolateySettings); }
public ChocolateyPackerFixture() { NuSpecFilePath = "./existing.nuspec"; Settings = new ChocolateyPackSettings(); FileSystem.CreateFile("/Working/existing.nuspec").SetContent(Resources.ChocolateyNuspec_NoMetadataValues); }
public static void ChocolateyPack(this ICakeContext context, ChocolateyPackSettings settings) { if (context == null) { throw new ArgumentNullException(nameof(context)); } var resolver = new ChocolateyToolResolver(context.FileSystem, context.Environment); var packer = new ChocolateyPacker(context.FileSystem, context.Environment, context.ProcessRunner, context.Log, context.Tools, resolver); packer.Pack(settings); }
public static void ChocolateyPack(this ICakeContext context, FilePath nuspecFilePath, ChocolateyPackSettings settings) { if (context == null) { throw new ArgumentNullException("context"); } var resolver = new ChocolateyToolResolver(context.FileSystem, context.Environment); var packer = new ChocolateyPacker(context.FileSystem, context.Environment, context.ProcessRunner, context.Log, context.Globber, resolver); packer.Pack(nuspecFilePath, settings); }