Example #1
0
        public void DoTest()
        {
            if (_configuration == null)
            {
                throw new InvalidOperationException("Configuration is null");
            }

            if (_toc == null)
            {
                throw new InvalidOperationException("Table of contents is null");
            }

            Log.Info("Building test configuration...");
            _configuration.HostName = "http://localhost:8080/";

            var settings = _projectLoader.CreateRuntimeSettings(_configuration, _toc, _configuration.TargetWeb);


            using (var loader = new ShortCodeLoader(Log, settings, Program.AppSetting))
            {
                WebsiteBuilder builder = new WebsiteBuilder(settings, Log, loader, _scriptHandler);
                var            runTime = builder.Run();

                using (var server = HttpServerFactory.CreateServerForTest(ServerLog, Path.Combine(WorkDirectory, _configuration.TargetWeb.OutPutDirectory)))
                {
                    server.Start();
                    Log.Info("-------------------------------------------------");
                    Log.Info("Runtime: {0:0.000} ms", runTime.TotalMilliseconds);
                    Log.Info("Test server running on: http://localhost:8080/");
                    Log.Info("Serving from: {0}", _configuration.TargetWeb.OutPutDirectory);

                    if (Program.AppSetting.AutoStartWebserver)
                    {
                        StartUrl(_configuration.HostName);
                    }

                    Console.WriteLine(ExitString);
                    Console.ReadLine();
                    server.Stop();
                }
            }
        }
Example #2
0
        public void DoBuild()
        {
            if (_configuration == null)
            {
                throw new InvalidOperationException("Configuration is null");
            }

            if (_toc == null)
            {
                throw new InvalidOperationException("Table of contents is null");
            }

            var settings = _projectLoader.CreateRuntimeSettings(_configuration, _toc, _configuration.TargetWeb);

            Log.Info("Building deploy configuration...");
            WebsiteBuilder builder = new WebsiteBuilder(settings, Log, _scriptHandler);
            var            runTime = builder.Run();

            Log.Info("Runtime: {0:0.000} ms", runTime.TotalMilliseconds);
        }