Search in sources :

Example 1 with ComponentFound

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());
}
Also used : ComponentFound(org.gradle.platform.base.internal.toolchain.ComponentFound) ComponentNotFound(org.gradle.platform.base.internal.toolchain.ComponentNotFound) TreeSet(java.util.TreeSet) File(java.io.File)

Aggregations

File (java.io.File)1 TreeSet (java.util.TreeSet)1 ComponentFound (org.gradle.platform.base.internal.toolchain.ComponentFound)1 ComponentNotFound (org.gradle.platform.base.internal.toolchain.ComponentNotFound)1