コード例 #1
0
        public bool Save()
        {
            if (string.IsNullOrEmpty(SavePath))
            {
                return(false);
            }

            PList plist = new PList();

            plist.Root.Add(TYPE_KEY, TYPE_VALUE);
            plist.Root.Add(VERSION_KEY, VERSION);
            plist.Root.Add(BUILD_PLATFORM_KEY, Platform.ToString());
            plist.Root.Add(INFO_PLIST_KEY, InfoPlistChanges);
            plist.Root.Add(APP_CONFIG_KEY, AppConfig);
            plist.Root.Add(APP_CONFIG_ENABLED_KEY, AppConfigEnabled);
            plist.Root.Add(MANUAL_ENTITLEMENTS, ManualEntitlements);
            plist.Root.Add(FRAMEWORKS_KEY, Frameworks.Serialize());
            plist.Root.Add(FILES_AND_FOLDERS_KEY, FilesAndFolders.Serialize());
            plist.Root.Add(BUILD_SETTINGS_KEY, BuildSettings.Serialize());
            plist.Root.Add(SIGNING_KEY, Signing.Serialize());
            plist.Root.Add(SCRIPTS_KEY, Scripts.Serialize());


            plist.Root.Add(CAPABILITIES_KEY, Capabilities.Serialize());
            bool saved = plist.Save(SavePath, true);

            if (saved)
            {
                IsDirty = false;
            }

            return(saved);
        }
コード例 #2
0
        /// <summary>
        /// Generate the script
        /// </summary>
        internal static void Generate(string snippetSourcePath, string frameworksFolder)
        {
            // Get latest framework folder
            Frameworks frameworks      = new Frameworks(frameworksFolder);
            string     frameworkFolder = frameworks.GetNewestVersion().Folder;

            List <TypeDefinition> list       = CollectExceptions(frameworkFolder);
            List <string>         namespaces = list.Select(x => x.Namespace).Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
            List <string>         lines      = new List <string>();

            foreach (string ns in namespaces)
            {
                lines.Add(string.Format(NsTemplate, ns));
            }

            foreach (TypeDefinition type in list)
            {
                lines.Add(string.Format(TypeTemplate, type.Namespace, type.FullName));
            }

            string allLines = string.Join(Environment.NewLine, lines);

            allLines = allLines.Substring(0, allLines.Length - 1); // strip last ','
            string script   = Template.Replace("$$$", allLines);
            string existing = File.Exists(snippetSourcePath) ? File.ReadAllText(snippetSourcePath) : string.Empty;

            if (script != existing)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(snippetSourcePath));
                File.WriteAllText(snippetSourcePath, script);
            }
        }
コード例 #3
0
ファイル: Program.cs プロジェクト: cwensley/xamarin-macios
        static int Fix(ApplePlatform platform, string output)
        {
            var frameworks = Frameworks.GetFrameworks(platform, false).Values.Where(v => !v.Unavailable);
            var sb         = new StringBuilder();

#if NET
            sb.AppendLine("#if NET");
#else
            sb.AppendLine("#if !NET");
#endif
            sb.AppendLine("namespace ObjCRuntime {");
            sb.AppendLine("\tpublic static partial class Constants {");
            foreach (var grouped in frameworks.GroupBy(v => v.Version))
            {
                sb.AppendLine($"\t\t// {platform} {grouped.Key}");
                foreach (var fw in grouped.OrderBy(v => v.Name))
                {
                    sb.AppendLine($"\t\tpublic const string {fw.Namespace}Library = \"{fw.LibraryPath}\";");
                }
                sb.AppendLine();
            }
            sb.AppendLine("\t}");
            sb.AppendLine("}");
#if NET
            sb.AppendLine("#endif // NET");
#else
            sb.AppendLine("#endif // !NET");
#endif

            File.WriteAllText(output, sb.ToString());
            return(0);
        }
コード例 #4
0
    public static Frameworks GetwatchOSFrameworks(bool is_simulator_build)
    {
        if (watch_frameworks == null)
        {
            watch_frameworks = new Frameworks {
                { "Accelerate", "Accelerate", 2 },
                // The CFNetwork framework is in the SDK, but there are no headers inside the framework, so don't enable yet.
                // { "CFNetwork", "CFNetwork", 2 },
                { "ClockKit", "ClockKit", 2 },
                { "Contacts", "Contacts", 2 },
                { "CoreAudio", "CoreAudio", 2 },
                { "CoreData", "CoreData", 2 },
                { "CoreFoundation", "CoreFoundation", 2 },
                { "CoreGraphics", "CoreGraphics", 2 },
                { "CoreLocation", "CoreLocation", 2 },
                { "CoreMotion", "CoreMotion", 2 },
                { "EventKit", "EventKit", 2 },
                { "Foundation", "Foundation", 2 },
                { "HealthKit", "HealthKit", 2 },
                { "HomeKit", "HomeKit", 2 },
                { "ImageIO", "ImageIO", 2 },
                { "MapKit", "MapKit", 2 },
                { "MobileCoreServices", "MobileCoreServices", 2 },
                { "PassKit", "PassKit", 2 },
                { "Security", "Security", 2 },
                { "UIKit", "UIKit", 2 },
                { "WatchConnectivity", "WatchConnectivity", 2 },
                { "WatchKit", "WatchKit", 2 },

                { "CoreText", "CoreText", 2, 2 },

                // AVFoundation was introduced in 3.0, but the simulator SDK was broken until 3.2.
                { "AVFoundation", "AVFoundation", 3, is_simulator_build ? 2 : 0 },
                { "CloudKit", "CloudKit", 3 },
                { "GameKit", "GameKit", new Version(3, 0), new Version(3, 2) /* No headers provided for watchOS/simulator until watchOS 3.2. */ },
                { "SceneKit", "SceneKit", 3 },
                { "SpriteKit", "SpriteKit", 3 },
                { "UserNotifications", "UserNotifications", 3 },
                { "Intents", "Intents", 3, 2 },

                { "CoreBluetooth", "CoreBluetooth", 4 },
                { "CoreML", "CoreML", 4 },
                { "CoreVideo", "CoreVideo", 4 },

                { "NaturalLanguage", "NaturalLanguage", 5 },
                { "MediaPlayer", "MediaPlayer", 5 },

                { "AuthenticationServices", "AuthenticationServices", 6 },
                { "Network", "Network", 6 },
                { "PushKit", "PushKit", 6 },
                { "SoundAnalysis", "SoundAnalysis", 6 },
                { "CoreMedia", "CoreMedia", 6 },
                { "StoreKit", "StoreKit", 6, 2 },

                { "Accessibility", "Accessibility", 7, 0 },
                { "UniformTypeIdentifiers", "UniformTypeIdentifiers", 7, 0 },
            };
        }
        return(watch_frameworks);
    }
コード例 #5
0
        public Method GetMethod(string className, string methodName, Frameworks framework, out Class @class, int overload)
        {
            @class = GetClass(className);
            if (@class == null)
            {
                return(null);
            }

            if (overload < 0)
            {
                return(null);
            }

            IEnumerable <Method> methodFinder = @class.Methods
                                                .Where(x => methodName.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase));

            if (framework == Frameworks.NotSet)
            {
                methodFinder = methodFinder.OrderByDescending(x => x.Frameworks);
            }
            else
            {
                methodFinder = methodFinder.Where(x => x.Frameworks.HasFlag(framework));
            }

            if (overload > 0)
            {
                methodFinder = methodFinder.Skip(overload);
            }

            return(methodFinder.FirstOrDefault());
        }
コード例 #6
0
        public void Execute(ApplicationTypes type, Frameworks framework, string targetExe, string arguments, string rootDirectory, string workingDirectory, string url)
        {
            var info = new DirectoryInfo(rootDirectory);

            if (!info.Exists)
            {
                throw new DirectoryNotFoundException("Directory not found");
            }

            var msg = new ExecuteMessage()
            {
                Command          = Commands.Execute,
                ApplicationType  = type,
                Framework        = framework,
                Executable       = targetExe,
                Arguments        = arguments,
                WorkingDirectory = workingDirectory,
                Url       = url,
                RootPath  = rootDirectory,
                IsLocal   = communication.IsLocal,
                Debug     = true,
                LocalPath = rootDirectory
            };

            if (!communication.IsLocal)
            {
                msg.Files.AddFolder(rootDirectory);
            }

            communication.RootPath = rootDirectory;
            communication.Send(msg);
        }
コード例 #7
0
        public IEnumerable <FeatureTable> GetTables()
        {
            var diFrameworks = Frameworks.List().ToArray();
            var packages     = new Dictionary <IFrameworkAdapter, IPackage>();

            foreach (var diFramework in diFrameworks)
            {
                // special case, needed for MEF at least because it is a part of .NET framework:
                if (diFramework.FrameworkPackageId == null)
                {
                    continue;
                }

                var package = packageRepository.FindPackagesById(diFramework.FrameworkPackageId).SingleOrDefault();
                if (package == null)
                {
                    throw new InvalidOperationException("Package for '" + diFramework.FrameworkName + "' was not found in '" + this.packageRepository.Source + "'.");
                }

                packages.Add(diFramework, package);
            }

            yield return(GetGeneralInformation(diFrameworks, packages));

            yield return(GetNetVersionSupport(diFrameworks, packages));
        }
コード例 #8
0
        //
        // GET: /Docs/
        public ActionResult Method(string className, string methodName, Frameworks framework = Frameworks.NotSet, int o = 0)
        {
            Models.Class @class;

            var formattedMethodName = methodName.Replace('(', '<').Replace(')', '>');

            var method = _repo.GetMethod(className, formattedMethodName, framework, out @class, o);

            if (method == null)
            {
                return(HttpNotFound());
            }

            this.SetMetaDescription("The syntax and description of the {0}.{1} method.", @class.Name, formattedMethodName);
            this.AddMetaKeywords("Method", @class.Name, method.Name);

            var viewModel = new Method()
            {
                Namespace         = @class.Namespace,
                Class             = @class.Name,
                Name              = method.Name,
                Arguments         = method.Arguments,
                IsStatic          = method.IsStatic,
                IsExtensionMethod = method.IsExtensionMethod,
                ReturnType        = method.ReturnType,
                Remarks           = method.Remarks,
                Description       = method.Description,
                Examples          = method.Examples,
                ReturnDescription = method.ReturnDescription,
                Frameworks        = method.Frameworks,
                HasParamsArgument = method.HasParamsArgument
            };

            return(View(viewModel));
        }
コード例 #9
0
        public IEnumerable <FeatureTable> GetTables()
        {
            var testRuns   = this.runner.RunAllTests(typeof(BasicTests).Assembly).ToDictionary(r => new { Test = r.Method, r.FrameworkType });
            var testGroups = testRuns.Keys
                             .Select(k => k.Test)
                             .Distinct()
                             .GroupBy(m => m.DeclaringType)
                             .OrderBy(g => this.GetDisplayOrder(g.Key))
                             .ToArray();

            foreach (var group in testGroups)
            {
                var features = group.ToDictionary(m => m, this.ConvertToFeature);
                var table    = new FeatureTable(AttributeHelper.GetDisplayName(group.Key), Frameworks.List(), features.Values)
                {
                    Description = this.GetDescription(@group.Key),
                    Scoring     = AttributeHelper.GetScoring(@group.Key)
                };

                foreach (var test in group.OrderBy(this.GetDisplayOrder))
                {
                    foreach (var framework in Frameworks.List())
                    {
                        var cell = table[framework, test];
                        var run  = testRuns[new { Test = test, FrameworkType = framework.GetType() }];

                        ApplyRunResultToCell(cell, run);
                    }
                }

                yield return(table);
            }
        }
コード例 #10
0
        public ActionResult Property(string className, string propertyName, Frameworks framework = Frameworks.NotSet)
        {
            Models.Class @class;

            var property = _repo.GetProperty(className, propertyName, framework, out @class);

            if (property == null)
            {
                return(HttpNotFound());
            }

            this.SetMetaDescription("The syntax and description of the {0}.{1} property.", @class.Name, property.Name);
            this.AddMetaKeywords("Property", @class.Name, property.Name);

            var viewModel = new Property()
            {
                Namespace            = @class.Namespace,
                Class                = @class.Name,
                Name                 = property.Name,
                IsStatic             = property.IsStatic,
                ValueType            = property.ValueType,
                Remarks              = property.Remarks,
                Description          = property.Description,
                Examples             = property.Examples,
                ValueTypeDescription = property.ValueTypeDescription,
                Frameworks           = property.Frameworks,
                Accessors            = property.Accessors
            };

            return(View(viewModel));
        }
            public ProgrammeLists(IEnumerable <ITrainingProgramme> frameworks, IEnumerable <ITrainingProgramme> standards)
            {
                Frameworks = ToListByTitle(frameworks);
                Standards  = ToListByTitle(standards);

                AllProgrammes = ToListByTitle(Frameworks.Union(Standards));
            }
コード例 #12
0
        //
        // GET: /Docs/
        public ActionResult Method(string className, string methodName, Frameworks framework = Frameworks.NotSet, int o = 0)
        {
            Models.Class @class;

            var formattedMethodName = methodName.Replace('(', '<').Replace(')', '>');

            var method = _repo.GetMethod(className, formattedMethodName, framework, out @class, o);
            if (method == null) return HttpNotFound();

            this.SetMetaDescription("The syntax and description of the {0}.{1} method.", @class.Name, formattedMethodName);
            this.AddMetaKeywords("Method", @class.Name, method.Name);

            var viewModel = new Method()
            {
                Namespace = @class.Namespace,
                Class = @class.Name,
                Name = method.Name,
                Arguments = method.Arguments,
                IsStatic = method.IsStatic,
                IsExtensionMethod = method.IsExtensionMethod,
                ReturnType = method.ReturnType,
                Remarks = method.Remarks,
                Description = method.Description,
                Examples = method.Examples,
                ReturnDescription = method.ReturnDescription,
                Frameworks = method.Frameworks,
                HasParamsArgument = method.HasParamsArgument
            };

            return View(viewModel);
        }
コード例 #13
0
        /// <summary>
        /// Generate the script
        /// </summary>
        internal static void Generate(string snippetSourcePath, string frameworksFolder)
        {
            // Get latest framework folder
            Frameworks frameworks = new Frameworks(frameworksFolder);
            string frameworkFolder = frameworks.GetNewestVersion().Folder;

            List<TypeDefinition> list = CollectExceptions(frameworkFolder);
            List<string> namespaces = list.Select(x => x.Namespace).Where(x => !string.IsNullOrEmpty(x)).Distinct().ToList();
            List<string> lines = new List<string>();

            foreach (string ns in namespaces)
            {
                lines.Add(string.Format(NsTemplate, ns));
            }

            foreach (TypeDefinition type in list)
            {
                lines.Add(string.Format(TypeTemplate, type.Namespace, type.FullName));
            }

            string allLines = string.Join(Environment.NewLine, lines);
            allLines = allLines.Substring(0, allLines.Length - 1); // strip last ','
            string script = Template.Replace("$$$", allLines);
            string existing = File.Exists(snippetSourcePath) ? File.ReadAllText(snippetSourcePath) : string.Empty;
            if (script != existing)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(snippetSourcePath));
                File.WriteAllText(snippetSourcePath, script);
            }
        }
コード例 #14
0
        private void cbFrameworks_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <Frameworks> frms = Frameworks.GenDataFrameworks();
            var frms_item          = frms[cbFrameworks.SelectedIndex];

            lbCSSLinks.Items.Clear();
            lbJSLinks.Items.Clear();

            if (cbFrameworks.Items.Count > 0)
            {
                if (lbCSSLinks.Items.Count == 0)
                {
                    for (var xlc = 0; xlc < frms_item.CSSUrl.Count; xlc++)
                    {
                        lbCSSLinks.Items.Add(frms_item.CSSUrl[xlc]);
                    }
                }

                if (lbJSLinks.Items.Count == 0)
                {
                    for (var xlj = 0; xlj < frms_item.JSUrl.Count; xlj++)
                    {
                        lbJSLinks.Items.Add(frms_item.JSUrl[xlj]);
                    }
                }
            }

            LoadContent();
        }
コード例 #15
0
        void AddListFrameworks()
        {
            if (cbFrameworks.Items.Count == 0)
            {
                List <Frameworks> frms = Frameworks.GenDataFrameworks();

                for (var x = 0; x < frms.Count; x++)
                {
                    cbFrameworks.Items.Add(frms[x].Title);
                }

                if (cbFrameworks.Items.Count > 0)
                {
                    cbFrameworks.SelectedIndex = 0;

                    if (lbCSSLinks.Items.Count == 0)
                    {
                        for (var xlc = 0; xlc < frms[cbFrameworks.SelectedIndex].CSSUrl.Count; xlc++)
                        {
                            lbCSSLinks.Items.Add(frms[cbFrameworks.SelectedIndex].CSSUrl[xlc]);
                        }
                    }

                    if (lbJSLinks.Items.Count == 0)
                    {
                        for (var xlj = 0; xlj < frms[cbFrameworks.SelectedIndex].JSUrl.Count; xlj++)
                        {
                            lbJSLinks.Items.Add(frms[cbFrameworks.SelectedIndex].JSUrl[xlj]);
                        }
                    }
                }
            }
        }
コード例 #16
0
        bool LoadFile(string pathToFile)
        {
            if (!File.Exists(pathToFile))
            {
                Debug.LogError("EgoXproject: Change file does not exist: " + pathToFile);
                return(false);
            }

            SavePath = pathToFile;
            PList p = new PList();

            if (!p.Load(SavePath))
            {
                return(false);
            }

            if (!Validate(p))
            {
                return(false);
            }

            //set the platform. if non specified will default to ios
            BuildPlatform platform;

            if (p.Root.EnumValue(BUILD_PLATFORM_KEY, out platform))
            {
                Platform = platform;
            }
            else
            {
                Platform = BuildPlatform.iOS;
            }

            //reset everything
            Frameworks.Clear();
            FilesAndFolders.Clear();
            BuildSettings.Clear();
            Scripts.Clear();
            Signing.Clear();
            Capabilities.Clear();
            //load everything
            InfoPlistChanges = p.Root.DictionaryValue(INFO_PLIST_KEY).Copy() as PListDictionary;
            AppConfig        = p.Root.DictionaryValue(APP_CONFIG_KEY) != null?p.Root.DictionaryValue(APP_CONFIG_KEY).Copy() as PListDictionary : new PListDictionary();

            AppConfigEnabled = p.Root.ArrayValue(APP_CONFIG_ENABLED_KEY) != null?p.Root.ArrayValue(APP_CONFIG_ENABLED_KEY).Copy() as PListArray : new PListArray();

            ManualEntitlements = p.Root.DictionaryValue(MANUAL_ENTITLEMENTS) != null?p.Root.DictionaryValue(MANUAL_ENTITLEMENTS).Copy() as PListDictionary : new PListDictionary();

            LoadFrameworks(p.Root.DictionaryValue(FRAMEWORKS_KEY));
            LoadFilesAndFolders(p.Root.DictionaryValue(FILES_AND_FOLDERS_KEY));
            LoadScripts(p.Root.ArrayValue(SCRIPTS_KEY));
            LoadBuildSettings(p.Root.ArrayValue(BUILD_SETTINGS_KEY));
            LoadSigning(p.Root.DictionaryValue(SIGNING_KEY));
            LoadCapabilities(p.Root.DictionaryValue(CAPABILITIES_KEY));


            IsDirty = false;
            return(true);
        }
コード例 #17
0
        public void AddPackageDownloadToFramework(string packageFramework, params SimpleTestPackageContext[] packages)
        {
            var framework = Frameworks
                            .Where(f => f.Framework == NuGetFramework.Parse(packageFramework))
                            .First();

            framework.PackageDownloads.AddRange(packages);
        }
コード例 #18
0
 public static Frameworks GetiOSFrameworks(bool is_simulator_build)
 {
     if (ios_frameworks == null)
     {
         ios_frameworks = CreateiOSFrameworks(is_simulator_build);
     }
     return(ios_frameworks);
 }
コード例 #19
0
 public bool HasChanges()
 {
     return(InfoPlistChanges.Count > 0 ||
            Frameworks.HasChanges() ||
            FilesAndFolders.HasChanges() ||
            BuildSettings.HasChanges() ||
            Scripts.HasChanges() ||
            Signing.HasChanges() ||
            Capabilities.HasChanges());
 }
コード例 #20
0
        public override bool Execute()
        {
            string assemblyFileName = GetAssemblyFileName();

            TargetPaths = Frameworks.NullAsEmpty()
                          .Select(framework => GetTargetPath(framework, assemblyFileName))
                          .ToArray();

            return(true);
        }
コード例 #21
0
        public static Frameworks GetFramework(
            string id = null)
        {
            var retval = new Frameworks
            {
                Id = id ?? Guid.NewGuid().ToString()
            };

            Verifier.Verify(retval);
            return(retval);
        }
コード例 #22
0
        public override async Task<IEnumerable<PackageDependencyInfo>> ResolvePackages(IEnumerable<string> packageIds, Frameworks.NuGetFramework projectFramework, bool includePrerelease, CancellationToken token)
        {
            if (packageIds == null)
            {
                throw new ArgumentNullException("packageIds");
            }

            IEnumerable<PackageIdentity> packages = packageIds.Select(s => new PackageIdentity(s, null));

            return await ResolvePackages(packages, projectFramework, includePrerelease, token);
        }
コード例 #23
0
        internal StrideVersionViewModel(LauncherViewModel launcher, NugetStore store, NugetLocalPackage localPackage, string packageId, int major, int minor)
            : base(launcher, store, localPackage)
        {
            PackageSimpleName  = packageId.Replace(".GameStudio", string.Empty);
            Major              = major;
            Minor              = minor;
            SetAsActiveCommand = new AnonymousCommand(ServiceProvider, () => launcher.ActiveVersion = this);
            // Update status if the user changes whether to display beta versions.
            launcher.PropertyChanged += (s, e) => { if (e.PropertyName == nameof(LauncherViewModel.ShowBetaVersions))
                                                    {
                                                        UpdateStatus();
                                                    }
            };

            if (LocalPackage != null && InstallPath != null)
            {
                var libDirectory = Path.Combine(InstallPath, "lib");
                var frameworks   = Directory.EnumerateDirectories(libDirectory);
                foreach (var frameworkPath in frameworks)
                {
                    var frameworkFolder = new DirectoryInfo(frameworkPath).Name;
                    if (File.Exists(Path.Combine(frameworkPath, "Stride.GameStudio.exe")) ||
                        File.Exists(Path.Combine(frameworkPath, "Xenko.GameStudio.exe")))
                    {
                        Frameworks.Add(frameworkFolder);
                    }
                }

                if (Frameworks.Count > 0)
                {
                    try
                    {
                        // If preferred framework exists in our list, select it
                        var preferredFramework = LauncherSettings.PreferredFramework;
                        if (Frameworks.Contains(preferredFramework))
                        {
                            SelectedFramework = preferredFramework;
                        }
                        else
                        {
                            // Otherwise, try to find a framework of the same kind (.NET Core or .NET Framework)
                            var nugetFramework = NuGetFramework.ParseFolder(preferredFramework);
                            SelectedFramework =
                                Frameworks.FirstOrDefault(x => NuGetFramework.ParseFolder(preferredFramework).Framework == nugetFramework.Framework)
                                ?? Frameworks.First(); // otherwise fallback to first choice
                        }
                    }
                    catch
                    {
                        SelectedFramework = Frameworks.First();
                    }
                }
            }
        }
コード例 #24
0
        public static string GetMonoXsp(Frameworks framework = Frameworks.Net4)
        {
            var p = Environment.OSVersion.Platform;

            if (p == PlatformID.Unix || p == PlatformID.MacOSX || p == PlatFormIDUnixUnderNET1)
            {
                return(framework == Frameworks.Net4 ? "xsp4" : "xsp2");
            }

            return(Path.Combine(GetMonoRootPathWindows(), framework == Frameworks.Net4 ? @"bin\xsp4.bat" : @"bin\xsp2.bat"));
        }
コード例 #25
0
 public bool HasChanges()
 {
     return(AppConfigEnabled.Count > 0 ||
            InfoPlistChanges.Count > 0 ||
            ManualEntitlements.Count > 0 ||
            Frameworks.HasChanges() ||
            FilesAndFolders.HasChanges() ||
            BuildSettings.HasChanges() ||
            Scripts.HasChanges() ||
            Signing.HasChanges() ||
            Capabilities.HasChanges());
 }
コード例 #26
0
        public void ComputeLinkerFlags()
        {
            foreach (var a in Assemblies)
            {
                a.ComputeLinkerFlags();
            }

            if (App.Platform != ApplePlatform.WatchOS && App.Platform != ApplePlatform.TVOS)
            {
                Frameworks.Add("CFNetwork");                  // required by xamarin_start_wwan
            }
        }
コード例 #27
0
 public void Clear()
 {
     Apprenticeships.Clear();
     Courses.Clear();
     Frameworks.Clear();
     ProgTypes.Clear();
     Providers.Clear();
     SectorSubjectAreaTier1s.Clear();
     SectorSubjectAreaTier2s.Clear();
     Standards.Clear();
     StandardSectorCodes.Clear();
     Venues.Clear();
 }
コード例 #28
0
        Frameworks GetFrameworks()
        {
#if __IOS__
            return(Frameworks.GetiOSFrameworks(app));
#elif __TVOS__
            return(Frameworks.TVOSFrameworks);
#elif __WATCHOS__
            return(Frameworks.GetwatchOSFrameworks(app));
#elif __MACOS__
            return(Frameworks.MacFrameworks);
#else
            throw new NotImplementedException();
#endif
        }
コード例 #29
0
        public void Merge(XcodeChangeFile other)
        {
            if (Platform != other.Platform)
            {
                Debug.LogError("Cannot merge change files. Platforms do not match");
                return;
            }

            MergePListEntries(InfoPlistChanges, other.InfoPlistChanges);
            Frameworks.Merge(other.Frameworks);
            FilesAndFolders.Merge(other.FilesAndFolders);
            BuildSettings.Merge(other.BuildSettings);
            Scripts.Merge(other.Scripts);
            Signing.Merge(other.Signing);
            Capabilities.Merge(other.Capabilities);
        }
コード例 #30
0
        Frameworks GetFrameworks()
        {
#if __MACCATALYST__
            return(Frameworks.GetMacCatalystFrameworks());
#elif __IOS__
            return(Frameworks.GetiOSFrameworks(app.IsSimulatorBuild));
#elif __TVOS__
            return(Frameworks.TVOSFrameworks);
#elif __WATCHOS__
            return(Frameworks.GetwatchOSFrameworks(app.IsSimulatorBuild));
#elif __MACOS__
            return(Frameworks.MacFrameworks);
#else
            throw new NotImplementedException();
#endif
        }
コード例 #31
0
        protected void UpdateFrameworks()
        {
            Frameworks.Clear();
            if (LocalPackage != null && InstallPath != null)
            {
                foreach (var toplevelFolder in new[] { "tools", "lib" })
                {
                    var libDirectory = Path.Combine(InstallPath, toplevelFolder);
                    var frameworks   = Directory.EnumerateDirectories(libDirectory);
                    foreach (var frameworkPath in frameworks)
                    {
                        var frameworkFolder = new DirectoryInfo(frameworkPath).Name;
                        if (File.Exists(Path.Combine(frameworkPath, "Stride.GameStudio.exe")) ||
                            File.Exists(Path.Combine(frameworkPath, "Xenko.GameStudio.exe")))
                        {
                            Frameworks.Add(frameworkFolder);
                        }
                    }
                }

                if (Frameworks.Count > 0)
                {
                    try
                    {
                        // If preferred framework exists in our list, select it
                        var preferredFramework = LauncherSettings.PreferredFramework;
                        if (Frameworks.Contains(preferredFramework))
                        {
                            SelectedFramework = preferredFramework;
                        }
                        else
                        {
                            // Otherwise, try to find a framework of the same kind (.NET Core or .NET Framework)
                            var nugetFramework = NuGetFramework.ParseFolder(preferredFramework);
                            SelectedFramework =
                                Frameworks.FirstOrDefault(x => NuGetFramework.ParseFolder(preferredFramework).Framework == nugetFramework.Framework)
                                ?? Frameworks.First(); // otherwise fallback to first choice
                        }
                    }
                    catch
                    {
                        SelectedFramework = Frameworks.First();
                    }
                }
            }
        }
コード例 #32
0
ファイル: Frameworks.cs プロジェクト: pm64/xamarin-macios
    public static Frameworks GetwatchOSFrameworks(Application app)
    {
        if (watch_frameworks == null)
        {
            watch_frameworks = new Frameworks {
                { "Accelerate", "Accelerate", 2 },
                // The CFNetwork framework is in the SDK, but there are no headers inside the framework, so don't enable yet.
                // { "CFNetwork", "CFNetwork", 2 },
                { "ClockKit", "ClockKit", 2 },
                { "Contacts", "Contacts", 2 },
                { "CoreData", "CoreData", 2 },
                { "CoreFoundation", "CoreFoundation", 2 },
                { "CoreGraphics", "CoreGraphics", 2 },
                { "CoreLocation", "CoreLocation", 2 },
                { "CoreMotion", "CoreMotion", 2 },
                { "EventKit", "EventKit", 2 },
                { "Foundation", "Foundation", 2 },
                { "HealthKit", "HealthKit", 2 },
                { "HomeKit", "HomeKit", 2 },
                { "ImageIO", "ImageIO", 2 },
                { "MapKit", "MapKit", 2 },
                { "MobileCoreServices", "MobileCoreServices", 2 },
                { "PassKit", "PassKit", 2 },
                { "Security", "Security", 2 },
                { "UIKit", "UIKit", 2 },
                { "WatchConnectivity", "WatchConnectivity", 2 },
                { "WatchKit", "WatchKit", 2 },

                { "CoreText", "CoreText", 2, 2 },

                // AVFoundation was introduced in 3.0, but the simulator SDK was broken until 3.2.
                { "AVFoundation", "AVFoundation", 3, app.IsSimulatorBuild ? 2 : 0 },
                { "CloudKit", "CloudKit", 3 },
                { "GameKit", "GameKit", 3 },
                { "SceneKit", "SceneKit", 3 },
                { "SpriteKit", "SpriteKit", 3 },
                { "UserNotifications", "UserNotifications", 3 },
                { "Intents", "Intents", 3, 2 },

                { "CoreBluetooth", "CoreBluetooth", 4 },
                { "CoreML", "CoreML", 4 },
                { "CoreVideo", "CoreVideo", 4 },
            };
        }
        return(watch_frameworks);
    }
コード例 #33
0
ファイル: SystemIdSources.cs プロジェクト: Xtremrules/dot42
        /// <summary>
        /// Generate the script
        /// </summary>
        internal static void Generate(string systemIdSourcePath, string frameworksFolder)
        {
            // Get latest framework folder
            Frameworks frameworks = new Frameworks(frameworksFolder);
            string frameworkFolder = frameworks.GetNewestVersion().Folder;

            List<string> list = CollectIds(frameworkFolder);
            string ids = string.Join(",\r\n", list.Select(x => string.Format("            \"{0}\"", x)));

            string script = Template.Replace("$$$", ids);
            string existing = File.Exists(systemIdSourcePath) ? File.ReadAllText(systemIdSourcePath) : string.Empty;
            if (script != existing)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(systemIdSourcePath));
                File.WriteAllText(systemIdSourcePath, script);
            }
        }
コード例 #34
0
        /// <summary>
        /// Generate the script
        /// </summary>
        internal static void Generate(string systemIdSourcePath, string frameworksFolder)
        {
            // Get latest framework folder
            Frameworks frameworks      = new Frameworks(frameworksFolder);
            string     frameworkFolder = frameworks.GetNewestVersion().Folder;

            List <string> list = CollectIds(frameworkFolder);
            string        ids  = string.Join(",\r\n", list.Select(x => string.Format("            \"{0}\"", x)));

            string script   = Template.Replace("$$$", ids);
            string existing = File.Exists(systemIdSourcePath) ? File.ReadAllText(systemIdSourcePath) : string.Empty;

            if (script != existing)
            {
                Directory.CreateDirectory(Path.GetDirectoryName(systemIdSourcePath));
                File.WriteAllText(systemIdSourcePath, script);
            }
        }
コード例 #35
0
        public Method GetMethod(string className, string methodName, Frameworks framework, out Class @class, int overload)
        {
            @class = GetClass(className);
            if (@class == null) return null;

            if (overload < 0) return null;

            IEnumerable<Method> methodFinder = @class.Methods
                .Where(x => methodName.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase));

            if (framework == Frameworks.NotSet)
            {
                methodFinder = methodFinder.OrderByDescending(x => x.Frameworks);
            }
            else
            {
                methodFinder = methodFinder.Where(x => x.Frameworks.HasFlag(framework));
            }

            if( overload > 0 ) methodFinder = methodFinder.Skip(overload);

            return methodFinder.FirstOrDefault();
        }
コード例 #36
0
        public ActionResult Property(string className, string propertyName, Frameworks framework = Frameworks.NotSet)
        {
            Models.Class @class;

            var property = _repo.GetProperty(className, propertyName, framework, out @class);
            if (property == null) return HttpNotFound();

            this.SetMetaDescription("The syntax and description of the {0}.{1} property.", @class.Name, property.Name);
            this.AddMetaKeywords("Property", @class.Name, property.Name);

            var viewModel = new Property()
            {
                Namespace = @class.Namespace,
                Class = @class.Name,
                Name = property.Name,
                IsStatic = property.IsStatic,
                ValueType = property.ValueType,
                Remarks = property.Remarks,
                Description = property.Description,
                Examples = property.Examples,
                ValueTypeDescription = property.ValueTypeDescription,
                Frameworks = property.Frameworks,
                Accessors = property.Accessors
            };

            return View(viewModel);
        }
コード例 #37
0
        public Property GetProperty(string className, string propertyName, Frameworks framework, out Class @class)
        {
            @class = GetClass(className);
            if (@class == null) return null;

            IEnumerable<Property> propertyFinder = @class.Properties
                .Where(x => propertyName.Equals(x.Name, StringComparison.InvariantCultureIgnoreCase));

            if (framework == Frameworks.NotSet)
            {
                propertyFinder = propertyFinder.OrderByDescending(x => x.Frameworks);
            }
            else
            {
                propertyFinder = propertyFinder.Where(x => x.Frameworks.HasFlag(framework));
            }

            return propertyFinder.FirstOrDefault();
        }