public bool overwriteBuildSetting(string settingName, ArrayList settingValues)
        {
            PBXList flags = new PBXList();

            foreach (var item in settingValues)
            {
                flags.Add(item.ToString());
            }
            return(overwriteBuildSetting(settingName, flags));
        }
Example #2
0
 public bool AddLibrarySearchPaths(PBXList paths)
 {
     Debug.Log("AddLibrarySearchPaths " + paths);
     foreach (KeyValuePair <string, XCBuildConfiguration> buildConfig in buildConfigurations)
     {
         buildConfig.Value.AddLibrarySearchPaths(paths);
     }
     modified = true;
     return(modified);
 }
Example #3
0
        public bool SetWeakLink(bool weak = false)
        {
            PBXDictionary settings   = null;
            PBXList       attributes = null;

            if (!_data.ContainsKey(SETTINGS_KEY))
            {
                if (weak)
                {
                    attributes = new PBXList();
                    attributes.Add(WEAK_VALUE);

                    settings = new PBXDictionary();
                    settings.Add(ATTRIBUTES_KEY, attributes);

                    _data.Add(SETTINGS_KEY, settings);
                }
                return(true);
            }

            settings = _data[SETTINGS_KEY] as PBXDictionary;
            if (!settings.ContainsKey(ATTRIBUTES_KEY))
            {
                if (weak)
                {
                    attributes = new PBXList();
                    attributes.Add(WEAK_VALUE);
                    settings.Add(ATTRIBUTES_KEY, attributes);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                attributes = settings[ATTRIBUTES_KEY] as PBXList;
            }

            if (weak)
            {
                attributes.Add(WEAK_VALUE);
            }
            else
            {
                attributes.Remove(WEAK_VALUE);
            }

            settings.Add(ATTRIBUTES_KEY, attributes);
            this.Add(SETTINGS_KEY, settings);

            return(true);
        }
        protected bool AddSearchPaths(PBXList paths, string key, bool recursive = true, bool quoted = false)          //we want no quoting whenever we can get away with it
        {
            //Debug.Log ("AddSearchPaths " + paths + key + (recursive?" recursive":"") + " " + (quoted?" quoted":""));
            bool modified = false;

            if (!ContainsKey(BUILDSETTINGS_KEY))
            {
                this.Add(BUILDSETTINGS_KEY, new PBXSortedDictionary());
            }

            foreach (string path in paths)
            {
                string currentPath = path;
                //Debug.Log ("path " + currentPath);
                if (!((PBXDictionary)_data [BUILDSETTINGS_KEY]).ContainsKey(key))
                {
                    ((PBXDictionary)_data [BUILDSETTINGS_KEY]).Add(key, new PBXList());
                }
                else if (((PBXDictionary)_data [BUILDSETTINGS_KEY]) [key] is string)
                {
                    PBXList list = new PBXList();
                    list.Add(((PBXDictionary)_data [BUILDSETTINGS_KEY]) [key]);
                    ((PBXDictionary)_data [BUILDSETTINGS_KEY]) [key] = list;
                }

                //Xcode uses space as the delimiter here, so if there's a space in the filename, we *must* quote. Escaping with slash may work when you are in the Xcode UI, in some situations, but it doesn't work here.
                if (currentPath.Contains(@" "))
                {
                    quoted = true;
                }

                if (quoted)
                {
                    //if it ends in "/**", it wants to be recursive, and the "/**" needs to be _outside_ the quotes
                    if (currentPath.EndsWith("/**"))
                    {
                        currentPath = "\\\"" + currentPath.Replace("/**", "\\\"/**");
                    }
                    else
                    {
                        currentPath = "\\\"" + currentPath + "\\\"";
                    }
                }
                //Debug.Log ("currentPath = " + currentPath);
                if (!((PBXList)((PBXDictionary)_data [BUILDSETTINGS_KEY]) [key]).Contains(currentPath))
                {
                    ((PBXList)((PBXDictionary)_data [BUILDSETTINGS_KEY]) [key]).Add(currentPath);
                    modified = true;
                }
            }

            return(modified);
        }
Example #5
0
        //CodeSignOnCopy
        public bool AddCodeSignOnCopy()
        {
            if (!_data.ContainsKey(SETTINGS_KEY))
            {
                _data[SETTINGS_KEY] = new PBXDictionary();
            }

            var settings = _data[SETTINGS_KEY] as PBXDictionary;

            if (!settings.ContainsKey(ATTRIBUTES_KEY))
            {
                var attributes = new PBXList();
                attributes.Add("CodeSignOnCopy");
                attributes.Add("RemoveHeadersOnCopy");
                settings.Add(ATTRIBUTES_KEY, attributes);
            }
            else
            {
                var attributes = settings[ATTRIBUTES_KEY] as PBXList;
                attributes.Add("CodeSignOnCopy");
                attributes.Add("RemoveHeadersOnCopy");
            }
            return(true);
        }
Example #6
0
        public void AddSystemCapabilities(string capabilities, bool isEnabled)
        {
            string enabled;

            if (isEnabled)
            {
                enabled = "1";
            }
            else
            {
                enabled = "0";
            }

            Debug.Log("in AddSystemCapabilities");

            PBXDictionary _Attributes       = (PBXDictionary)_project.data ["attributes"];
            PBXDictionary _TargetAttributes = (PBXDictionary)_Attributes ["TargetAttributes"];
            PBXList       _targets          = (PBXList)_project.data ["targets"];
            PBXDictionary targetDict        = null;

            Debug.Log("_TargetAttributes:" + _TargetAttributes);

            if (_TargetAttributes.ContainsKey((string)_targets [0]))
            {
                targetDict = (PBXDictionary)_TargetAttributes [(string)_targets [0]];
            }
            else                //不会发生
                                //				Debug.Log ("AddSystemCapabilities error");
                                //				return;
            {
                targetDict = new PBXDictionary();
            }
            Debug.Log("targetDict:" + targetDict);

            PBXDictionary SystemCapabilities = null;

            if (targetDict != null && targetDict.ContainsKey("SystemCapabilities"))
            {
                Debug.Log("xxxxxxxxxxxxxxxxxxx");
                SystemCapabilities = (PBXDictionary)targetDict ["SystemCapabilities"];
            }
            else
            {
                SystemCapabilities = new PBXDictionary();
            }

            Debug.Log("before SystemCapabilities:" + SystemCapabilities);
            if (SystemCapabilities != null && SystemCapabilities.ContainsKey(capabilities))
            {
                SystemCapabilities.Remove(capabilities);
            }
            Debug.Log("after SystemCapabilities:" + SystemCapabilities);
            PBXDictionary enable = new PBXDictionary();

            enable.Add("enabled", enabled);

            SystemCapabilities.Add(capabilities, enable);
            Debug.Log("after SystemCapabilities:" + SystemCapabilities);


            if (!targetDict.ContainsKey("SystemCapabilities"))
            {
//				Debug.Log ("rrrrrrrrrrrrrrrrrrrrrr");
                targetDict.Add("SystemCapabilities", SystemCapabilities);
            }
            if (!_TargetAttributes.ContainsKey((string)_targets [0]))
            {
//				Debug.Log ("hhhhhhhhhhhhhhhhhhhhh");
                _TargetAttributes.Add((string)_targets [0], targetDict);
            }

            Debug.Log("after attributes:" + _TargetAttributes);
            Debug.Log("AddSystemCapabilities done");
        }
 public bool AddHeaderSearchPaths(PBXList paths, bool recursive = true)
 {
     return(this.AddSearchPaths(paths, HEADER_SEARCH_PATHS_KEY, recursive));
 }
 public bool AddFrameworkSearchPaths(PBXList paths, bool recursive = true)
 {
     return(this.AddSearchPaths(paths, FRAMEWORK_SEARCH_PATHS_KEY, recursive));
 }
 public bool AddLibrarySearchPaths(PBXList paths, bool recursive = true)
 {
     Debug.Log("AddLibrarySearchPaths " + paths);
     return(this.AddSearchPaths(paths, LIBRARY_SEARCH_PATHS_KEY, recursive));
 }