scala_import(
name,
jars,
deps,
runtime_deps,
exports,
neverlink,
srcjar,
stamp,
)scala_import enables the use of precompiled Scala .jar files as dependencies for other Scala rules
like scala_library, similar to java_import from Java rules.
This rule reimplements java_import without support for ijars, which break Scala macros.
Generally, ijars don’t help much for external dependencies, which rarely change.
The jar's compile MANIFEST.MF is stamped with a Target-Label attribute for dependency tracking reporting.
This behaviour can be changed per scala_import target with an attribute or globally
with a setting:
bazel build //my:target --@rules_scala//scala/settings:stamp_scala_import=False| Attribute name | Description |
|---|---|
| name | Name, requiredA unique name for this target. |
| jars | List of labels, requiredList of .jar files to import, usually in //external. In practice, this usually corresponds to one jar. |
| deps | List of labels, optionalCompile time dependencies that were used to create the jar. |
| runtime_deps | List of labels, optionalRuntime dependencies that are needed for this library. |
| exports | List of labels, optionalList of targets to add to the dependencies of those that depend on this target. |
| neverlink | boolean, optional (default False)If true only use this library for compilation and not at runtime. |
| srcjar | Label, optionalThe source jar that was used to create the jar. |
| stamp | Label, optionalSetting to control Target-Label stamping into compile jar Manifest Default value is @rules_scala//scala/settings:stamp_scala_import |