@@ -0,0 +1,2213 @@
+package jetbrains.buildServer.autotools.agent;%0A%0Aimport com.intellij.execution.configurations.GeneralCommandLine;%0Aimport jetbrains.buildServer.ExecResult;%0Aimport jetbrains.buildServer.SimpleCommandLineProcessRunner;%0Aimport jetbrains.buildServer.agent.*;%0Aimport jetbrains.buildServer.log.Loggers;%0Aimport jetbrains.buildServer.util.EventDispatcher;%0Aimport org.jetbrains.annotations.NotNull;%0A%0A/**%0A * Created on 10.08.2017.%0A * Author     : Nadezhda Demina%0A */%0Apublic class AutotoolsToolProvider extends AgentLifeCycleAdapter implements ToolProvider %7B%0A  /**%0A   * Tool Name%0A   */%0A  private final String myToolName;%0A  public AutotoolsToolProvider(ToolProvidersRegistry toolProvidersRegistry,%0A                               EventDispatcher%3CAgentLifeCycleListener%3E eventDispatcher, String toolName)%7B%0A    toolProvidersRegistry.registerToolProvider(this);%0A    eventDispatcher.addListener(this);%0A    myToolName = toolName;%0A  %7D%0A%0A%0A  @Override%0A  public void beforeAgentConfigurationLoaded(@NotNull BuildAgent agent) %7B%0A    if (isExistedTool())%7B%0A      Loggers.AGENT.info(%22AutotoolsToolProvider for tool %22 + myToolName + %22 found%22);%0A      agent.getConfiguration().addConfigurationParameter(myToolName, myToolName);%0A      return;%0A    %7D%0A%0A    Loggers.AGENT.info(%22AutotoolsToolProvider for tool %22 + myToolName + %22did not find%22);%0A  %7D%0A%0A%0A  /**%0A   * Returns True if Existed Tool myConfigName%0A   * @return%0A   */%0A  public boolean isExistedTool()%7B%0A    final GeneralCommandLine commandLine = new GeneralCommandLine();%0A    commandLine.setExePath(myToolName);%0A    commandLine.addParameter(%22--version%22);%0A    final ExecResult execResult = SimpleCommandLineProcessRunner.runCommand(commandLine, (byte%5B%5D)null);%0A    return execResult.getExitCode() == 0;%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public boolean supports(@NotNull final String s) %7B%0A    return myToolName.equals(s);%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public String getPath(@NotNull final String s) throws ToolCannotBeFoundException %7B%0A    return myToolName;%0A  %7D%0A%0A  @NotNull%0A  @Override%0A  public String getPath(@NotNull final String s, @NotNull final AgentRunningBuild agentRunningBuild, @NotNull final BuildRunnerContext buildRunnerContext) throws ToolCannotBeFoundException %7B%0A    return myToolName;%0A  %7D%0A%7D%0A

add AutotoolsToolProvider