Beispiel #1
0
        public static int Main(string[] args)
        {
            string profilePath = MulticoreJIT.GetMulticoreJITPath();

            ProfileOptimization.SetProfileRoot(profilePath);
            ProfileOptimization.StartProfile("bicep.profile");
            Console.OutputEncoding = TemplateEmitter.UTF8EncodingWithoutBom;

            BicepDeploymentsInterop.Initialize();

            var program = new Program(new InvocationContext(AzResourceTypeProvider.CreateWithAzTypes(), Console.Out, Console.Error, ThisAssembly.AssemblyFileVersion));

            return(program.Run(args));
        }
Beispiel #2
0
        public static async Task Main()
        => await RunWithCancellationAsync(async cancellationToken =>
        {
            string profilePath = MulticoreJIT.GetMulticoreJITPath();
            ProfileOptimization.SetProfileRoot(profilePath);
            ProfileOptimization.StartProfile("bicepserver.profile");

            // the server uses JSON-RPC over stdin & stdout to communicate,
            // so be careful not to use console for logging!
            var server = new Server(
                Console.OpenStandardInput(),
                Console.OpenStandardOutput(),
                new Server.CreationOptions
            {
                ResourceTypeProvider = AzResourceTypeProvider.CreateWithAzTypes(),
                FileResolver         = new FileResolver()
            });

            await server.RunAsync(cancellationToken);
        });