use of com.google.devtools.intellij.ideinfo.IntellijIdeInfo.CIdeInfo in project bazel by bazelbuild.
the class AndroidStudioInfoAspectTest method testTransitiveCCLibraryWithDefines.
@Test
public void testTransitiveCCLibraryWithDefines() throws Exception {
scratch.file("com/google/example/BUILD", "cc_library(", " name = 'lib2',", " srcs = ['lib2/lib2.cc'],", " hdrs = ['lib2/lib2.h'],", " defines = ['COMPLEX_IMPL'],", ")", "cc_library(", " name = 'lib1',", " srcs = ['lib1/lib1.cc'],", " hdrs = ['lib1/lib1.h'],", " defines = ['VERSION2'],", " deps = [':lib2'],", ")");
Map<String, TargetIdeInfo> targetIdeInfos = buildIdeInfo("//com/google/example:lib1");
assertThat(targetIdeInfos).hasSize(3);
TargetIdeInfo lib1 = getTargetIdeInfoAndVerifyLabel("//com/google/example:lib1", targetIdeInfos);
assertThat(lib1.hasCIdeInfo()).isTrue();
CIdeInfo cIdeInfo = lib1.getCIdeInfo();
assertThat(cIdeInfo.getTargetDefineList()).containsExactly("VERSION2");
// Make sure our understanding of where this attributes show up in other providers is correct.
ProtocolStringList transDefineList = cIdeInfo.getTransitiveDefineList();
assertThat(transDefineList).contains("VERSION2");
assertThat(transDefineList).contains("COMPLEX_IMPL");
}
Aggregations