Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Latest commit

 

History

History
167 lines (163 loc) · 5.36 KB

scala_binary.md

File metadata and controls

167 lines (163 loc) · 5.36 KB

scala_binary

scala_binary(
    name,
    srcs,
    deps,
    runtime_deps,
    data,
    main_class,
    resources,
    resource_strip_prefix,
    scalacopts,
    jvm_flags,
    scalac_jvm_flags,
    javac_jvm_flags,
    unused_dependency_checker_mode
)

scala_binary generates a Scala executable. It may depend on scala_library, scala_macro_library and java_library rules.

A scala_binary requires a main_class attribute.

Attributes
name

Name, required

A unique name for this target

srcs

List of labels, required

List of Scala .scala source files used to build the binary

deps

List of labels, optional

List of other libraries to linked to this binary target. These must be jvm targets (scala_library, java_library, java_import, etc...)

runtime_deps

List of labels, optional

List of other libraries to put on the classpath only at runtime. This is rarely needed in Scala. These must be jvm targets (scala_library, java_library, java_import, etc...)

data

List of labels, optional

List of files needed by this rule at runtime.

main_class

String, required

Name of class with main() method to use as an entry point

The value of this attribute is a class name, not a source file. The class must be available at runtime: it may be compiled by this rule (from srcs) or provided by direct or transitive dependencies (through deps). If the class is unavailable, the binary will fail at runtime; there is no build-time check.

resources

List of labels; optional

A list of data files to be included in the JAR.

resource_strip_prefix

String; optional

The path prefix to strip from Java resources. If specified, this path prefix is stripped from every file in the `resources` attribute. It is an error for a resource file not to be under this directory.

scalacopts

List of strings; optional

Extra compiler options for this binary to be passed to scalac. Subject to Make variable substitution and Bourne shell tokenization.

jvm_flags

List of strings; optional

List of JVM flags to be passed to the executing JVM. Subject to Make variable substitution and Bourne shell tokenization.

scalac_jvm_flags

List of strings; optional

List of JVM flags to be passed to scalac after the scalacopts. Subject to Make variable substitution and Bourne shell tokenization.

javac_jvm_flags

List of strings; optional

List of JVM flags to be passed to javac after the javacopts. Subject to Make variable substitution and Bourne shell tokenization.

unused_dependency_checker_mode

String; optional

Enable unused dependency checking (see Unused dependency checking). Possible values are: off, warn and error.