public void BuildAndApplyProjectSettings(IBuildVariant buildVariant,
                                          IEnumerable <IProjectSettingsFile> additionalSettings    = null,
                                          IProjectSettingsFile ignoreAdditionalProjectSettingsFile = null,
                                          YamlNode ignoreAdditionalNode = null)
 {
     if (additionalSettings == null)
     {
         additionalSettings = Enumerable.Empty <IProjectSettingsFile>();
     }
     else
     {
         if (ignoreAdditionalProjectSettingsFile != null)
         {
             additionalSettings = additionalSettings.Where(p => p.FileName != ignoreAdditionalProjectSettingsFile.FileName);
             if (ignoreAdditionalNode != null)
             {
                 additionalSettings = additionalSettings.Append(
                     new ProjectSettingsFile {
                     FileName = ignoreAdditionalProjectSettingsFile.FileName,
                     RootNode =
                         ignoreAdditionalProjectSettingsFile.RootNode.
                         Diff(ignoreAdditionalProjectSettingsFile.RootNode.GetChildBranch(ignoreAdditionalNode))
                 });
             }
         }
     }
     _projectSettingsStorage.SaveProjectSettings(
         _baseSettings.Concat(buildVariant.GetFinalProjectSettings()).
         Concat(additionalSettings).Merge().ToList());
     _actualProjectSettings = _projectSettingsStorage.LoadProjectSettings();
     InvalidateDiffCache();
 }
 public IEnumerable <IProjectSettingsFile> GetDiffWithActualSettings(IBuildVariant buildVariant)
 {
     if (_cachedDiff.Key == buildVariant)
     {
         return(_cachedDiff.Value);
     }
     _cachedDiff = new KeyValuePair <IBuildVariant, IEnumerable <IProjectSettingsFile> >(buildVariant,
                                                                                         _baseSettings.Concat(buildVariant.GetFinalProjectSettings()).Diff(_actualProjectSettings));
     return(_cachedDiff.Value);
 }