Class JavaLibraryClasspathProvider

  • public class JavaLibraryClasspathProvider
    extends Object
    • Method Detail

      • getTransitiveClasspathDeps

        public static<JavaLibrary> getTransitiveClasspathDeps​(JavaLibrary javaLibrary)
      • getClasspathDeps

        public static<JavaLibrary> getClasspathDeps​(Iterable<BuildRule> deps)
        Include the classpath entries from all JavaLibraryRules that have a direct line of lineage to this rule through other JavaLibraryRules. For example, in the following dependency graph:

              /   \
             B     C
            / \   / \
            D E   F G

        If all of the nodes correspond to BuildRules that implement JavaLibraryRule except for B (suppose B is a Genrule), then A's classpath will include C, F, and G, but not D and E. This is because D and E are used to generate B, but do not contribute .class files to things that depend on B. However, if C depended on E as well as F and G, then E would be included in A's classpath.

      • getClasspathsFromLibraries

        public static<SourcePath> getClasspathsFromLibraries​(Iterable<JavaLibrary> libraries)
        Given libraries that may contribute classpaths, visit them and collect the classpaths.

        This is used to generate transitive classpaths from library discovered in a previous traversal.

      • getAllReachableJavaLibraries

        public static<JavaLibrary> getAllReachableJavaLibraries​(Iterable<? extends BuildRule> rules)
        Return the classpath, including traversing any provided_deps edges and non-java edges