コード例 #1
0
        protected override int OnExecute(CommandOptions options)
        {
            var generateOptions = (GenerateOptions)options;

            var projectFile = Path.Combine(Environment.CurrentDirectory, "shapeflow.config.json");

            if (File.Exists(projectFile) && string.IsNullOrWhiteSpace(generateOptions.ProjectFile))
            {
                generateOptions.ProjectFile = projectFile;
            }

            try
            {
                var parameters = new Dictionary <string, string>
                {
                    { "project-root", Environment.CurrentDirectory }
                };

                var solution = Solution.ParseFile(generateOptions.ProjectFile);
                solution.AddParameters(parameters);
                solution.AddParameters(generateOptions.Parameters);

                var ev     = new SolutionEventContext(solution);
                var engine = _container.Resolve <SolutionEngine>();

                engine.Run(ev);
            }
            catch (ApplicationOptionException ex)
            {
                AppTrace.Error("Invalid command line arguments. See exception for details.", ex);
                Console.WriteLine(ex.Message);
            }

            return(0);
        }
コード例 #2
0
        public SolutionEventContext Process(SolutionEventContext ev)
        {
            foreach (var modelDecl in ev.Solution.Models)
            {
                GetOrLoad(modelDecl);
            }

            return(ev);
        }
コード例 #3
0
        public SolutionEventContext Process(SolutionEventContext context)
        {
            var projections = new List <ProjectionContext>();

            foreach (var pipeline in context.Solution.Pipelines)
            {
                projections.Add(_engine.Transform(new ProjectionContext(context.Solution, pipeline)));
            }

            return(new SolutionEventContext(context, projections));
        }