コード例 #1
0
ファイル: TempDirectory.cs プロジェクト: yputt/Templates
        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
ファイル: TempDirectory.cs プロジェクト: yputt/Templates
 public TempDirectory(string directoryPath)
 {
     this.DirectoryPath = directoryPath;
     DirectoryExtended.CheckCreate(this.DirectoryPath);
 }
コード例 #4
0
ファイル: TemplateAssert.cs プロジェクト: aliyazddanpl/pltest
 public static Task DotnetNewInstall(string source, TimeSpan?timeout = null) =>
 ProcessAssert.AssertStart(
     DirectoryExtended.GetCurrentDirectory(),
     "dotnet",
     $"new --install \"{source}\"",
     CancellationTokenFactory.GetCancellationToken(timeout));
コード例 #5
0
ファイル: TemplateAssert.cs プロジェクト: aliyazddanpl/pltest
 public static TempDirectory GetTempDirectory() =>
 new TempDirectory(DirectoryExtended.GetTempDirectoryPath());