// 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.analysis; /** * Contains rolled-up data about the transitive closure of a configured target. * * For more information about how analysis works, see * {@link com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory}. * TransitiveInfoProviders need to be serializable, and for that reason they must conform to * the following restrictions: * * * *

Some typical uses of this interface are: *

* *

Note that if implemented naively, this would result in the memory requirements * being O(n^2): in a long dependency chain, if every target adds one single artifact, storing the * transitive closures of every rule would take 1+2+3+...+n-1+n = O(n^2) memory. * *

In order to avoid this, we introduce the concept of nested sets, {@link * com.google.devtools.build.lib.collect.nestedset.NestedSet}. A nested set is an immutable * data structure that can contain direct members and other nested sets (recursively). Nested sets * are iterable and can be flattened into ordered sets, where the order depends on which * implementation of NestedSet you pick. * * @see TransitiveInfoCollection * @see com.google.devtools.build.lib.analysis.RuleConfiguredTargetFactory */ public interface TransitiveInfoProvider { }