Search in sources :

Example 1 with ComponentNotFound

use of org.gradle.platform.base.internal.toolchain.ComponentNotFound in project gradle by gradle.

the class GccPlatformToolProvider method getGccMetadata.

private SearchResult<GccMetadata> getGccMetadata(ToolType compilerType) {
    GccCommandLineToolConfigurationInternal compiler = toolRegistry.getTool(compilerType);
    if (compiler == null) {
        return new ComponentNotFound<GccMetadata>("Tool " + compilerType.getToolName() + " is not available");
    }
    CommandLineToolSearchResult searchResult = toolSearchPath.locate(compiler.getToolType(), compiler.getExecutable());
    String language = LANGUAGE_FOR_COMPILER.get(compilerType);
    List<String> languageArgs = language == null ? Collections.<String>emptyList() : ImmutableList.of("-x", language);
    return metadataProvider.getCompilerMetaData(toolSearchPath.getPath(), spec -> spec.executable(searchResult.getTool()).args(languageArgs));
}
Also used : ComponentNotFound(org.gradle.platform.base.internal.toolchain.ComponentNotFound) CommandLineToolSearchResult(org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolSearchResult) GccCommandLineToolConfigurationInternal(org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)

Example 2 with ComponentNotFound

use of org.gradle.platform.base.internal.toolchain.ComponentNotFound 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

ComponentNotFound (org.gradle.platform.base.internal.toolchain.ComponentNotFound)2 File (java.io.File)1 TreeSet (java.util.TreeSet)1 CommandLineToolSearchResult (org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolSearchResult)1 GccCommandLineToolConfigurationInternal (org.gradle.nativeplatform.toolchain.internal.tools.GccCommandLineToolConfigurationInternal)1 ComponentFound (org.gradle.platform.base.internal.toolchain.ComponentFound)1