Search in sources :

Example 21 with Aspect

use of com.google.devtools.build.lib.packages.Aspect in project bazel by bazelbuild.

the class AspectCollectionTest method recursive.

/**
   * a3 wants itself.
   */
@Test
public void recursive() throws Exception {
    Aspect a1 = createAspect("a1");
    Aspect a2 = createAspect("a2");
    Aspect a3 = createAspect("a3", "a3");
    AspectCollection collection = AspectCollection.create(ImmutableList.of(a1, a2, a3), ImmutableSet.of(a3.getDescriptor()));
    validateAspectCollection(collection, ImmutableList.of(a3), ImmutableList.of(a3), expectDeps(a3));
}
Also used : Aspect(com.google.devtools.build.lib.packages.Aspect) Test(org.junit.Test)

Example 22 with Aspect

use of com.google.devtools.build.lib.packages.Aspect in project bazel by bazelbuild.

the class AspectCollectionTest method linearAspectPath2.

/**
   * a3 wants a2, a2 wants a1, a1 wants no one, path is a1, a2, a3.
   */
@Test
public void linearAspectPath2() throws Exception {
    Aspect a1 = createAspect("a1");
    Aspect a2 = createAspect("a2", "a1");
    Aspect a3 = createAspect("a3", "a2");
    AspectCollection collection = AspectCollection.create(ImmutableList.of(a1, a2, a3), ImmutableSet.of(a3.getDescriptor()));
    validateAspectCollection(collection, ImmutableList.of(a1, a2, a3), ImmutableList.of(a3), expectDeps(a3, a2), expectDeps(a2, a1), expectDeps(a1));
}
Also used : Aspect(com.google.devtools.build.lib.packages.Aspect) Test(org.junit.Test)

Aggregations

Aspect (com.google.devtools.build.lib.packages.Aspect)22 Test (org.junit.Test)14 AspectCycleOnPathException (com.google.devtools.build.lib.analysis.AspectCollection.AspectCycleOnPathException)5 AspectDescriptor (com.google.devtools.build.lib.packages.AspectDescriptor)5 Attribute (com.google.devtools.build.lib.packages.Attribute)4 Rule (com.google.devtools.build.lib.packages.Rule)4 ImmutableList (com.google.common.collect.ImmutableList)3 Label (com.google.devtools.build.lib.cmdline.Label)3 ImmutableSet (com.google.common.collect.ImmutableSet)2 Package (com.google.devtools.build.lib.packages.Package)2 Target (com.google.devtools.build.lib.packages.Target)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 AspectDeps (com.google.devtools.build.lib.analysis.AspectCollection.AspectDeps)1 ConfiguredAspect (com.google.devtools.build.lib.analysis.ConfiguredAspect)1 ConfiguredAspectFactory (com.google.devtools.build.lib.analysis.ConfiguredAspectFactory)1 ConfiguredTarget (com.google.devtools.build.lib.analysis.ConfiguredTarget)1 InconsistentAspectOrderException (com.google.devtools.build.lib.analysis.DependencyResolver.InconsistentAspectOrderException)1 MergedConfiguredTarget (com.google.devtools.build.lib.analysis.MergedConfiguredTarget)1