Buck: prebuilt_jar()
Support Ukraine. Help Provide Humanitarian Aid to Ukraine.

prebuilt_jar()

A prebuilt_jar() rule is used to identify a JAR file that is checked into our repository as a precompiled binary rather than one that is built from source by Buck. Frequently, these are used to reference third-party JAR files (such as junit.jar) and are used as dependencies of java_library() rules.

Arguments

  • name (required) #

    The short name for this build target.

  • binary_jar (required) #

    Path to the pre-built JAR file.

  • source_jar (defaults to None) #

    Path to a JAR file that contains the .java files to create the .class in the binary_jar. This is frequently provided for debugging purposes.

  • javadoc_url (defaults to None) #

    URL to the Javadoc for the .class files in the binary_jar.

  • deps (defaults to []) #

    Rules that must be built before this rule. Because the binary_jar is already built, there should be nothing to build, so this should be empty.

  • visibility (defaults to []) #

    List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their deps or exported_deps attributes. For more information, see visibility.

  • licenses (defaults to []) #

    Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query.

  • labels (defaults to []) #

    Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using buck query attrfilter().

Examples

prebuilt_jar(
  name = 'junit',
  binary_jar = 'junit-4.8.2.jar',
  source_jar = 'junit-4.8.2-sources.jar',
  javadoc_url = 'http://kentbeck.github.com/junit/javadoc/4.8/',
)

java_library(
  name = 'tests',
  srcs = glob(['tests/**/*Test.java']),
  deps = [
    ':junit',
  ],
)