Search in sources :

Example 1 with TargetPatternSequence

use of com.google.devtools.build.lib.skyframe.PrepareDepsOfPatternsValue.TargetPatternSequence in project bazel by bazelbuild.

the class PrepareDepsOfPatternsFunction method getSkyKeys.

public static ImmutableList<SkyKey> getSkyKeys(SkyKey skyKey, EventHandler eventHandler) {
    TargetPatternSequence targetPatternSequence = (TargetPatternSequence) skyKey.argument();
    Iterable<PrepareDepsOfPatternSkyKeyOrException> keysMaybe = PrepareDepsOfPatternValue.keys(targetPatternSequence.getPatterns(), targetPatternSequence.getOffset());
    ImmutableList.Builder<SkyKey> skyKeyBuilder = ImmutableList.builder();
    boolean handlerIsParseFailureListener = eventHandler instanceof ParseFailureListener;
    for (PrepareDepsOfPatternSkyKeyOrException skyKeyOrException : keysMaybe) {
        try {
            skyKeyBuilder.add(skyKeyOrException.getSkyKey());
        } catch (TargetParsingException e) {
            handleTargetParsingException(eventHandler, handlerIsParseFailureListener, skyKeyOrException.getOriginalPattern(), e);
        }
    }
    return skyKeyBuilder.build();
}
Also used : SkyKey(com.google.devtools.build.skyframe.SkyKey) TargetParsingException(com.google.devtools.build.lib.cmdline.TargetParsingException) ImmutableList(com.google.common.collect.ImmutableList) ParseFailureListener(com.google.devtools.build.lib.pkgcache.ParseFailureListener) PrepareDepsOfPatternSkyKeyOrException(com.google.devtools.build.lib.skyframe.PrepareDepsOfPatternValue.PrepareDepsOfPatternSkyKeyOrException) TargetPatternSequence(com.google.devtools.build.lib.skyframe.PrepareDepsOfPatternsValue.TargetPatternSequence)

Aggregations

ImmutableList (com.google.common.collect.ImmutableList)1 TargetParsingException (com.google.devtools.build.lib.cmdline.TargetParsingException)1 ParseFailureListener (com.google.devtools.build.lib.pkgcache.ParseFailureListener)1 PrepareDepsOfPatternSkyKeyOrException (com.google.devtools.build.lib.skyframe.PrepareDepsOfPatternValue.PrepareDepsOfPatternSkyKeyOrException)1 TargetPatternSequence (com.google.devtools.build.lib.skyframe.PrepareDepsOfPatternsValue.TargetPatternSequence)1 SkyKey (com.google.devtools.build.skyframe.SkyKey)1