use of jetbrains.buildServer.serverSide.discovery.DiscoveredObject in project teamcity-powershell by JetBrains.
the class PowerShellRunnerDiscoverer method discoverRunnersInDirectory.
@NotNull
@Override
protected List<DiscoveredObject> discoverRunnersInDirectory(@NotNull final Element dir, @NotNull final List<Element> filesAndDirs) {
final List<DiscoveredObject> runners = new ArrayList<>();
for (Element e : filesAndDirs) {
if (e.isLeaf() && PS_EXT.equals(FileUtil.getExtension(e.getName()))) {
final Map<String, String> parameters = new HashMap<>();
parameters.put(PowerShellConstants.RUNNER_SCRIPT_FILE, e.getFullName());
parameters.put(PowerShellConstants.RUNNER_EXECUTION_MODE, PowerShellExecutionMode.PS1.getValue());
parameters.put(PowerShellConstants.RUNNER_SCRIPT_MODE, PowerShellScriptMode.FILE.getValue());
runners.add(new DiscoveredObject(PowerShellConstants.RUN_TYPE, parameters));
}
}
return runners;
}
Aggregations