Ejemplo n.º 1
0
        public void AddCollectionBuildSetting(string settingName, string[] values, MergeMethod mergeMethod)
        {
            if (string.IsNullOrEmpty(settingName) || values == null || values.Length <= 0)
            {
                return;
            }

            BaseBuildSetting baseSetting = null;

            XcodeBuildSettings.Instance().BuildSetting(settingName, out baseSetting);

            //its a custom array setting
            if (baseSetting == null)
            {
                baseSetting = new StringListBuildSetting(settingName, settingName, "User-Defined", false, false);
            }

            if (baseSetting is ArrayBuildSetting)
            {
                AddArrayBuildSetting(baseSetting as ArrayBuildSetting, values, mergeMethod);
            }
            else if (baseSetting is StringListBuildSetting)
            {
                AddStringListBuildSetting(baseSetting as StringListBuildSetting, values, mergeMethod);
            }
            else
            {
                Debug.LogError("EgoXproject: " + settingName + " is not a string list build setting");
            }
        }
Ejemplo n.º 2
0
        void AddStringList(PListDictionary dic)
        {
            string settingName, displayName, group;

            ExtractCommon(dic, out settingName, out displayName, out group);
            bool path      = dic.BoolValue(PATH_KEY);
            bool inherited = dic.BoolValue(INHERIT_KEY);

            _settings[settingName] = new StringListBuildSetting(settingName, displayName, group, path, inherited);
        }
Ejemplo n.º 3
0
        void AddStringListBuildSetting(StringListBuildSetting stringListSetting, string[] values, MergeMethod mergeMethod)
        {
            var           settings   = BuildSettings;
            PBXProjString stringList = null;

            //TODO check conditionals, as will have to run for each conditional variant

            //handle appending
            if (mergeMethod == MergeMethod.Append)
            {
                stringList = settings.Element <PBXProjString>(stringListSetting.BuildSettingName);
            }

            //handles null case and replace case
            if (stringList == null)
            {
                stringList = new PBXProjString();
                settings[stringListSetting.BuildSettingName] = stringList;
            }

            //break down string list into list so it can be checked
            List <string> existingValues = StringUtils.StringListToList(stringList.Value);

            // handle settings that need inherit string being added
            if (stringListSetting.AddInherited)
            {
                if (existingValues.Where(o => o.Equals(INHERITED)).Count() <= 0)
                {
                    existingValues.Insert(0, INHERITED);
                }
            }

            foreach (var v in values)
            {
                if (existingValues.Where(o => o.Equals(v)).Count() <= 0)
                {
                    existingValues.Add(v);
                }
            }

            stringList.Value = StringUtils.ListToStringList(existingValues);
        }