예제 #1
0
        public void Dispose()
        {
            var task = DirectoryExtended.TryDeleteDirectory(this.DirectoryPath);

            task.Wait();
            if (!task.Result)
            {
                Debug.WriteLine($"Failed to delete directory {this.DirectoryPath}");
            }
        }
예제 #2
0
 public static Task DotnetPublish(
     this Project project,
     string framework = null,
     string runtime = null,
     bool? noRestore = true,
     TimeSpan? timeout = null)
 {
     var frameworkArgument = framework == null ? null : $"--framework {framework}";
     var runtimeArgument = runtime == null ? null : $"--self-contained --runtime {runtime}";
     var noRestoreArgument = noRestore == null ? null : "--no-restore";
     DirectoryExtended.CheckCreate(project.PublishDirectoryPath);
     return ProcessAssert.AssertStart(
         project.DirectoryPath,
         "dotnet",
         $"publish {noRestoreArgument} {frameworkArgument} {runtimeArgument} --output {project.PublishDirectoryPath}",
         CancellationTokenFactory.GetCancellationToken(timeout));
 }
예제 #3
0
 public static Task DotnetNewInstall(string source, TimeSpan?timeout = null) =>
 ProcessAssert.AssertStart(
     DirectoryExtended.GetCurrentDirectory(),
     "dotnet",
     $"new --install \"{source}\"",
     CancellationTokenFactory.GetCancellationToken(timeout));
예제 #4
0
 public static TempDirectory GetTempDirectory() =>
 new TempDirectory(DirectoryExtended.GetTempDirectoryPath());
예제 #5
0
 public TempDirectory(string directoryPath)
 {
     this.DirectoryPath = directoryPath;
     DirectoryExtended.CheckCreate(this.DirectoryPath);
 }