Example #1
0
        /*
         * Allows the setting of target attributes in the project section such as Provisioning Style and Team ID for each target
         *
         * The Target Attributes are structured like so:
         * attributes = {
         *      TargetAttributes = {
         *          1D6058900D05DD3D006BFB54 = {
         *              DevelopmentTeam = Z6SFPV59E3;
         *              ProvisioningStyle = Manual;
         *          };
         *          5623C57217FDCB0800090B9E = {
         *              DevelopmentTeam = Z6SFPV59E3;
         *              ProvisioningStyle = Manual;
         *              TestTargetID = 1D6058900D05DD3D006BFB54;
         *          };
         *      };
         *  };
         */
        internal void SetTargetAttributes(string key, string value)
        {
            PBXElementDict properties = project.project.GetPropertiesRaw();
            PBXElementDict attributes;
            PBXElementDict targetAttributes;

            if (properties.Contains("attributes"))
            {
                attributes = properties["attributes"] as PBXElementDict;
            }
            else
            {
                attributes = properties.CreateDict("attributes");
            }

            if (attributes.Contains("TargetAttributes"))
            {
                targetAttributes = attributes["TargetAttributes"] as PBXElementDict;
            }
            else
            {
                targetAttributes = attributes.CreateDict("TargetAttributes");
            }

            foreach (KeyValuePair <string, PBXNativeTargetData> target in nativeTargets.GetEntries())
            {
                PBXElementDict targetAttributesRaw;
                if (targetAttributes.Contains(target.Key))
                {
                    targetAttributesRaw = targetAttributes[target.Key].AsDict();
                }
                else
                {
                    targetAttributesRaw = targetAttributes.CreateDict(target.Key);
                }
                targetAttributesRaw.SetString(key, value);
            }
            project.project.UpdateVars();
        }
Example #2
0
        internal void SetTargetAttributes(string key, string value)
        {
            PBXElementDict dict2;
            PBXElementDict dict3;
            PBXElementDict propertiesRaw = this.project.project.GetPropertiesRaw();

            if (propertiesRaw.Contains("attributes"))
            {
                dict2 = propertiesRaw["attributes"] as PBXElementDict;
            }
            else
            {
                dict2 = propertiesRaw.CreateDict("attributes");
            }
            if (dict2.Contains("TargetAttributes"))
            {
                dict3 = dict2["TargetAttributes"] as PBXElementDict;
            }
            else
            {
                dict3 = dict2.CreateDict("TargetAttributes");
            }
            foreach (KeyValuePair <string, PBXNativeTargetData> pair in this.nativeTargets.GetEntries())
            {
                PBXElementDict dict4;
                if (dict3.Contains(pair.Key))
                {
                    dict4 = dict3[pair.Key].AsDict();
                }
                else
                {
                    dict4 = dict3.CreateDict(pair.Key);
                }
                dict4.SetString(key, value);
            }
            this.project.project.UpdateVars();
        }