// Copyright 2014 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.packages; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.LinkedHashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; import com.google.common.collect.SetMultimap; import com.google.devtools.build.lib.analysis.config.transitions.ConfigurationTransition; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; import com.google.devtools.build.lib.packages.ConfigurationFragmentPolicy.MissingFragmentPolicy; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; import com.google.devtools.build.lib.syntax.Type; import com.google.devtools.build.lib.syntax.Type.LabelClass; import com.google.devtools.build.lib.syntax.Type.LabelVisitor; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import javax.annotation.Nullable; /** * The definition of an aspect (see {@link Aspect} for more information). * *

Contains enough information to build up the configured target graph except for the actual way * to build the Skyframe node (that is the territory of {@link com.google.devtools.build.lib.view * AspectFactory}). In particular: * *

* *

The way to build the Skyframe node is not here because this data needs to be accessible from * the {@code .packages} package and that one requires references to the {@code .view} package. */ @AutoCodec @Immutable public final class AspectDefinition { private final AspectClass aspectClass; private final AdvertisedProviderSet advertisedProviders; private final RequiredProviders requiredProviders; private final RequiredProviders requiredProvidersForAspects; private final ImmutableMap attributes; private final ImmutableSet

*/ @Nullable private final ImmutableSet restrictToAttributes; @Nullable private final ConfigurationFragmentPolicy configurationFragmentPolicy; private final boolean applyToFiles; public AdvertisedProviderSet getAdvertisedProviders() { return advertisedProviders; } @AutoCodec.VisibleForSerialization AspectDefinition( AspectClass aspectClass, AdvertisedProviderSet advertisedProviders, RequiredProviders requiredProviders, RequiredProviders requiredProvidersForAspects, ImmutableMap attributes, ImmutableSet