Exemplo n.º 1
0
        public PBXElementArray AddArray()
        {
            PBXElementArray pbxElementArray = new PBXElementArray();

            this.values.Add((PBXElement)pbxElementArray);
            return(pbxElementArray);
        }
Exemplo n.º 2
0
        public override void UpdateProps()
        {
            SetPropertyString("fileRef", fileRef);
            if (compileFlags != null && compileFlags != "")
            {
                GetSettingsDict().SetString("COMPILER_FLAGS", compileFlags);
            }
            if (weak)
            {
                var             dict  = GetSettingsDict();
                PBXElementArray attrs = null;
                if (dict.Contains("ATTRIBUTES"))
                {
                    attrs = dict["ATTRIBUTES"].AsArray();
                }
                else
                {
                    attrs = dict.CreateArray("ATTRIBUTES");
                }

                bool exists = false;
                foreach (var value in attrs.values)
                {
                    if (value is PBXElementString && value.AsString() == "Weak")
                    {
                        exists = true;
                    }
                }
                if (!exists)
                {
                    attrs.AddString("Weak");
                }
            }
        }
Exemplo n.º 3
0
 public static void WriteArray(StringBuilder sb, PBXElementArray el, int indent, bool compact, PropertyCommentChecker checker, GUIDToCommentMap comments)
 {
     sb.Append("(");
     foreach (PBXElement element in el.values)
     {
         if (!compact)
         {
             sb.Append("\n");
             sb.Append(GetIndent(indent + 1));
         }
         if (element is PBXElementString)
         {
             WriteStringImpl(sb, element.AsString(), checker.CheckStringValueInArray(element.AsString()), comments);
         }
         else if (element is PBXElementDict)
         {
             WriteDict(sb, element.AsDict(), indent + 1, compact, checker.NextLevel("*"), comments);
         }
         else if (element is PBXElementArray)
         {
             WriteArray(sb, element.AsArray(), indent + 1, compact, checker.NextLevel("*"), comments);
         }
         sb.Append(",");
         if (compact)
         {
             sb.Append(" ");
         }
     }
     if (!compact)
     {
         sb.Append("\n");
         sb.Append(GetIndent(indent));
     }
     sb.Append(")");
 }
Exemplo n.º 4
0
 public static void WriteArray(StringBuilder sb, PBXElementArray el, int indent, bool compact, PropertyCommentChecker checker, GUIDToCommentMap comments)
 {
     sb.Append("(");
     foreach (PBXElement pbxElement in el.values)
     {
         if (!compact)
         {
             sb.Append("\n");
             sb.Append(Serializer.GetIndent(indent + 1));
         }
         if (pbxElement is PBXElementString)
         {
             Serializer.WriteStringImpl(sb, pbxElement.AsString(), checker.CheckStringValueInArray(pbxElement.AsString()), comments);
         }
         else if (pbxElement is PBXElementDict)
         {
             Serializer.WriteDict(sb, pbxElement.AsDict(), indent + 1, compact, checker.NextLevel("*"), comments);
         }
         else if (pbxElement is PBXElementArray)
         {
             Serializer.WriteArray(sb, pbxElement.AsArray(), indent + 1, compact, checker.NextLevel("*"), comments);
         }
         sb.Append(",");
         if (compact)
         {
             sb.Append(" ");
         }
     }
     if (!compact)
     {
         sb.Append("\n");
         sb.Append(Serializer.GetIndent(indent));
     }
     sb.Append(")");
 }
 public override void UpdateProps()
 {
     base.m_Properties.values.Remove("projectReferences");
     if (this.projectReferences.Count > 0)
     {
         PBXElementArray array = base.m_Properties.CreateArray("projectReferences");
         foreach (ProjectReference reference in this.projectReferences)
         {
             PBXElementDict dict = array.AddDict();
             dict.SetString("ProductGroup", reference.group);
             dict.SetString("ProjectRef", reference.projectRef);
         }
     }
     base.SetPropertyList("targets", this.targets);
     base.SetPropertyString("buildConfigurationList", this.buildConfigList);
     if (this.knownAssetTags.Count > 0)
     {
         PBXElementDict dict2;
         if (base.m_Properties.Contains("attributes"))
         {
             dict2 = base.m_Properties["attributes"].AsDict();
         }
         else
         {
             dict2 = base.m_Properties.CreateDict("attributes");
         }
         PBXElementArray array2 = dict2.CreateArray("knownAssetTags");
         foreach (string str in this.knownAssetTags)
         {
             array2.AddString(str);
         }
     }
 }
 public override void UpdateVars()
 {
     this.projectReferences = new List <ProjectReference>();
     if (base.m_Properties.Contains("projectReferences"))
     {
         PBXElementArray array = base.m_Properties["projectReferences"].AsArray();
         foreach (PBXElement element in array.values)
         {
             PBXElementDict dict = element.AsDict();
             if (dict.Contains("ProductGroup") && dict.Contains("ProjectRef"))
             {
                 string group      = dict["ProductGroup"].AsString();
                 string projectRef = dict["ProjectRef"].AsString();
                 this.projectReferences.Add(ProjectReference.Create(group, projectRef));
             }
         }
     }
     this.targets         = base.GetPropertyList("targets");
     this.buildConfigList = base.GetPropertyString("buildConfigurationList");
     this.knownAssetTags  = new List <string>();
     if (base.m_Properties.Contains("attributes"))
     {
         PBXElementDict dict2 = base.m_Properties["attributes"].AsDict();
         if (dict2.Contains("knownAssetTags"))
         {
             PBXElementArray array2 = dict2["knownAssetTags"].AsArray();
             foreach (PBXElement element2 in array2.values)
             {
                 this.knownAssetTags.Add(element2.AsString());
             }
         }
     }
 }
Exemplo n.º 7
0
        public PBXElementArray CreateArray(string key)
        {
            PBXElementArray pbxElementArray = new PBXElementArray();

            this.values[key] = (PBXElement)pbxElementArray;
            return(pbxElementArray);
        }
Exemplo n.º 8
0
        public PBXElementArray AddArray()
        {
            PBXElementArray item = new PBXElementArray();

            this.values.Add(item);
            return(item);
        }
Exemplo n.º 9
0
        public PBXElementArray AddArray()
        {
            var v = new PBXElementArray();

            values.Add(v);
            return(v);
        }
Exemplo n.º 10
0
        public PBXElementArray CreateArray(string key)
        {
            PBXElementArray array = new PBXElementArray();

            this.values[key] = array;
            return(array);
        }
Exemplo n.º 11
0
        public PBXElementArray CreateArray(string key)
        {
            var v = new PBXElementArray();

            values[key] = v;
            return(v);
        }
Exemplo n.º 12
0
 public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text)
 {
     PBXElementArray array = new PBXElementArray();
     foreach (ValueAST east in ast.values)
     {
         array.values.Add(ParseValueAST(east, tokens, text));
     }
     return array;
 }
Exemplo n.º 13
0
        public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text)
        {
            PBXElementArray array = new PBXElementArray();

            foreach (ValueAST east in ast.values)
            {
                array.values.Add(ParseValueAST(east, tokens, text));
            }
            return(array);
        }
Exemplo n.º 14
0
        public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text)
        {
            PBXElementArray pbxElementArray = new PBXElementArray();

            foreach (ValueAST ast1 in ast.values)
            {
                pbxElementArray.values.Add(Serializer.ParseValueAST(ast1, tokens, text));
            }
            return(pbxElementArray);
        }
Exemplo n.º 15
0
        public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text)
        {
            var el = new PBXElementArray();

            foreach (var v in ast.values)
            {
                el.values.Add(ParseValueAST(v, tokens, text));
            }
            return(el);
        }
Exemplo n.º 16
0
        public override void UpdateProps()
        {
            base.SetPropertyString("fileRef", this.fileRef);
            PBXElementDict dict = null;

            if (base.m_Properties.Contains("settings"))
            {
                dict = base.m_Properties["settings"].AsDict();
            }
            if ((this.compileFlags != null) && (this.compileFlags != ""))
            {
                if (dict == null)
                {
                    dict = base.m_Properties.CreateDict("settings");
                }
                dict.SetString("COMPILER_FLAGS", this.compileFlags);
            }
            else if (dict != null)
            {
                dict.Remove("COMPILER_FLAGS");
            }
            if (this.weak)
            {
                if (dict == null)
                {
                    dict = base.m_Properties.CreateDict("settings");
                }
                PBXElementArray array = null;
                if (dict.Contains("ATTRIBUTES"))
                {
                    array = dict["ATTRIBUTES"].AsArray();
                }
                else
                {
                    array = dict.CreateArray("ATTRIBUTES");
                }
                bool flag = false;
                foreach (PBXElement element in array.values)
                {
                    if ((element is PBXElementString) && (element.AsString() == "Weak"))
                    {
                        flag = true;
                    }
                }
                if (!flag)
                {
                    array.AddString("Weak");
                }
            }
            else if ((dict != null) && dict.Contains("ATTRIBUTES"))
            {
                PBXElementArray array2 = dict["ATTRIBUTES"].AsArray();
                if (< > f__am$cache0 == null)
                {
Exemplo n.º 17
0
 protected void SetPropertyList(string name, List <string> value)
 {
     if (value == null)
     {
         this.m_Properties.Remove(name);
     }
     else
     {
         PBXElementArray array = this.m_Properties.CreateArray(name);
         foreach (string val in value)
         {
             array.AddString(val);
         }
     }
 }
Exemplo n.º 18
0
        public override void UpdateProps()
        {
            this.SetPropertyString("fileRef", this.fileRef);
            PBXElementDict settings = (PBXElementDict)null;

            if (this.m_Properties.Contains("settings"))
            {
                settings = this.m_Properties["settings"].AsDict();
            }
            if (this.compileFlags != null && this.compileFlags != "")
            {
                if (settings == null)
                {
                    settings = this.m_Properties.CreateDict("settings");
                }
                settings.SetString("COMPILER_FLAGS", this.compileFlags);
            }
            else if (settings != null)
            {
                settings.Remove("COMPILER_FLAGS");
            }
            PBXElementDict pbxElementDict = this.UpdatePropsAttribute(this.UpdatePropsAttribute(this.UpdatePropsAttribute(settings, this.weak, "Weak"), this.codeSignOnCopy, "CodeSignOnCopy"), this.removeHeadersOnCopy, "RemoveHeadersOnCopy");

            if (this.assetTags.Count > 0)
            {
                if (pbxElementDict == null)
                {
                    pbxElementDict = this.m_Properties.CreateDict("settings");
                }
                PBXElementArray array = pbxElementDict.CreateArray("ASSET_TAGS");
                foreach (string val in this.assetTags)
                {
                    array.AddString(val);
                }
            }
            else if (pbxElementDict != null)
            {
                pbxElementDict.Remove("ASSET_TAGS");
            }
            if (pbxElementDict == null || pbxElementDict.values.Count != 0)
            {
                return;
            }
            this.m_Properties.Remove("settings");
        }
Exemplo n.º 19
0
        private PBXElementDict UpdatePropsAttribute(PBXElementDict settings, bool value, string attributeName)
        {
            PBXElementArray pbxElementArray = (PBXElementArray)null;

            if (value && settings == null)
            {
                settings = this.m_Properties.CreateDict("settings");
            }
            if (settings != null && settings.Contains("ATTRIBUTES"))
            {
                pbxElementArray = settings["ATTRIBUTES"].AsArray();
            }
            if (value)
            {
                if (pbxElementArray == null)
                {
                    pbxElementArray = settings.CreateArray("ATTRIBUTES");
                }
                if (!Enumerable.Any <PBXElement>((IEnumerable <PBXElement>)pbxElementArray.values, (Func <PBXElement, bool>)(attr => attr is PBXElementString && attr.AsString() == attributeName)))
                {
                    pbxElementArray.AddString(attributeName);
                }
            }
            else if (pbxElementArray != null)
            {
                pbxElementArray.values.RemoveAll((Predicate <PBXElement>)(el =>
                {
                    if (el is PBXElementString)
                    {
                        return(el.AsString() == attributeName);
                    }
                    return(false);
                }));
                if (pbxElementArray.values.Count == 0)
                {
                    settings.Remove("ATTRIBUTES");
                }
            }
            return(settings);
        }
Exemplo n.º 20
0
 public override void UpdateProps()
 {
     this.m_Properties.values.Remove("projectReferences");
     if (this.projectReferences.Count > 0)
     {
         PBXElementArray array = this.m_Properties.CreateArray("projectReferences");
         foreach (ProjectReference projectReference in this.projectReferences)
         {
             PBXElementDict pbxElementDict = array.AddDict();
             pbxElementDict.SetString("ProductGroup", projectReference.group);
             pbxElementDict.SetString("ProjectRef", projectReference.projectRef);
         }
     }
     this.SetPropertyList("targets", this.targets);
     this.SetPropertyString("buildConfigurationList", this.buildConfigList);
     if (this.knownAssetTags.Count > 0)
     {
         PBXElementArray array = (!this.m_Properties.Contains("attributes") ? this.m_Properties.CreateDict("attributes") : this.m_Properties["attributes"].AsDict()).CreateArray("knownAssetTags");
         foreach (string val in this.knownAssetTags)
         {
             array.AddString(val);
         }
     }
     foreach (PBXCapabilityType.TargetCapabilityPair targetCapabilityPair in this.capabilities)
     {
         PBXElementDict pbxElementDict1 = this.m_Properties.Contains("attributes") ? this.m_Properties["attributes"].AsDict() : this.m_Properties.CreateDict("attributes");
         PBXElementDict pbxElementDict2 = pbxElementDict1.Contains("TargetAttributes") ? pbxElementDict1["TargetAttributes"].AsDict() : pbxElementDict1.CreateDict("TargetAttributes");
         PBXElementDict pbxElementDict3 = pbxElementDict2.Contains(targetCapabilityPair.targetGuid) ? pbxElementDict2[targetCapabilityPair.targetGuid].AsDict() : pbxElementDict2.CreateDict(targetCapabilityPair.targetGuid);
         PBXElementDict pbxElementDict4 = pbxElementDict3.Contains("SystemCapabilities") ? pbxElementDict3["SystemCapabilities"].AsDict() : pbxElementDict3.CreateDict("SystemCapabilities");
         string         id = targetCapabilityPair.capability.id;
         (pbxElementDict4.Contains(id) ? pbxElementDict4[id].AsDict() : pbxElementDict4.CreateDict(id)).SetString("enabled", "1");
     }
     foreach (KeyValuePair <string, string> keyValuePair in this.teamIDs)
     {
         PBXElementDict pbxElementDict1 = this.m_Properties.Contains("attributes") ? this.m_Properties["attributes"].AsDict() : this.m_Properties.CreateDict("attributes");
         PBXElementDict pbxElementDict2 = pbxElementDict1.Contains("TargetAttributes") ? pbxElementDict1["TargetAttributes"].AsDict() : pbxElementDict1.CreateDict("TargetAttributes");
         (pbxElementDict2.Contains(keyValuePair.Key) ? pbxElementDict2[keyValuePair.Key].AsDict() : pbxElementDict2.CreateDict(keyValuePair.Key)).SetString("DevelopmentTeam", keyValuePair.Value);
     }
 }
        public override void UpdateProps()
        {
            PBXElementDict dict = base.m_Properties.CreateDict("buildSettings");

            foreach (KeyValuePair <string, BuildConfigEntryData> pair in this.entries)
            {
                if (pair.Value.val.Count != 0)
                {
                    if (pair.Value.val.Count == 1)
                    {
                        dict.SetString(pair.Key, pair.Value.val[0]);
                    }
                    else
                    {
                        PBXElementArray array = dict.CreateArray(pair.Key);
                        foreach (string str in pair.Value.val)
                        {
                            array.AddString(str);
                        }
                    }
                }
            }
        }
Exemplo n.º 22
0
        public override void UpdateProps()
        {
            this.SetPropertyString("baseConfigurationReference", this.baseConfigurationReference);
            PBXElementDict dict = this.m_Properties.CreateDict("buildSettings");

            foreach (KeyValuePair <string, BuildConfigEntryData> keyValuePair in this.entries)
            {
                if (keyValuePair.Value.val.Count != 0)
                {
                    if (keyValuePair.Value.val.Count == 1)
                    {
                        dict.SetString(keyValuePair.Key, keyValuePair.Value.val[0]);
                    }
                    else
                    {
                        PBXElementArray array = dict.CreateArray(keyValuePair.Key);
                        foreach (string val in keyValuePair.Value.val)
                        {
                            array.AddString(val);
                        }
                    }
                }
            }
        }
Exemplo n.º 23
0
 public PBXElementArray CreateArray(string key)
 {
     var v = new PBXElementArray();
     values[key] = v;
     return v;
 }
Exemplo n.º 24
0
 public static PBXElementArray ParseArrayAST(ArrayAST ast, TokenList tokens, string text)
 {
     var el = new PBXElementArray();
     foreach (var v in ast.values)
     {
         el.values.Add(ParseValueAST(v, tokens, text));
     }
     return el;
 }
Exemplo n.º 25
0
 public PBXElementArray CreateArray(string key)
 {
     PBXElementArray array = new PBXElementArray();
     this.values[key] = array;
     return array;
 }
Exemplo n.º 26
0
        public override void UpdateProps()
        {
            SetPropertyString("fileRef", fileRef);

            PBXElementDict settings = null;

            if (m_Properties.Contains("settings"))
            {
                settings = m_Properties["settings"].AsDict();
            }

            if (compileFlags != null && compileFlags != "")
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                settings.SetString("COMPILER_FLAGS", compileFlags);
            }
            else
            {
                if (settings != null)
                {
                    settings.Remove("COMPILER_FLAGS");
                }
            }

            if (weak)
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                PBXElementArray attrs = null;
                if (settings.Contains("ATTRIBUTES"))
                {
                    attrs = settings["ATTRIBUTES"].AsArray();
                }
                else
                {
                    attrs = settings.CreateArray("ATTRIBUTES");
                }

                bool exists = false;
                foreach (var value in attrs.values)
                {
                    if (value is PBXElementString && value.AsString() == "Weak")
                    {
                        exists = true;
                    }
                }
                if (!exists)
                {
                    attrs.AddString("Weak");
                }
            }
            else
            {
                if (settings != null && settings.Contains("ATTRIBUTES"))
                {
                    var attrs = settings["ATTRIBUTES"].AsArray();
                    attrs.values.RemoveAll(el => (el is PBXElementString && el.AsString() == "Weak"));
                    if (attrs.values.Count == 0)
                    {
                        settings.Remove("ATTRIBUTES");
                    }
                }
            }

            if (assetTags.Count > 0)
            {
                if (settings == null)
                {
                    settings = m_Properties.CreateDict("settings");
                }
                var tagsArray = settings.CreateArray("ASSET_TAGS");
                foreach (string tag in assetTags)
                {
                    tagsArray.AddString(tag);
                }
            }
            else
            {
                if (settings != null)
                {
                    settings.Remove("ASSET_TAGS");
                }
            }

            if (settings != null && settings.values.Count == 0)
            {
                m_Properties.Remove("settings");
            }
        }
Exemplo n.º 27
0
 public PBXElementArray AddArray()
 {
     var v = new PBXElementArray();
     values.Add(v);
     return v;
 }