コード例 #1
0
        void ConfigureIOS()
        {
            var unified_targets = new List <UnifiedTarget> ();
            var tvos_targets    = new List <TVOSTarget> ();
            var watchos_targets = new List <WatchOSTarget> ();

            RootDirectory = Path.GetFullPath(RootDirectory).TrimEnd('/');

            if (AutoConf)
            {
                AutoConfigureIOS();
            }

            CreateBCLProjects();

            foreach (var proj in IOSTestProjects)
            {
                var file = proj.Path;
                if (!File.Exists(file))
                {
                    throw new FileNotFoundException(file);
                }

                var watchos = new WatchOSTarget()
                {
                    TemplateProjectPath = file,
                    Harness             = this,
                };
                watchos.Execute();
                watchos_targets.Add(watchos);

                var tvos = new TVOSTarget()
                {
                    TemplateProjectPath = file,
                    Harness             = this,
                };
                tvos.Execute();
                tvos_targets.Add(tvos);

                var unified = new UnifiedTarget()
                {
                    TemplateProjectPath = file,
                    Harness             = this,
                };
                unified.Execute();
                unified_targets.Add(unified);
            }

            SolutionGenerator.CreateSolution(this, watchos_targets, "watchos");
            SolutionGenerator.CreateSolution(this, tvos_targets, "tvos");
            MakefileGenerator.CreateMakefile(this, unified_targets, tvos_targets, watchos_targets);
        }
コード例 #2
0
ファイル: Harness.cs プロジェクト: ezhangle/xamarin-macios
        void ConfigureIOS()
        {
            var unified_targets = new List <UnifiedTarget> ();
            var tvos_targets    = new List <TVOSTarget> ();
            var watchos_targets = new List <WatchOSTarget> ();
            var today_targets   = new List <TodayExtensionTarget> ();

            RootDirectory = Path.GetFullPath(RootDirectory).TrimEnd('/');

            if (AutoConf)
            {
                AutoConfigureIOS();
            }

            foreach (var bclTestInfo in IOSTestProjects.Where(x => x.BCLInfo != null).Select(x => x.BCLInfo))
            {
                bclTestInfo.Convert();
            }

            foreach (var proj in IOSTestProjects)
            {
                var file = proj.Path;
                if (!File.Exists(file))
                {
                    throw new FileNotFoundException(file);
                }

                if (!proj.SkipwatchOSVariation)
                {
                    var watchos = new WatchOSTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    watchos.Execute();
                    watchos_targets.Add(watchos);
                }

                if (!proj.SkiptvOSVariation)
                {
                    var tvos = new TVOSTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    tvos.Execute();
                    tvos_targets.Add(tvos);
                }

                if (!proj.SkipiOSVariation)
                {
                    var unified = new UnifiedTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    unified.Execute();
                    unified_targets.Add(unified);

                    var today = new TodayExtensionTarget {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    today.Execute();
                    today_targets.Add(today);
                }
            }

            SolutionGenerator.CreateSolution(this, watchos_targets, "watchos");
            SolutionGenerator.CreateSolution(this, tvos_targets, "tvos");
            SolutionGenerator.CreateSolution(this, today_targets, "today");
            MakefileGenerator.CreateMakefile(this, unified_targets, tvos_targets, watchos_targets, today_targets);
        }
コード例 #3
0
        int ConfigureIOS()
        {
            var rv = 0;
            var unified_targets = new List <UnifiedTarget> ();
            var tvos_targets    = new List <TVOSTarget> ();
            var watchos_targets = new List <WatchOSTarget> ();
            var today_targets   = new List <TodayExtensionTarget> ();

            RootDirectory = Path.GetFullPath(RootDirectory).TrimEnd('/');

            if (AutoConf)
            {
                AutoConfigureIOS();
            }

            foreach (var bclTestInfo in IOSTestProjects.Where(x => x.BCLInfo != null).Select(x => x.BCLInfo))
            {
                bclTestInfo.Convert();
            }
            foreach (var monoNativeInfo in IOSTestProjects.Where(x => x.MonoNativeInfo != null).Select(x => x.MonoNativeInfo))
            {
                monoNativeInfo.Convert();
            }

            foreach (var proj in IOSTestProjects)
            {
                var file = proj.Path;

                if (proj.MonoNativeInfo != null)
                {
                    file = proj.MonoNativeInfo.TemplatePath;
                }

                if (!File.Exists(file))
                {
                    Console.WriteLine($"Can't find the project file {file}.");
                    rv = 1;
                    continue;
                }

                if (!proj.SkipwatchOSVariation)
                {
                    var watchos = new WatchOSTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    watchos.Execute();
                    watchos_targets.Add(watchos);
                }

                if (!proj.SkiptvOSVariation)
                {
                    var tvos = new TVOSTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    tvos.Execute();
                    tvos_targets.Add(tvos);
                }

                if (!proj.SkipiOSVariation)
                {
                    var unified = new UnifiedTarget()
                    {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    unified.Execute();
                    unified_targets.Add(unified);

                    var today = new TodayExtensionTarget {
                        TemplateProjectPath = file,
                        Harness             = this,
                        TestProject         = proj,
                    };
                    today.Execute();
                    today_targets.Add(today);
                }
            }

            SolutionGenerator.CreateSolution(this, watchos_targets, "watchos");
            SolutionGenerator.CreateSolution(this, tvos_targets, "tvos");
            SolutionGenerator.CreateSolution(this, today_targets, "today");
            MakefileGenerator.CreateMakefile(this, unified_targets, tvos_targets, watchos_targets, today_targets);

            return(rv);
        }