Exemple #1
0
        public static void Initialize(this CremaBootstrapper app, TestContext context, string name)
        {
#if SERVER
            var repositoryPath = DirectoryUtility.Prepare(context.TestRunDirectory + "_repo", name);
            app.CreateRepository(repositoryPath, app.RepositoryName, false);
            app.BasePath       = repositoryPath;
            app.MultiThreading = true;
#endif
#if CLIENT
            var cremaHost      = app.GetService(typeof(ICremaHost)) as ICremaHost;
            var repositoryPath = DirectoryUtility.Prepare(context.TestRunDirectory + "_repo", name);
            CremaServeHost.Run("init", repositoryPath.WrapQuot());
            var process  = CremaServeHost.RunAsync("run", repositoryPath.WrapQuot(), "--port", port);
            var eventSet = new ManualResetEvent(false);
            cremaHostToPort[cremaHost] = port;
            port += 2;
            process.OutputDataReceived += (s, e) =>
            {
                if (e.Data == "종료하시려면 <Q> 키를 누르세요.")
                {
                    eventSet.Set();
                }
            };
            eventSet.WaitOne();
            app.Disposed += (s, e) =>
            {
                process.StandardInput.WriteLine("exit");
                process.WaitForExit(100);
                cremaHostToPort.Remove(cremaHost);
            };
#endif
        }
        private void InitCremaService()
        {
            var repoPath = DirectoryUtility.Prepare(CremaDbPath, "_repo");

            using (var bootstrap = new CremaBootstrapper())
            {
                bootstrap.CreateRepository(repoPath, "crema", false);
            }

            Service                = new CremaService();
            Service.BasePath       = repoPath;
            Service.MultiThreading = true;
            Service.Port           = 4004;
            Service.HttpPort       = AddressUtility.GetDefaultHttpPort(Service.Port);

            Service.Open();

            CremaHost = Service.GetService <ICremaHost>();
        }
        public async Task CreateRepositoryAsync()
        {
            var dialog = new CommonOpenFileDialog()
            {
                IsFolderPicker = true,
            };

            if (dialog.ShowDialog() == CommonFileDialogResult.Ok)
            {
                var basePath = dialog.FileName;
                var isEmpty  = DirectoryUtility.IsEmpty(basePath);
                if (isEmpty == false)
                {
                    await AppMessageBox.ShowAsync("대상 경로는 비어있지 않습니다.");

                    return;
                }

                CremaBootstrapper.CreateRepository(this.service, basePath, "git", "xml");
                await AppMessageBox.ShowAsync("저장소를 생성했습니다.");

                this.BasePath = basePath;
            }
        }
Exemple #4
0
 protected override void OnExecute()
 {
     CremaBootstrapper.CreateRepository(this.boot, this.Path, this.RepositoryModule, this.FileType, this.DataBaseUrl);
 }