Beispiel #1
0
        static int Main(string[] args)
        {
            // Get commandline parameters.
            Program.Parameter = Parameter.CreateParameter(args);
            if (Program.Parameter == null)
            {
                return(1);
            }

            if (!LogLevel.TryParse(Program.Parameter.LogLevel, out Program.LogLevel))
            {
                Program.LogLevel = LogLevel.Warning;
            }

            Print(LogLevel.Debug, "-------- Parameter --------");
            Print(LogLevel.Debug, Program.Parameter?.ToString());

            // Setup Notevel's Logger.
            Logger.LoggingHandler += Print;

            // Setup Notesvel's Builder.
            var builder = new XmlBuilder()
            {
                ProjectFilePath      = Program.Parameter.ProjectFileName,
                OutputDirectory      = Program.Parameter.OutputDirectory,
                ProjectSchemaPath    = Program.Parameter.ProjectSchema,
                CatalogSchemaPath    = Program.Parameter.CatalogSchema,
                Intermediates        = Program.Parameter.Intermediates,
                SkipSchemeValidation = Program.Parameter.SkipSchemeValidation,
            };

            builder.AddVariables(Program.Parameter.Variables);
            builder.Executers.Add(new NovelSiteExecuter("narou"));

            // Run Notesvel's Builder.
            try
            {
                builder.Run();
            }
            catch (Exception e)
            {
                Print(LogLevel.Critical, e.Message);
                return(1);
            }

            return(0);
        }