示例#1
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");
                }
            }
        }
 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);
         }
     }
 }
示例#3
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)
                {
示例#4
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);
         }
     }
 }
示例#5
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");
        }
示例#6
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);
        }
示例#7
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);
                        }
                    }
                }
            }
        }
示例#9
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);
                        }
                    }
                }
            }
        }
示例#10
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");
            }
        }