use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testTargetWithGeneratedSources.
@Test
public void testTargetWithGeneratedSources() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:library"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of(gen("foo/bar/library.cc")))).build();
assertThatResolving(projectView, targetMap).producesNoConfigurations();
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method changeCompilerVersion_testIncrementalUpdateNoReuse.
@Test
public void changeCompilerVersion_testIncrementalUpdateNoReuse() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:binary"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc")))).build();
ImmutableList<BlazeResolveConfiguration> noReusedConfigurations = ImmutableList.of();
assertThatResolving(projectView, targetMap).reusedConfigurations(noReusedConfigurations, "//foo/bar:binary");
compilerVersionChecker.setCompilerVersion("cc modified version");
assertThatResolving(projectView, targetMap).reusedConfigurations(noReusedConfigurations, "//foo/bar:binary");
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testSingleSourceTarget.
@Test
public void testSingleSourceTarget() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:binary"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc")))).build();
assertThatResolving(projectView, targetMap).producesConfigurationsFor("//foo/bar:binary");
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testTargetWithMixedSources.
@Test
public void testTargetWithMixedSources() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:binary"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc"), gen("foo/bar/generated.cc")))).build();
assertThatResolving(projectView, targetMap).producesConfigurationsFor("//foo/bar:binary");
}
use of com.google.idea.blaze.base.projectview.ProjectView in project intellij by bazelbuild.
the class BlazeConfigurationResolverTest method testSingleSourceTargetWithSourceDependencies.
@Test
public void testSingleSourceTargetWithSourceDependencies() {
ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:binary"));
TargetMap targetMap = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc"))).addDependency("//foo/bar:library").addDependency("//third_party:library")).addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of(src("foo/bar/library.cc")), ImmutableList.of("SOME_DEFINE=1"))).addTarget(createCcTarget("//third_party:library", Kind.CC_LIBRARY, ImmutableList.of(src("third_party/library.cc")))).build();
assertThatResolving(projectView, targetMap).producesConfigurationsFor("//foo/bar:binary", "//foo/bar:library");
}
Aggregations