Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
        public ChocolateyPackerFixture()
        {
            NuSpecFilePath = "./existing.nuspec";
            Settings       = new ChocolateyPackSettings();

            FileSystem.CreateFile("/Working/existing.nuspec").SetContent(Resources.ChocolateyNuspec_NoMetadataValues);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }