protected bool AddSearchPaths( PBXList paths, string key, bool recursive = true ) { bool modified = false; if( !ContainsKey( BUILDSETTINGS_KEY ) ) this.Add( BUILDSETTINGS_KEY, new PBXDictionary() ); foreach( string path in paths ) { string currentPath = path; if( recursive && !path.EndsWith( "/**" ) ) currentPath += "/**"; // Debug.Log( "adding: " + 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; } currentPath = "\\\"" + currentPath + "\\\""; if( !((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Contains( currentPath ) ) { ((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Add( currentPath ); modified = true; } } return modified; }
private PBXList ParseArray() { PBXList list = new PBXList(); bool complete = false; while (!complete) { switch (NextToken()) { case END_OF_FILE: Debug.Log("Error: Reached end of file inside a list: " + list); complete = true; break; case ARRAY_END_TOKEN: complete = true; break; case ARRAY_ITEM_DELIMITER_TOKEN: break; default: StepBackward(); list.Add(ParseValue()); break; } } return(list); }
public bool AddOtherCFlags( string flag ) { Debug.Log( "INIZIO 1" ); PBXList flags = new PBXList(); flags.Add( flag ); return AddOtherCFlags( flags ); }
public bool AddOtherLinkerFlags(string flag) { PBXList flags = new PBXList(); flags.Add(flag); return(AddOtherLinkerFlags(flags)); }
protected bool AddSearchPaths(string path, string key, bool recursive = true) { PBXList paths = new PBXList(); paths.Add(path); return(AddSearchPaths(paths, key, recursive)); }
protected bool AddSearchPaths(PBXList paths, string key, bool recursive = true) { bool modified = false; if (!ContainsKey(BUILDSETTINGS_KEY)) { this.Add(BUILDSETTINGS_KEY, new PBXDictionary()); } foreach (string path in paths) { string currentPath = path; 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; } currentPath = "\\\"" + currentPath + "\\\""; if (!((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Contains(currentPath)) { ((PBXList)((PBXDictionary)_data[BUILDSETTINGS_KEY])[key]).Add(currentPath); modified = true; } } return(modified); }
public bool SetWeakLink(bool weak = false) { PBXDictionary settings = null; PBXList attributes = null; if (!_data.ContainsKey(SETTINGS_KEY)) { if (weak) { attributes = new PBXList(); attributes.internalNewlines = false; attributes.Add(WEAK_VALUE); settings = new PBXDictionary(); settings.Add(ATTRIBUTES_KEY, attributes); settings.internalNewlines = false; this.Add(SETTINGS_KEY, settings); } return(true); } settings = _data[SETTINGS_KEY] as PBXDictionary; settings.internalNewlines = false; if (!settings.ContainsKey(ATTRIBUTES_KEY)) { if (weak) { attributes = new PBXList(); attributes.internalNewlines = false; attributes.Add(WEAK_VALUE); settings.Add(ATTRIBUTES_KEY, attributes); return(true); } else { return(false); } } else { attributes = settings[ATTRIBUTES_KEY] as PBXList; } attributes.internalNewlines = false; if (weak) { attributes.Add(WEAK_VALUE); } else { attributes.Remove(WEAK_VALUE); } settings.Add(ATTRIBUTES_KEY, attributes); this.Add(SETTINGS_KEY, settings); return(true); }
public bool AddOtherCFlags(string flag) { //Debug.Log( "INIZIO 1" ); PBXList flags = new PBXList(); flags.Add(flag); return(AddOtherCFlags(flags)); }
public void AddRegion(string region) { if (!_clearedLoc) { // Only include localizations we explicitly specify knownRegions.Clear(); _clearedLoc = true; } knownRegions.Add(region); }
public bool AddOtherBuildingFalg(string key, string value) { if (!((PBXDictionary)_data[BUILDSETTINGS_KEY]).ContainsKey(key)) { PBXList pList = new PBXList(); pList.Add(value); ((PBXDictionary)_data[BUILDSETTINGS_KEY]).Add(key, pList); } 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); }
public bool SetWeakLink( bool weak = false ) { PBXDictionary settings = null; PBXList attributes = null; if( !_data.ContainsKey( SETTINGS_KEY ) ) { if( weak ) { attributes = new PBXList(); attributes.internalNewlines = false; attributes.Add( WEAK_VALUE ); settings = new PBXDictionary(); settings.Add( ATTRIBUTES_KEY, attributes ); settings.internalNewlines = false; this.Add( SETTINGS_KEY, settings ); } return true; } settings = _data[ SETTINGS_KEY ] as PBXDictionary; settings.internalNewlines = false; if( !settings.ContainsKey( ATTRIBUTES_KEY ) ) { if( weak ) { attributes = new PBXList(); attributes.internalNewlines = false; attributes.Add( WEAK_VALUE ); settings.Add( ATTRIBUTES_KEY, attributes ); return true; } else { return false; } } else { attributes = settings[ ATTRIBUTES_KEY ] as PBXList; } attributes.internalNewlines = false; if( weak ) { attributes.Add( WEAK_VALUE ); } else { attributes.Remove( WEAK_VALUE ); } settings.Add( ATTRIBUTES_KEY, attributes ); this.Add( SETTINGS_KEY, settings ); return true; }
//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); }
public void AddKnownRegion(string region) { if (string.IsNullOrEmpty(region)) { return; } if (System.Text.RegularExpressions.Regex.IsMatch(region, "[a-z]{2}[_-][a-z]{2}", System.Text.RegularExpressions.RegexOptions.IgnoreCase)) { region = "\"" + region.Replace("_", "-") + "\""; } PBXList _list = (PBXList)this.data["knownRegions"]; if (!_list.Contains(region)) { _list.Add(region); } }
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; }
public void SetWeakLink(bool weak) { PBXDictionary settings = null; PBXList attributes = null; if (_data.ContainsKey(SETTINGS_KEY)) { settings = _data[SETTINGS_KEY] as PBXDictionary; if (settings.ContainsKey(ATTRIBUTES_KEY)) { attributes = settings[ATTRIBUTES_KEY] as PBXList; } } if (weak) { if (settings == null) { settings = new PBXDictionary(); settings.internalNewlines = false; _data.Add(SETTINGS_KEY, settings); } if (attributes == null) { attributes = new PBXList(); attributes.internalNewlines = false; attributes.Add(WEAK_VALUE); settings.Add(ATTRIBUTES_KEY, attributes); } } else { if (attributes != null && attributes.Contains(WEAK_VALUE)) { attributes.Remove(WEAK_VALUE); } } }
//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; }
public bool AddOtherLinkerFlags( string flag ) { PBXList flags = new PBXList(); flags.Add( flag ); return AddOtherLinkerFlags( flags ); }
protected bool AddSearchPaths( string path, string key, bool recursive = true ) { PBXList paths = new PBXList(); paths.Add( path ); return AddSearchPaths( paths, key, recursive ); }
private PBXList ParseArray() { PBXList list = new PBXList(); bool complete = false; while( !complete ) { switch( NextToken() ) { case END_OF_FILE: Debug.Log( "Error: Reached end of file inside a list: " + list ); complete = true; break; case ARRAY_END_TOKEN: complete = true; break; case ARRAY_ITEM_DELIMITER_TOKEN: break; default: StepBackward(); list.Add( ParseValue() ); break; } } return list; }