示例#1
0
        /// <summary>
        /// Determine whether the target SDK needs to be updated based upon pod
        /// dependencies.
        /// </summary>
        /// <returns>Key value pair of minimum SDK version (key) and
        /// a list of pod names that require it (value) if the currently
        /// selected target SDK version does not satify pod requirements, the list
        /// (value) is null otherwise.</returns>
        private static KeyValuePair <int, List <string> > TargetSdkNeedsUpdate()
        {
            var kvpair            = new KeyValuePair <int, List <string> >(0, null);
            var podListsByVersion = Pod.BucketByMinSdkVersion(pods.Values);

            if (podListsByVersion.Count == 0)
            {
                return(kvpair);
            }
            KeyValuePair <int, List <string> > minVersionAndPodName = kvpair;

            foreach (var versionAndPodList in podListsByVersion)
            {
                minVersionAndPodName = versionAndPodList;
                break;
            }
            int currentVersion = TargetSdkVersion;

            if (currentVersion >= minVersionAndPodName.Key)
            {
                return(kvpair);
            }
            return(minVersionAndPodName);
        }