public static int Main(string[] args)
 {
     // Create the host.
     var host = new CakeHostBuilder()
                .WithArguments(args)
                .ConfigureServices(services =>
     {
         < % if (useSettings)
         {
Ejemplo n.º 2
0
 public CakeHostBuilderFixture()
 {
     Builder     = new CakeHostBuilder();
     Environment = FakeEnvironment.CreateUnixEnvironment();
     FileSystem  = new FakeFileSystem(Environment);
     Log         = Substitute.For <ICakeLog>();
     Engine      = new CakeEngine(Log);
     Options     = new CakeHostOptions();
 }
Ejemplo n.º 3
0
    public static int Main(string[] args)
    {
        // Create the host.
        var host = new CakeHostBuilder()
                   .WithArguments(args)
                   .UseStartup <Program>()
                   .Build();

        // Run the host.
        return(host.Run());
    }
Ejemplo n.º 4
0
        public static int Main(string[] args)
        {
            var exitCode = new CakeHostBuilder()
                           .WithArguments(args)
                           .UseStartup <Program>()
                           .Build()
                           .Run();

#if DEBUG
            Console.ReadKey();
#endif
            return(exitCode);
        }
        public CakeHostBuilderFixture()
        {
            Builder     = new CakeHostBuilder();
            Environment = FakeEnvironment.CreateUnixEnvironment();

            FileSystem = new FakeFileSystem(Environment);
            FileSystem.CreateDirectory("/Working");

            Log       = Substitute.For <ICakeLog>();
            Data      = Substitute.For <ICakeDataService>();
            Engine    = new CakeEngine(Data, Log);
            Installer = Substitute.For <IToolInstaller>();
            Options   = new CakeHostOptions();
        }
Ejemplo n.º 6
0
        public static int Main(string[] args)
        {
            // Create the host.
            var host = new CakeHostBuilder()
                       .UseStartup <Startup>()
                       .WithArguments(args)
                       .ConfigureServices(services =>
            {
                // You could also configure services like this.
                services.UseContext <Settings>();
            })
                       .Build();

            // Run the host.
            return(host.Run());
        }
Ejemplo n.º 7
0
        static int Startup(Options options)
        {
            var localOptions = options.Interactive
                ? InteractiveOptions.Prompt(options)
                : options;

            if (localOptions == null)
            {
                return(0);
            }

            string[] arguments =
            {
                $"-target={localOptions.Target}",
                $"-configuration={localOptions.Configuration}",
                $"-environment={localOptions.Environment}",
                $"-verbosity={localOptions.Verbosity}",
                $"-publishDirectory={localOptions.PublishDirectory}"
            };

            var returnCode = new CakeHostBuilder()
                             .WithArguments(arguments)
                             .UseStartup <FrostingStartup>()
                             .Build()
                             .Run();

            // If interactive, keep asking
            if (options.Interactive)
            {
                Console.WriteLine();
                return(Startup(options));
            }

#if DEBUG
            // Otherwise, wait for key press if debugger is attached
            if (System.Diagnostics.Debugger.IsAttached)
            {
                Console.WriteLine();
                Console.WriteLine("Press any key to quit...");
                Console.ReadKey();
            }
#endif

            return(returnCode);
        }
Ejemplo n.º 8
0
        public static int Main(string[] args)
        {
            // Create the host.
            var host = new CakeHostBuilder()
                       .WithArguments(args)
                       .UseStartup <Program>()
                       .Build();

            // Run the host.
            var exitCode = host.Run();

            if (Convert.ToBoolean(Environment.GetEnvironmentVariable("IsVisualStudio")))
            {
                Console.WriteLine("Press enter (maybe twice) to exit");
                Console.Read();
            }

            return(exitCode);
        }