void AddBuildSettings(BuildSettingsChanges changes) { for (int ii = 0; ii < changes.Count; ++ii) { var entry = changes.EntryAt(ii); if (entry is BoolBuildSettingEntry) { var boolEntry = entry as BoolBuildSettingEntry; _pbxproj.AddBoolBuildSetting(boolEntry.Name, boolEntry.Value); } else if (entry is EnumBuildSettingEntry) { var enumEntry = entry as EnumBuildSettingEntry; _pbxproj.AddEnumBuildSetting(enumEntry.Name, enumEntry.Value); } else if (entry is CustomStringBuildSettingEntry) { var strEntry = entry as CustomStringBuildSettingEntry; _pbxproj.AddCustomStringBuildSetting(strEntry.Name, strEntry.Value); } else if (entry is StringBuildSettingEntry) { var strEntry = entry as StringBuildSettingEntry; _pbxproj.AddStringBuildSetting(strEntry.Name, strEntry.Value); } else if (entry is CollectionBuildSettingEntry) { var arrayEntry = entry as CollectionBuildSettingEntry; _pbxproj.AddCollectionBuildSetting(arrayEntry.Name, arrayEntry.Values.ToArray(), arrayEntry.Merge); } } }
public XcodeChangeFile() { IsDirty = false; SavePath = ""; Platform = BuildPlatform.iOS; Frameworks = new FrameworkChanges(); FilesAndFolders = new FilesAndFolderChanges(); Scripts = new ScriptChanges(); BuildSettings = new BuildSettingsChanges(); InfoPlistChanges = new PListDictionary(); Signing = new SigningChanges(); Capabilities = new CapabilitiesChanges(); }
void LoadBuildSettings(PListArray array) { if (array == null) { return; } try { BuildSettings = new BuildSettingsChanges(array); } catch (System.Exception e) { Debug.LogWarning("EgoXproject: Corrupt build settings section in " + SavePath + " : " + e.Message); } }
public void Merge(BuildSettingsChanges other) { foreach (var otherEntry in other._buildSettings) { var entry = _buildSettings.Find(o => o.Name == otherEntry.Name); //new entry, so add if (entry == null) { if (otherEntry is BoolBuildSettingEntry) { _buildSettings.Add(new BoolBuildSettingEntry(otherEntry as BoolBuildSettingEntry)); } else if (otherEntry is EnumBuildSettingEntry) { _buildSettings.Add(new EnumBuildSettingEntry(otherEntry as EnumBuildSettingEntry)); } else if (otherEntry is CollectionBuildSettingEntry) { var otherArray = otherEntry as CollectionBuildSettingEntry; if (otherArray.Values.Count <= 0) { continue; } var array = new CollectionBuildSettingEntry(otherArray); if (array.Values.Count <= 0) { continue; } _buildSettings.Add(array); } else if (otherEntry is CustomStringBuildSettingEntry) { var otherStr = otherEntry as CustomStringBuildSettingEntry; if (string.IsNullOrEmpty(otherStr.Value.Trim())) { continue; } if (string.IsNullOrEmpty(otherStr.Name.Trim())) { continue; } var str = new CustomStringBuildSettingEntry(otherStr); _buildSettings.Add(str); } else if (otherEntry is StringBuildSettingEntry) { var otherStr = otherEntry as StringBuildSettingEntry; if (string.IsNullOrEmpty(otherStr.Value.Trim())) { continue; } var str = new StringBuildSettingEntry(otherStr); _buildSettings.Add(str); } } //existing entry, so selective merge else { if (otherEntry is CollectionBuildSettingEntry) { var a = entry as CollectionBuildSettingEntry; var b = otherEntry as CollectionBuildSettingEntry; foreach (var otherValue in b.Values) { if (string.IsNullOrEmpty(otherValue)) { continue; } if (!a.Values.Contains(otherValue)) { a.Values.Add(otherValue); } } } else if (otherEntry is CustomStringBuildSettingEntry) { if (string.IsNullOrEmpty(entry.Name.Trim())) { continue; } var a = entry as CustomStringBuildSettingEntry; if (string.IsNullOrEmpty(a.Value.Trim())) { var b = otherEntry as CustomStringBuildSettingEntry; a.Value = b.Value; } } else if (otherEntry is StringBuildSettingEntry && entry is StringBuildSettingEntry) { var a = entry as StringBuildSettingEntry; if (string.IsNullOrEmpty(a.Value.Trim())) { var b = otherEntry as StringBuildSettingEntry; a.Value = b.Value; } } } } }