working on build scripts
This commit is contained in:
parent
f273ea4f7d
commit
d524732bbb
111 changed files with 3052 additions and 1989 deletions
29
scripts/Microsoft.DotNet.Cli.Build.Framework/DebugHelper.cs
Normal file
29
scripts/Microsoft.DotNet.Cli.Build.Framework/DebugHelper.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build.Framework
|
||||
{
|
||||
public static class DebugHelper
|
||||
{
|
||||
[Conditional("DEBUG")]
|
||||
public static void HandleDebugSwitch(ref string[] args)
|
||||
{
|
||||
if (args.Length > 0 && string.Equals("--debug", args[0], StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args = args.Skip(1).ToArray();
|
||||
WaitForDebugger();
|
||||
}
|
||||
}
|
||||
|
||||
private static void WaitForDebugger()
|
||||
{
|
||||
Console.WriteLine("Waiting for debugger to attach. Press ENTER to continue");
|
||||
Console.WriteLine($"Process ID: {Process.GetCurrentProcess().Id}");
|
||||
Console.ReadLine();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue