public string CreateSalesforceDelta(CommandLineArgs args)
        {
            var changes = _differ.RetrieveChanges(args.Repo, args.TargetBranch, args.SourceBranch);

            var tempDirectory = _bundler.CreateTempDirectoryFromDiff(changes);
            var metaDataRoot  = Path.Combine(tempDirectory, args.MetadataDirectory);

            var manifest    = _manifestGenerator.GenerateFor(metaDataRoot);
            var manifestXml = _manifestGenerator.Serialize(manifest);

            var packageTempLocation = Path.Combine(tempDirectory, "delta.zip");

            _fs.File.WriteAllText(_fs.Path.Combine(metaDataRoot, "package.xml"), manifestXml);
            _packager.Package(metaDataRoot, packageTempLocation);

            _output.WriteLine($"Copying '{packageTempLocation}' to '{args.OutputLocation}'...");

            File.Copy(packageTempLocation, args.OutputLocation, true);
            return(args.OutputLocation);
        }
Esempio n. 2
0
        public void Serialize_GivenPackage_WritesToXml()
        {
            var package = new Package
            {
                types = new[] { new PackageTypes {
                                    name = "test", members = new[] { "*" }
                                } },
                version = 36.0m
            };

            var xml = _gen.Serialize(package);

            Assert.That(xml, Is.EqualTo(@"<?xml version=""1.0"" encoding=""utf-16""?>
<Package xmlns=""http://soap.sforce.com/2006/04/metadata"">
  <types>
    <members>*</members>
    <name>test</name>
  </types>
  <version>36.0</version>
</Package>"));
        }