Exemplo n.º 1
0
        /// <summary>
        /// Create a new project with given settings.
        /// </summary>
        /// <param name="options">Project creation option</param>
        /// <param name="environment">Creating environment</param>
        /// <returns>Whether if the creation is succeed</returns>
        public static bool CreateProject(CreationOptions options, EnvironmentSetting environment)
        {
            if (!_SanityCheck(options, environment))
            {
                return(false);
            }

            CreationContext ctx = new CreationContext();

            ctx.InitializeGeneratingValues();

            CreationVariables variables = new CreationVariables(options, ctx);
            FilterProcessor   filter    = new FilterProcessor(variables);

            TemplateList templateListData = TemplateList.ReadFile(Path.Combine(environment.templatePath, "Template.txt"), filter);

            if (templateListData == null)
            {
                Console.Error.WriteLine("  [E] Cannot read template index data.");
                return(false);
            }

            if (!_DoCopyWorks(templateListData, filter, options, environment))
            {
                Console.Error.WriteLine("  [E] Copy process failed!!");
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
0
 public FilterProcessor(CreationVariables variables)
 {
     m_variables = variables;
 }