/// <summary> /// Return the path to the tool to execute. /// </summary> protected override string GenerateFullPathToTool() { var pathToTool = Utilities.GenerateFullPathToTool(ToolName); if (null == pathToTool) { Log.LogErrorWithCodeFromResources("General_ToolFileNotFound", ToolName); } return(pathToTool); }
public static DotnetHost CreateManagedInvocationTool(string toolName, string commandLineArgs) { var pathToToolOpt = Utilities.GenerateFullPathToTool(toolName); // Desktop executes tool directly, only prepend if we're on CLI if (pathToToolOpt != null && IsCliHost(out string pathToDotnet)) { commandLineArgs = PrependFileToArgs(pathToToolOpt, commandLineArgs); pathToToolOpt = pathToDotnet; } return(new DotnetHost(pathToToolOpt, commandLineArgs, isManagedInvocation: true)); }
public static DotnetHost CreateManagedToolInvocation(string toolNameWithoutExtension, string commandLineArgs) { string pathToToolOpt; string toolName; if (IsCliHost(out string pathToDotnet)) { toolName = $"{toolNameWithoutExtension}.dll"; pathToToolOpt = Utilities.GenerateFullPathToTool(toolName); if (pathToToolOpt != null) { commandLineArgs = PrependFileToArgs(pathToToolOpt, commandLineArgs); pathToToolOpt = pathToDotnet; } } else { // Desktop executes tool directly toolName = $"{toolNameWithoutExtension}.exe"; pathToToolOpt = Utilities.GenerateFullPathToTool(toolName); } return(new DotnetHost(toolName, pathToToolOpt, commandLineArgs)); }