Search in sources :

Example 1 with OCResolveRootAndConfiguration

use of com.jetbrains.cidr.lang.workspace.OCResolveRootAndConfiguration in project intellij by bazelbuild.

the class BlazeConfigurationResolverTest method afterQueryingConfiguration_newTarget_testIncrementalUpdatePartlyReused.

@Test
public void afterQueryingConfiguration_newTarget_testIncrementalUpdatePartlyReused() {
    ProjectView projectView = projectView(directories("foo/bar"), targets("//foo/bar:*"));
    TargetMapBuilder targetMapBuilder = TargetMapBuilder.builder().addTarget(createCcToolchain()).addTarget(createCcTarget("//foo/bar:binary", Kind.CC_BINARY, ImmutableList.of(src("foo/bar/binary.cc"))));
    assertThatResolving(projectView, targetMapBuilder.build()).producesConfigurationsFor("//foo/bar:binary");
    Collection<BlazeResolveConfiguration> initialConfigurations = resolverResult.getAllConfigurations();
    // Make sure that if we *query* the configuration in some way, it doesn't affect its
    // compatibility / reusability. There may be caches attached to the configuration and those
    // should not be compared when checking equivalence.
    OCResolveConfiguration firstConfiguration = initialConfigurations.iterator().next();
    firstConfiguration.getLibraryHeadersRoots(new OCResolveRootAndConfiguration(firstConfiguration, OCLanguageKind.CPP));
    targetMapBuilder.addTarget(createCcTarget("//foo/bar:library", Kind.CC_LIBRARY, ImmutableList.of(src("foo/bar/library.cc")), ImmutableList.of("OTHER=1")));
    assertThatResolving(projectView, targetMapBuilder.build()).reusedConfigurations(initialConfigurations, "//foo/bar:library");
}
Also used : OCResolveConfiguration(com.jetbrains.cidr.lang.workspace.OCResolveConfiguration) TargetMapBuilder(com.google.idea.blaze.base.ideinfo.TargetMapBuilder) OCResolveRootAndConfiguration(com.jetbrains.cidr.lang.workspace.OCResolveRootAndConfiguration) ProjectView(com.google.idea.blaze.base.projectview.ProjectView) Test(org.junit.Test)

Aggregations

TargetMapBuilder (com.google.idea.blaze.base.ideinfo.TargetMapBuilder)1 ProjectView (com.google.idea.blaze.base.projectview.ProjectView)1 OCResolveConfiguration (com.jetbrains.cidr.lang.workspace.OCResolveConfiguration)1 OCResolveRootAndConfiguration (com.jetbrains.cidr.lang.workspace.OCResolveRootAndConfiguration)1 Test (org.junit.Test)1