Skip to content

Latest commit

 

History

History
92 lines (71 loc) · 3.97 KB

README.md

File metadata and controls

92 lines (71 loc) · 3.97 KB

lucidsoftware/rules_scala

Build Status

Previously known as higherkindness/rules_scala, lucidsoftware/rules_scala evolved, in part, from the need for Bazel adoption support for large, monorepo Scala projects. Bazel is wonderful because it makes use of parallelism and caching to vastly improve build times. However, to see these benefits, a project must first be broken down into tiny packages and make use of fine-grained dependencies. This is not always a realistic short-term goal for large, monorepo Scala projects.

lucidsoftware/rules_scala allows for the optional use of Zinc incremental compilation to provide a stepping stone for these projects as they migrate to Bazel. Although we've verified it to be correct and determinisitc, we recommend leaving this disabled, as fine-grained and isolated targets are more in-line with the Bazel philosophy.

lucidsoftware/rules_scala is written with maintainability and accessibility in mind. It aims to facilitate the transition to Bazel, and to satisfy use cases throughout the Scala ecosystem.

Principles

  1. Support the breadth of the Scala ecosystem.
  2. Follow Bazel best practices.
  3. Be accessible and maintainable.
  4. Have high-quality documentation.

If the right design principles are kept, implementing additional features should be simple and straightforward.

Features

Usage

lucidsoftware/rules_scala isn't on the Bazel Central Registry, so you'll need to pull it in via archive_override. Be sure to replace <COMMIT> with the latest commit on lucid-master and <INTEGRITY> with the hash suggested by Bazel after the dependency is first loaded.

MODULE.bazel

bazel_dep(name = "rules_scala_annex")

rules_scala_annex_version = "<COMMIT>"

archive_override(
    module_name = "rules_scala_annex",
    integrity = "<INTEGRITY>",
    strip_prefix = "rules_scala-{}".format(rules_scala_annex_version),
    urls = ["https://github.com/lucidsoftware/rules_scala/archive/refs/heads/{}.zip".format(rules_scala_annex_version)],
)

BUILD

load("@rules_scala_annex//rules:scala.bzl", "scala_library")

scala_library(
    name = "example",
    srcs = glob(["*.scala"])
)

Further Documentation

See contributing guidelines for help on contributing to this project.

For all rules and attributes, see the Stardoc.