JetBrains.Profiler.SelfApi/src/DotMemory.cs [145:192]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public static void InitOffline(string commandLineToolsFolder)
=> ConsoleRunnerPackage.AssertLocalBinaryFolder(commandLineToolsFolder);
///
/// It's the shortcut for InitAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait()
///
public static void Init(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, null, nugetUrl, nugetApi, downloadTo).Wait();
///
/// It's the shortcut for InitAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath)
///
public static Task InitAsync(IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo);
///
/// This method is obsolete, use or instead
/// It makes sure that the dotMemory command-line profiler is downloaded and is ready to use.
///
///
/// 1. Looks for command-line profiler in the folder (if specified). Uses it if it's found.
/// 2. Looks for command-line profiler in the same folder with the running assembly. Uses it if it's found.
/// 3. Downloads the latest `JetBrains.dotMemory.Console` NuGet package into the
/// folder and uses the command-line profiler from this package. The basic package version is defined by .
/// The command-line profiler is saved to `{downloadTo}/dotMemory/{Version}/dotMemory.exe`
/// If the file exists, a new one is not downloaded.
///
/// Cancellation token
/// Download progress callback from 0.0 to 100.0. If null, progress is not reported.
/// URL of NuGet mirror. If null, www.nuget.org is used.
/// NuGet API version.
/// NuGet download destination folder. If null, %LocalAppData% is used.
[Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")]
public static Task EnsurePrerequisiteAsync(
CancellationToken cancellationToken,
IProgress progress = null,
Uri nugetUrl = null,
NuGetApi nugetApi = NuGetApi.V3,
string downloadTo = null)
{
lock (Mutex)
{
if (ConsoleRunnerPackage.CheckLocalBinaryFolder(string.IsNullOrEmpty(downloadTo) ? PrerequisiteBase.GetNearbyPath() : downloadTo))
return Task.FromResult(Missing.Value);
return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken);
}
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
JetBrains.Profiler.SelfApi/src/DotTrace.cs [156:201]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public static void InitOffline(string commandLineToolsFolder)
=> ConsoleRunnerPackage.AssertLocalBinaryFolder(commandLineToolsFolder);
///
/// It's the shortcut for InitAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait()
///
public static void Init(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, null, nugetUrl, nugetApi, downloadTo).Wait();
///
/// It's the shortcut for InitAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath)
///
public static Task InitAsync(IProgress progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo);
///
/// This method is obsolete, use or instead
/// It makes sure that the dotTrace command-line profiler is downloaded and is ready to use.
///
///
/// 1. Looks for dotTrace executable in the same directory with the running assembly. Uses it if it's found.
/// 2. Downloads `JetBrains.dotTrace.CommandLineTools` NuGet package into the
/// directory and uses the dotTrace command-line profiler from this package. The package version is defined by .
/// The command-line profiler is saved to `{downloadTo}/dotTrace.{NupkgVersion}`
///
/// Cancellation token
/// Download progress callback from 0.0 to 100.0. If null, progress is not reported.
/// URL of NuGet mirror. If null, www.nuget.org is used.
/// NuGet API version.
/// NuGet download destination directory. If null, %LocalAppData% is used.
[Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")]
public static Task EnsurePrerequisiteAsync(
CancellationToken cancellationToken,
IProgress progress = null,
Uri nugetUrl = null,
NuGetApi nugetApi = NuGetApi.V3,
string downloadTo = null)
{
lock (Mutex)
{
if (ConsoleRunnerPackage.CheckLocalBinaryFolder(string.IsNullOrEmpty(downloadTo) ? PrerequisiteBase.GetNearbyPath() : downloadTo))
return Task.FromResult(Missing.Value);
return ConsoleRunnerPackage.DownloadAsync(nugetUrl, nugetApi, downloadTo, progress, cancellationToken);
}
}
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -