Search in sources :

Example 1 with DependencyException

use of org.graalvm.component.installer.DependencyException in project graal by oracle.

the class InfoCommand method printDetails.

@Override
void printDetails(ComponentParam param, ComponentInfo info) {
    if (printTable) {
        String line;
        if (fullPath) {
            line = String.format(feedback.l10n("INFO_ComponentLongList"), shortenComponentId(info), val(info.getVersion().displayString()), val(info.getName()), filePath(info), info.getStability().displayName(feedback));
        } else {
            line = String.format(feedback.l10n(noComponentPath ? "INFO_ComponentShortListNoFile" : "INFO_ComponentShortList"), shortenComponentId(info), val(info.getVersion().displayString()), val(info.getName()), filePath(info), info.getStability().displayName(feedback));
        }
        feedback.verbatimOut(line, false);
        return;
    } else {
        feedback.output("INFO_ComponentBasicInfo", shortenComponentId(info), val(info.getVersion().displayString()), val(info.getName()), param.getFullPath(), findRequiredGraalVMVersion(info), info.getStability().displayName(feedback));
        List<String> keys = new ArrayList<>(info.getRequiredGraalValues().keySet());
        keys.remove(CommonConstants.CAP_GRAALVM_VERSION);
        if (!keys.isEmpty() && feedback.verboseOutput("INFO_ComponentRequirementsHeader")) {
            Collections.sort(keys);
            for (String cap : keys) {
                feedback.verboseOutput("INFO_ComponentRequirement", getRegistry().localizeCapabilityName(cap), info.getRequiredGraalValues().get(cap));
            }
        }
        MetadataLoader ldr = map.get(info);
        List<InstallerStopException> errs = ldr.getErrors();
        if (!errs.isEmpty()) {
            feedback.message("INFO_ComponentBroken", files.get(info));
            for (InstallerStopException ex : errs) {
                feedback.message("INFO_ComponentErrorIndent", ex.getLocalizedMessage());
            }
        }
        Verifier vfy = new Verifier(feedback, input.getLocalRegistry(), catalog).collect(true).validateRequirements(info);
        if (vfy.hasErrors()) {
            feedback.message("INFO_ComponentWillNotInstall", shortenComponentId(info));
            for (DependencyException ex : vfy.getErrors()) {
                feedback.message("INFO_ComponentDependencyIndent", ex.getLocalizedMessage());
            }
        }
    }
}
Also used : ArrayList(java.util.ArrayList) MetadataLoader(org.graalvm.component.installer.persist.MetadataLoader) Verifier(org.graalvm.component.installer.model.Verifier) DependencyException(org.graalvm.component.installer.DependencyException) InstallerStopException(org.graalvm.component.installer.InstallerStopException)

Aggregations

ArrayList (java.util.ArrayList)1 DependencyException (org.graalvm.component.installer.DependencyException)1 InstallerStopException (org.graalvm.component.installer.InstallerStopException)1 Verifier (org.graalvm.component.installer.model.Verifier)1 MetadataLoader (org.graalvm.component.installer.persist.MetadataLoader)1