Пример #1
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 assetTag in this.assetTags)
                {
                    array.AddString(assetTag);
                }
            }
            else
            {
                if (pbxElementDict != null)
                {
                    pbxElementDict.Remove("ASSET_TAGS");
                }
            }
            if (pbxElementDict == null || pbxElementDict.values.Count != 0)
            {
                return;
            }
            this.m_Properties.Remove("settings");
        }
Пример #2
0
 protected void SetPropertyList(string name, List <string> value)
 {
     if (value == null)
     {
         m_Properties.Remove(name);
     }
     else
     {
         var array = m_Properties.CreateArray(name);
         foreach (string val in value)
         {
             array.AddString(val);
         }
     }
 }
Пример #3
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 (!pbxElementArray.values.Any <PBXElement>((Func <PBXElement, bool>)(attr => attr is PBXElementString && attr.AsString() == attributeName)))
                {
                    pbxElementArray.AddString(attributeName);
                }
            }
            else if (pbxElementArray != null)
            {
                pbxElementArray.values.RemoveAll((Predicate <PBXElement>)(el => el is PBXElementString && el.AsString() == attributeName));
                if (pbxElementArray.values.Count == 0)
                {
                    settings.Remove("ATTRIBUTES");
                }
            }
            return(settings);
        }