/// <summary> /// Returns the full path to the command that will be executed by a ToolTask /// </summary> /// <param name="task">The ToolTask</param> /// <returns></returns> public static string GetToolTaskToolPath(ToolTask task) { MethodInfo method = task.GetType().GetMethod("GenerateFullPathToTool", BindingFlags.Instance | BindingFlags.NonPublic); return (string) method.Invoke(task, null); }
/// <summary> /// Gets the LogPrivate on the given ToolTask instance. We need to use reflection since /// LogPrivate is a private property. /// </summary> /// <returns></returns> static private TaskLoggingHelper GetPrivateLog(ToolTask task) { PropertyInfo logPrivateProperty = typeof(ToolTask).GetProperty("LogPrivate", BindingFlags.Instance | BindingFlags.NonPublic); return (TaskLoggingHelper)logPrivateProperty.GetValue(task, null); }
/// <summary> /// Returns the command line with arguments that a ToolTask will execute /// </summary> /// <param name="task">The ToolTask</param> /// <returns></returns> public static string GetToolTaskCommand(ToolTask task) { MethodInfo method = task.GetType().GetMethod("GenerateCommandLineCommands", BindingFlags.Instance | BindingFlags.NonPublic); return (string) method.Invoke(task, null); }
/// <summary> /// Invokes the ValidateParameters on the given ToolTask instance. We need to use reflection since /// ValidateParameters is inaccessible to Tasks unit tests. /// </summary> /// <returns></returns> static internal bool CallValidateParameters(ToolTask task) { MethodInfo validateMethod = typeof(ToolTask).GetMethod("ValidateParameters", BindingFlags.Instance | BindingFlags.NonPublic); return (bool)validateMethod.Invoke(task, null); }