use of org.gradle.platform.base.internal.toolchain.ComponentFound in project gradle by gradle.
the class AbstractWindowsKitComponentLocator method locateUserSpecifiedComponent.
private SearchResult<T> locateUserSpecifiedComponent(File candidate) {
File windowsKitDir = FileUtils.canonicalize(candidate);
Set<T> candidates = foundComponents.get(windowsKitDir);
if (candidates.isEmpty()) {
candidates = findIn(windowsKitDir, DiscoveryType.USER);
}
if (candidates.isEmpty()) {
return new ComponentNotFound<T>(String.format("The specified installation directory '%s' does not appear to contain a %s installation.", candidate, getDisplayName()));
}
Set<T> found = new TreeSet<T>(new DescendingComponentVersionComparator());
found.addAll(candidates);
return new ComponentFound<T>(found.iterator().next());
}
Aggregations