本文整理汇总了Java中com.google.devtools.build.lib.actions.extra.CppCompileInfo类的典型用法代码示例。如果您正苦于以下问题:Java CppCompileInfo类的具体用法?Java CppCompileInfo怎么用?Java CppCompileInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CppCompileInfo类属于com.google.devtools.build.lib.actions.extra包,在下文中一共展示了CppCompileInfo类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSourceFiles
import com.google.devtools.build.lib.actions.extra.CppCompileInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Collection<String> getSourceFiles(String extraActionFile) {
ExtraActionInfo info = ExtraActionUtils.getExtraActionInfo(extraActionFile);
CppCompileInfo cppInfo = info.getExtension(CppCompileInfo.cppCompileInfo);
return Collections2.filter(
cppInfo.getSourcesAndHeadersList(),
Predicates.and(
Predicates.not(Predicates.containsPattern("third_party/")),
Predicates.not(Predicates.containsPattern("config/heron-config.h")),
Predicates.not(Predicates.containsPattern(".*pb.h$")),
Predicates.not(Predicates.containsPattern(".*cc_wrapper.sh$")),
Predicates.not(Predicates.containsPattern(".*pb.cc$"))
)
);
}
示例2: getSourceFiles
import com.google.devtools.build.lib.actions.extra.CppCompileInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static Collection<String> getSourceFiles(String extraActionFile) {
ExtraActionInfo info = ExtraActionUtils.getExtraActionInfo(extraActionFile);
CppCompileInfo cppInfo = info.getExtension(CppCompileInfo.cppCompileInfo);
return Collections2.filter(
cppInfo.getSourcesAndHeadersList(),
Predicates.and(
Predicates.not(Predicates.containsPattern("external/")),
Predicates.not(Predicates.containsPattern("third_party/")),
Predicates.not(Predicates.containsPattern("config/heron-config.h")),
Predicates.not(Predicates.containsPattern(".*pb.h$")),
Predicates.not(Predicates.containsPattern(".*cc_wrapper.sh$")),
Predicates.not(Predicates.containsPattern(".*pb.cc$"))
)
);
}
示例3: getExtraActionInfo
import com.google.devtools.build.lib.actions.extra.CppCompileInfo; //导入依赖的package包/类
@Override
public ExtraActionInfo.Builder getExtraActionInfo(ActionKeyContext actionKeyContext) {
CppCompileInfo.Builder info = CppCompileInfo.newBuilder();
info.setTool(gccToolPath.getPathString());
for (String option : getCompilerOptions()) {
info.addCompilerOption(option);
}
info.setOutputFile(outputFile.getExecPathString());
info.setSourceFile(getSourceFile().getExecPathString());
if (inputsDiscovered()) {
info.addAllSourcesAndHeaders(Artifact.toExecPaths(getInputs()));
} else {
info.addSourcesAndHeaders(getSourceFile().getExecPathString());
info.addAllSourcesAndHeaders(
Artifact.toExecPaths(context.getDeclaredIncludeSrcs()));
}
for (Entry<String, String> envVariable : getEnvironment().entrySet()) {
info.addVariable(
EnvironmentVariable.newBuilder()
.setName(envVariable.getKey())
.setValue(envVariable.getValue())
.build());
}
try {
return super.getExtraActionInfo(actionKeyContext)
.setExtension(CppCompileInfo.cppCompileInfo, info.build());
} catch (CommandLineExpansionException e) {
throw new AssertionError("CppCompileAction command line expansion cannot fail.");
}
}