コード例 #1
0
        public void Cycle()
        {
            var platformProvider = new PlatformsProvider();

            var platformFactory = platformProvider.Platforms.FirstOrDefault(
                x => x.PlatformType == MockPlatformFactory.MockPlatform &&
                x.ToolchainType == MockPlatformFactory.MockToolchain &&
                x.ArchitectureType == ArchitectureType.X64);

            var profile = Profile.Parse("{}");

            var platform = platformFactory.CreatePlatform(profile);

            var toolchain = platformFactory.CreateToolchain(profile);

            var targetTuple = new TargetTuple(
                platformFactory.PlatformType,
                platformFactory.ArchitectureType,
                platformFactory.ToolchainType,
                ConfigurationType.Debug,
                ConfigurationFlavour.None);

            var solution = new SampleSolution();

            var resolved = new ResolvedSolution(solution, targetTuple);

            Assert.ThrowsException <ResolvingException>(() =>
            {
                resolved.Configure();

                resolved.Resolve();
            });
        }
コード例 #2
0
        public void SolutionResolving()
        {
            var solution    = new SampleSolution();
            var targetTuple = new TargetTuple(
                PlatformType.Windows,
                ArchitectureType.X64,
                ToolchainType.MSVC,
                ConfigurationType.Debug,
                ConfigurationFlavour.None);

            var resolved = new ResolvedSolution(solution, targetTuple);

            resolved.Resolve();
        }
コード例 #3
0
        private int Run()
        {
            Debug.Assert(this.m_ConfigurationTypes != null);
            Debug.Assert(this.m_PlatformFactories != null);
            Debug.Assert(this.m_Architectures != null);
            Debug.Assert(this.m_Solutions != null);

            this.DumpProviders();

            var platformToolchains = this.m_PlatformFactories
                                     .Select(x => new FactoryContext(x, this.m_Profile));

            foreach (var solution in this.m_Solutions)
            {
                var evaluated = platformToolchains.Select(context =>
                {
                    var resolvedSolutions = m_Configurations.Select(configuration =>
                    {
                        var targetTuple = new TargetTuple(
                            context.Factory.PlatformType,
                            context.Factory.ArchitectureType,
                            context.Factory.ToolchainType,
                            configuration.Type,
                            configuration.Flavour);

                        var result = new ResolvedSolution(solution, targetTuple);
                        result.Configure();
                        result.Resolve();
                        return(result);
                    }).ToArray();

                    return(new EvaluatedSolution(
                               context.Platform,
                               context.Toolchain,
                               solution,
                               this.m_Profile,
                               resolvedSolutions));
                }).ToArray();

                this.m_Generator.Generate(
                    this.m_Options.OutputPath,
                    this.m_PlatformType,
                    this.m_ToolchainType,
                    solution,
                    evaluated);
            }

            return(0);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: selmentdev/graphyte-engine
        static void Main()
        {
            foreach (var build in new[] { BuildType.Developer, BuildType.Retail })
            {
                var solution = new MainSolution();
                var context  = new Context(
                    PlatformType.Windows,
                    ArchitectureType.X64,
                    build,
                    ConfigurationType.Release);
                var resolved = new ResolvedSolution(solution, context);
                resolved.Resolve();

                Graphyte.Build.Dump.DumpResolvedSolution.SaveToFile($@"solution_{build}.json", resolved);
            }
        }
コード例 #5
0
        public void TestIncludePaths()
        {
            var solution = new SampleSolution(
                TargetType.SharedLibrary,
                DependencyType.Public,
                TargetType.SharedLibrary,
                DependencyType.Public);

            var targetTuple = new TargetTuple(
                PlatformType.Windows,
                ArchitectureType.X64,
                ToolchainType.MSVC,
                ConfigurationType.Debug,
                ConfigurationFlavour.None);

            var resolved = new ResolvedSolution(solution, targetTuple);

            resolved.Resolve();

            //Dump.DumpResolvedSolution.SaveToFile("d:/output.json", resolved);
        }
コード例 #6
0
        private static void Main(string[] args)
        {
            Console.WriteLine($@"Graphyte Build {Program.CurrentVersion}");
            var os = Environment.OSVersion;

            Console.WriteLine($@"Operating System: {os.VersionString}");
            Console.WriteLine($@"Discovering solutions...");

            var profile = new Application.BuildProfile();

            Application.BuildProfileSupport.Save(profile, "profile.json");

            var solutions = SolutionProvider.Solutions;

            var context = new ConfigurationContext(
                PlatformType.Windows,
                ArchitectureType.X64,
                BuildType.Developer,
                ConfigurationType.Release);

            var resolvedSolution = new ResolvedSolution(solutions.First(), context);
        }