Exemplo n.º 1
0
        DTSdkSettings LoadSdkSettings(MacOSXSdkVersion sdk)
        {
            string filename = GetSdkPlistFilename(sdk.ToString());

            if (!File.Exists(filename))
            {
                return(null);
            }

            var plist    = PDictionary.FromFile(filename);
            var settings = new DTSdkSettings();

            settings.CanonicalName = plist.GetString("CanonicalName").Value;

            var props = plist.Get <PDictionary> ("DefaultProperties");

            PString gcc;

            if (!props.TryGetValue <PString> ("GCC_VERSION", out gcc))
            {
                settings.DTCompiler = "com.apple.compilers.llvm.clang.1_0";
            }
            else
            {
                settings.DTCompiler = gcc.Value;
            }

            settings.DTSDKBuild = GrabRootString(Path.Combine(DeveloperRoot, SYSTEM_VERSION_PLIST), "ProductBuildVersion");

            return(settings);
        }
Exemplo n.º 2
0
        public static DTSdkSettings GetSdkSettings(IPhoneSdkVersion sdk)
        {
            DTSdkSettings settings;

            if (sdkSettingsCache.TryGetValue(sdk.ToString(), out settings))
            {
                return(settings);
            }

            settings = new DTSdkSettings();
            var doc = new PlistDocument();

            doc.LoadFromXmlFile(GetSdkPlistFilename(sdk.ToString()));
            var dict = (PlistDictionary)doc.Root;

            settings.AlternateSDK  = ((PlistString)dict["AlternateSDK"]).Value;
            settings.CanonicalName = ((PlistString)dict["CanonicalName"]).Value;
            var props = (PlistDictionary)dict["DefaultProperties"];

            settings.DTCompiler = ((PlistString)props["GCC_VERSION"]).Value;

            var sdkPath = GetSdkPath(sdk.ToString());

            settings.DTSDKBuild = GrabRootString(sdkPath + SYSTEM_VERSION_PLIST, "ProductBuildVersion");

            sdkSettingsCache[sdk.ToString()] = settings;
            return(settings);
        }
Exemplo n.º 3
0
        static DTSdkSettings LoadSdkSettings(IPhoneSdkVersion sdk, bool isSim)
        {
            var settings = new DTSdkSettings();
            var doc      = new PlistDocument();

            doc.LoadFromXmlFile(GetSdkPlistFilename(sdk.ToString(), isSim));
            var dict = (PlistDictionary)doc.Root;

            if (!isSim)
            {
                settings.AlternateSDK = ((PlistString)dict["AlternateSDK"]).Value;
            }

            settings.CanonicalName = ((PlistString)dict["CanonicalName"]).Value;
            var props = (PlistDictionary)dict["DefaultProperties"];

            settings.DTCompiler = ((PlistString)props["GCC_VERSION"]).Value;

            TargetDevice deviceFamilies = TargetDevice.NotSet;
            PlistArray   deviceFamiliesArr;

            if ((deviceFamiliesArr = props.TryGetValue("SUPPORTED_DEVICE_FAMILIES") as PlistArray) != null)
            {
                foreach (var v in deviceFamiliesArr)
                {
                    var s = v as PlistString;
                    int i;
                    if (s != null && int.TryParse(s.Value, out i))
                    {
                        deviceFamilies |= (TargetDevice)i;
                    }
                }
            }
            settings.DeviceFamilies = deviceFamilies;

            var sdkPath = GetSdkPath(sdk.ToString(), isSim);

            settings.DTSDKBuild = GrabRootString(sdkPath + SYSTEM_VERSION_PLIST, "ProductBuildVersion");

            return(settings);
        }
Exemplo n.º 4
0
		public static DTSdkSettings GetSdkSettings (IPhoneSdkVersion sdk)
		{
			DTSdkSettings settings;
			if (sdkSettingsCache.TryGetValue (sdk.ToString (), out settings))
				return settings;
			
			settings = new DTSdkSettings ();
			var doc = new PlistDocument ();
			doc.LoadFromXmlFile (GetSdkPlistFilename (sdk.ToString ()));
			var dict = (PlistDictionary) doc.Root;
			
			settings.AlternateSDK = ((PlistString)dict["AlternateSDK"]).Value;
			settings.CanonicalName = ((PlistString)dict["CanonicalName"]).Value;
			var props = (PlistDictionary) dict["DefaultProperties"];
			settings.DTCompiler = ((PlistString)props["GCC_VERSION"]).Value;
			
			var sdkPath = GetSdkPath (sdk.ToString ());
			var file = sdkPath + "/System/Library/CoreServices/SystemVersion.plist";
			settings.DTPlatformBuild = GrabRootString (file, "ProductBuildVersion");
			
			sdkSettingsCache[sdk.ToString ()] = settings;
			return settings;
		}