Skip to content

Latest commit

 

History

History
73 lines (69 loc) · 2.66 KB

thrift_library.md

File metadata and controls

73 lines (69 loc) · 2.66 KB

thrift_library

load("@io_bazel_rules_scala//thrift:thrift.bzl", "thrift_library")
thrift_library(
    name,
    srcs,
    deps,
    absolute_prefix,
    absolute_prefixes
)

thrift_library generates a thrift source zip file.

It should be consumed by a thrift compiler like scrooge_scala_library in its deps.

Attributes
name

Name, required

A unique name for this target

srcs

List of labels, required

List of Thrift .thrift source files used to build the target

deps

List of labels, optional

List of other thrift dependencies that this thrift depends on. Also can include `scroogle_scala_import` targets, containing additional `thrift_jars` (which will be compiled) and/or `scala_jars` needed at compile time (such as Finagle).

absolute_prefix

string; optional (deprecated in favor of absolute_prefixes)

This string acts as a wildcard expression of the form *`string_value` that is removed from the start of the path. Example: thrift is at `a/b/c/d/e/A.thrift` , prefix of `b/c/d`. Will mean other thrift targets can refer to this thrift at `e/A.thrift`.

absolute_prefixes

List of strings; optional

Each of these strings acts as a wildcard expression of the form *string_value that is removed from the start of the path. Example: thrift is at a/b/c/d/e/A.thrift , prefix of b/c/d. Will mean other thrift targets can refer to this thrift at e/A.thrift. Exactly one of these must match all thrift paths within the target, more than one or zero will fail the build. The main use case to have several here is to make a macro target you can share across several indvidual thrift_library, if source path is /src/thrift or /src/main/thrift it can strip off the prefix without users needing to configure it per target.