Exemple #1
0
        private static ProjectRequest addApplicationProject(NewCommandInput input, TemplateRequest request)
        {
            var project = new ProjectRequest(input.SolutionName, "baseline");

            project.AddAlteration("structuremap");
            project.AddAlteration("fubumvc-empty");

            if (input.OptionsFlag != null)
            {
                input.OptionsFlag.Each(x => project.AddAlteration(x));
            }

            // TODO -- duplication!
            if (input.ShortNameFlag.IsNotEmpty())
            {
                project.Substitutions.Set(ProjectPlan.SHORT_NAME, input.ShortNameFlag);
            }

            // TODO -- Will need to check for razor too!
            if (!project.Alterations.Contains("spark"))
            {
                project.AddAlteration("no-views");
            }

            request.AddProjectRequest(project);

            return(project);
        }
Exemple #2
0
        public override bool Execute(NewSerenityInput input)
        {
            // TODO -- duplication here
            string solutionFile = SolutionFinder.FindSolutionFile();

            if (solutionFile == null)
            {
                return(false);
            }

            // TODO -- try to attach the IApplicationSource from the parent
            // project
            var projectRequest = new ProjectRequest(input.Name, "baseline");

            projectRequest.AddAlteration("storyteller");
            projectRequest.AddAlteration("serenity");

            var request = new TemplateRequest
            {
                RootDirectory = Environment.CurrentDirectory,
                SolutionName  = solutionFile
            };

            request.AddProjectRequest(projectRequest);


            // TODO -- add an option to copy references from the parent project
            var plan = NewCommand.BuildTemplatePlan(request);

            NewCommand.ExecutePlan(plan);

            return(true);
        }
Exemple #3
0
        public static TemplateRequest BuildTemplateRequest(BottleInput input, string solutionFile)
        {
            var request = new TemplateRequest
            {
                RootDirectory = Environment.CurrentDirectory.ToFullPath(),
                SolutionName  = solutionFile
            };

            var projectRequest = new ProjectRequest(input.Name, "baseline");

            // TODO -- duplication!
            if (input.ShortNameFlag.IsNotEmpty())
            {
                projectRequest.Substitutions.Set(ProjectPlan.SHORT_NAME, input.ShortNameFlag);
            }

            request.AddProjectRequest(projectRequest);
            projectRequest.AddAlteration("fubu-bottle");

            // TODO -- some duplication here.
            if (input.TestsFlag)
            {
                var testing = new TestProjectRequest(projectRequest.Name + ".Testing", "baseline",
                                                     projectRequest.Name);

                testing.AddAlteration("unit-testing");

                request.AddTestingRequest(testing);
            }

            if (input.OptionsFlag != null)
            {
                input.OptionsFlag.Each(projectRequest.AddAlteration);
            }

            return(request);
        }