8 public static ToolEx GetTool(
string toolPath)
10 Assert.FileExists(toolPath);
14 public static ToolEx GetNuGetTool(
string packageId,
string packageExecutable,
string? version =
null,
string? framework =
null)
16 var toolPath = NuGetToolPathResolver.GetPackageExecutable(packageId, packageExecutable, version, framework);
17 return GetTool(toolPath);
20 public static ToolEx GetNpmTool(
string npmExecutable)
22 var toolPath = NpmToolPathResolver.GetNpmExecutable(npmExecutable);
23 return GetTool(toolPath);
26 public static ToolEx? TryGetEnvironmentTool(
string name)
28 var toolPath = ToolPathResolver.TryGetEnvironmentExecutable($
"{name.ToUpperInvariant()}_EXE");
32 return GetTool(toolPath);
35 public static ToolEx GetPathTool(
string name)
37 var toolPath = ToolPathResolver.GetPathExecutable(name);
38 return GetTool(toolPath);
41 public static ToolEx GetEnvironmentOrPathTool(
string name)
43 return TryGetEnvironmentTool(name) ?? GetPathTool(name);