コード例 #1
0
        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);
        }
コード例 #2
0
 public bool AddHeaderSearchPaths(PBXList paths, bool recursive = true)
 {
     return(this.AddSearchPaths(paths, HEADER_SEARCH_PATHS_KEY, recursive));
 }
コード例 #3
0
 public bool AddFrameworkSearchPaths(PBXList paths, bool recursive = true)
 {
     return(this.AddSearchPaths(paths, FRAMEWORK_SEARCH_PATHS_KEY, recursive));
 }
コード例 #4
0
 public bool AddLibrarySearchPaths(PBXList paths, bool recursive = true)
 {
     Debug.Log("AddLibrarySearchPaths " + paths);
     return(this.AddSearchPaths(paths, LIBRARY_SEARCH_PATHS_KEY, recursive));
 }