Пример #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
        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);
            }
        }
        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);
        }