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");
            }
        }
        public void AddEnumBuildSetting(string settingName, string value)
        {
            if (string.IsNullOrEmpty(settingName))
            {
                return;
            }

            BaseBuildSetting baseSetting = null;

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

            //we don't know about it (custom) add as string, or it is a known enum, or it is known but not an enum
            if (baseSetting == null)
            {
                AddCustomStringBuildSetting(settingName, value);
            }
            else if (baseSetting is EnumBuildSetting)
            {
                var enumSetting = baseSetting as EnumBuildSetting;

                if (!enumSetting.IsValidValue(value))
                {
                    string values = enumSetting.EnumValues[0];

                    for (int ii = 1; ii < enumSetting.EnumValues.Length; ii++)
                    {
                        values += ", " + enumSetting.EnumValues[ii];
                    }

                    Debug.LogError("EgoXproject: " + settingName + " value " + value + " is not a valid option. It can only be one of the following: " + values);
                    return;
                }

                //TODO check for enum conditional
                BuildSettings[settingName] = new PBXProjString(value.ToLiteralIfRequired());
            }
            else
            {
                Debug.LogError("EgoXproject: " + settingName + " is not an enumerated string build setting");
            }
        }
        public void AddBoolBuildSetting(string settingName, bool value)
        {
            if (string.IsNullOrEmpty(settingName))
            {
                return;
            }

            BaseBuildSetting baseSetting = null;

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

            //we don't know about it (custom) or it is not a bool
            if (baseSetting == null || baseSetting is BoolBuildSetting)
            {
                //TODO check for bool conditional
                BuildSettings[settingName] = new PBXProjBoolean(value);
            }
            else
            {
                Debug.LogError("EgoXproject: " + settingName + " is not a boolean build setting");
            }
        }
        public void AddStringBuildSetting(string settingName, string value)
        {
            if (string.IsNullOrEmpty(settingName) || string.IsNullOrEmpty(value))
            {
                return;
            }

            BaseBuildSetting baseSetting = null;

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

            //is custom or is a string setting
            if (baseSetting == null || baseSetting is StringBuildSetting)
            {
                string settingNameToUse = SettingNameToUse(settingName);
                BuildSettings[settingNameToUse] = new PBXProjString(value.ToLiteralIfRequired());
            }
            else
            {
                Debug.LogError("EgoXproject: " + settingName + " is not a string build setting");
            }
        }
Beispiel #5
0
 public bool BuildSetting(string settingName, out BaseBuildSetting buildSetting)
 {
     return(_settings.TryGetValue(settingName, out buildSetting));
 }