in dotTrace-agent/src/main/java/jetbrains/buildServer/dotTrace/agent/CmdGenerator.java [32:81]
public String create(@NotNull final Context ctx) {
File dotTracePath = new File(myParametersService.getRunnerParameter(Constants.PATH_VAR));
if(!dotTracePath.isAbsolute()) {
dotTracePath = new File(myFileService.getCheckoutDirectory(), dotTracePath.getPath());
}
File consoleProfilerFile = new File(dotTracePath, DOT_TRACE_EXE_NAME);
myFileService.validatePath(consoleProfilerFile);
File reporterPath = new File(dotTracePath, DOT_TRACE_REPORTER_EXE_NAME);
myFileService.validatePath(reporterPath);
final StringBuilder cmdLines = new StringBuilder();
// Run profiler
cmdLines.append(
myCommandLineArgumentsService.createCommandLineString(
Arrays.asList(
new CommandLineArgument(consoleProfilerFile.getPath(), CommandLineArgument.Type.TOOL),
new CommandLineArgument(ctx.getProjectFile().getPath(), CommandLineArgument.Type.PARAMETER),
new CommandLineArgument(ctx.getSnapshotFile().getPath(), CommandLineArgument.Type.PARAMETER))));
cmdLines.append(ourLineSeparator);
// Save exit code to EXIT_CODE
cmdLines.append("@SET EXIT_CODE=%ERRORLEVEL%");
cmdLines.append(ourLineSeparator);
// Run reporter
File stapshotDir = ctx.getSnapshotFile().getParentFile();
if(stapshotDir == null) {
stapshotDir = new File(".");
}
cmdLines.append(
myCommandLineArgumentsService.createCommandLineString(
Arrays.asList(
new CommandLineArgument(reporterPath.getPath(), CommandLineArgument.Type.TOOL),
new CommandLineArgument("report", CommandLineArgument.Type.PARAMETER),
new CommandLineArgument(stapshotDir.getPath() + File.separator + "*.dtp", CommandLineArgument.Type.PARAMETER),
new CommandLineArgument("--pattern=" + ctx.getPatternsFile().getPath(), CommandLineArgument.Type.PARAMETER),
new CommandLineArgument("--save-to=" + ctx.getReportFile().getPath(), CommandLineArgument.Type.PARAMETER))));
cmdLines.append(ourLineSeparator);
// Return exit code from EXIT_CODE
cmdLines.append("@EXIT %EXIT_CODE%");
cmdLines.append(ourLineSeparator);
return cmdLines.toString();
}