public List getRequiredTools()

in server/src/jetbrains/buildServer/swabra/HandleToolUsageProvider.java [28:48]


  public List<ToolVersion> getRequiredTools(@NotNull final SRunningBuild build) {

    InstalledToolVersionEx handleTool = myServerToolManager.findInstalledTool(HandleToolVersion.getInstance().getId());
    if (handleTool == null) return Collections.emptyList();

    if (TeamCityProperties.getBoolean(myKey)) {
      return Collections.singletonList(handleTool);
    }

    if (!isHandleExeCompatibleWithAgent(build.getAgent())) return Collections.emptyList();

    Collection<SBuildFeatureDescriptor> features = build.getBuildFeaturesOfType(SwabraUtil.FEATURE_TYPE);
    Map<String, String> swabraParams = new HashMap<>();
    if (!features.isEmpty()) {
      swabraParams.putAll(features.iterator().next().getParameters());
    }
    swabraParams.putAll(build.getAgent().getConfigurationParameters());
    swabraParams.putAll(build.getBuildOwnParameters());
    boolean isToolRequired =  SwabraUtil.isLockingProcessesDetectionEnabled(swabraParams);
    return isToolRequired ? Collections.singletonList(handleTool) : Collections.emptyList();
  }