Search in sources :

Example 6 with ExtraActionInfo

use of com.google.devtools.build.lib.actions.extra.ExtraActionInfo in project heron by twitter.

the class JavaCheckstyle method getSourceFiles.

private static String[] getSourceFiles(String extraActionFile, Predicate<CharSequence> predicate) {
    ExtraActionInfo info = ExtraActionUtils.getExtraActionInfo(extraActionFile);
    JavaCompileInfo jInfo = info.getExtension(JavaCompileInfo.javaCompileInfo);
    Collection<String> sourceFiles = Collections2.filter(jInfo.getSourceFileList(), predicate);
    return sourceFiles.toArray(new String[sourceFiles.size()]);
}
Also used : ExtraActionInfo(com.google.devtools.build.lib.actions.extra.ExtraActionInfo) JavaCompileInfo(com.google.devtools.build.lib.actions.extra.JavaCompileInfo)

Example 7 with ExtraActionInfo

use of com.google.devtools.build.lib.actions.extra.ExtraActionInfo in project heron by twitter.

the class PythonCheckstyle method getSourceFiles.

@SuppressWarnings("unchecked")
private static Collection<String> getSourceFiles(String extraActionFile) {
    ExtraActionInfo info = ExtraActionUtils.getExtraActionInfo(extraActionFile);
    SpawnInfo spawnInfo = info.getExtension(SpawnInfo.spawnInfo);
    return Collections2.filter(spawnInfo.getInputFileList(), Predicates.and(Predicates.containsPattern(".*/src/.+\\.py[c]{0,1}$"), Predicates.not(Predicates.containsPattern("third_party/"))));
}
Also used : SpawnInfo(com.google.devtools.build.lib.actions.extra.SpawnInfo) ExtraActionInfo(com.google.devtools.build.lib.actions.extra.ExtraActionInfo)

Aggregations

ExtraActionInfo (com.google.devtools.build.lib.actions.extra.ExtraActionInfo)7 Test (org.junit.Test)4 Artifact (com.google.devtools.build.lib.actions.Artifact)3 CppLinkInfo (com.google.devtools.build.lib.actions.extra.CppLinkInfo)2 SpawnInfo (com.google.devtools.build.lib.actions.extra.SpawnInfo)2 ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)2 EventBus (com.google.common.eventbus.EventBus)1 CppCompileInfo (com.google.devtools.build.lib.actions.extra.CppCompileInfo)1 EnvironmentVariable (com.google.devtools.build.lib.actions.extra.EnvironmentVariable)1 JavaCompileInfo (com.google.devtools.build.lib.actions.extra.JavaCompileInfo)1