prebuilt_jar()
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 toNone) #Path to a JAR file that contains the
.javafiles to create the.classin thebinary_jar. This is frequently provided for debugging purposes.javadoc_url(defaults toNone) #URL to the Javadoc for the
.classfiles in thebinary_jar.deps(defaults to[]) #Rules that must be built before this rule. Because the
binary_jaris 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
depsorexported_depsattributes. 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',
],
)