Esempio n. 1
0
            public override void Configure(Container container)
            {
                SetConfig(new HostConfig {
                    DebugMode = true,
                });

                var contentRoot = Path.GetFullPath("../../../../ProtocApi");
                var protocPath  = Path.Combine(contentRoot, "protoc");
                var exeDirPath  = Env.IsWindows
                    ? Path.Combine(protocPath, "win64")
                    : Path.Combine(protocPath, "linux64");
                var protocConfig = new ProtocConfig {
                    ExePath = Env.IsWindows
                        ? Path.Combine(exeDirPath, "protoc.exe")
                        : Path.Combine(exeDirPath, "protoc"),
                    PluginPath            = exeDirPath,
                    ProtoIncludeDirectory = Path.Combine(protocPath, "include"),
                    TempDirectory         = Path.Combine(contentRoot, "tmp"),
                };

                try { FileSystemVirtualFiles.DeleteDirectoryRecursive(protocConfig.TempDirectory); } catch {}
                try { Directory.CreateDirectory(protocConfig.TempDirectory); } catch {}

                container.Register(protocConfig);
            }
Esempio n. 2
0
 private static void DeleteDirectory(string dir)
 {
     RetryExec(() => FileSystemVirtualFiles.DeleteDirectoryRecursive(dir));
 }