in JetBrains.Profiler.SelfApi/src/DotTrace.cs [156:201]
public static void InitOffline(string commandLineToolsFolder)
=> ConsoleRunnerPackage.AssertLocalBinaryFolder(commandLineToolsFolder);
/// <summary>
/// It's the shortcut for <c>InitAsync(CancellationToken.None, progress: null, nugetUrl, prerequisitePath).Wait()</c>
/// </summary>
public static void Init(Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, null, nugetUrl, nugetApi, downloadTo).Wait();
/// <summary>
/// It's the shortcut for <c>InitAsync(CancellationToken.None, progress, nugetUrl, prerequisitePath)</c>
/// </summary>
public static Task InitAsync(IProgress<double> progress = null, Uri nugetUrl = null, NuGetApi nugetApi = NuGetApi.V3, string downloadTo = null)
=> InitAsync(CancellationToken.None, progress, nugetUrl, nugetApi, downloadTo);
/// <summary>
/// This method is obsolete, use <see cref="InitAsync(System.Threading.CancellationToken,System.IProgress{double},System.Uri,JetBrains.Profiler.SelfApi.NuGetApi,string)"/> or <see cref="InitOffline"/> instead<br/>
/// It makes sure that the dotTrace command-line profiler is downloaded and is ready to use.
/// </summary>
/// <remarks>
/// 1. Looks for dotTrace executable in the same directory with the running assembly. Uses it if it's found.<br/>
/// 2. Downloads `JetBrains.dotTrace.CommandLineTools` NuGet package into the <paramref name="downloadTo"/>
/// directory and uses the dotTrace command-line profiler from this package. The package version is defined by <see cref="CommandLineToolsConfig.NupkgVersion"/>.
/// The command-line profiler is saved to `{downloadTo}/dotTrace.{NupkgVersion}`
/// </remarks>
/// <param name="cancellationToken">Cancellation token</param>
/// <param name="progress">Download progress callback from 0.0 to 100.0. If null, progress is not reported.</param>
/// <param name="nugetUrl">URL of NuGet mirror. If null, www.nuget.org is used.</param>
/// <param name="nugetApi">NuGet API version.</param>
/// <param name="downloadTo">NuGet download destination directory. If null, %LocalAppData% is used.</param>
[Obsolete("Use " + nameof(InitAsync) + " or " + nameof(InitOffline) + " instead")]
public static Task EnsurePrerequisiteAsync(
CancellationToken cancellationToken,
IProgress<double> 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);
}
}