All Projects → higherkindness → rules_scala

higherkindness / rules_scala

Licence: Apache-2.0 license
Robust and featureful Bazel rules for Scala

Programming Languages

Starlark
911 projects
scala
5932 projects
shell
77523 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to rules scala

rules openapi
🍃 bazel rules for generating code from openapi specifications
Stars: ✭ 49 (-20.97%)
Mutual labels:  bazel, bazel-rules
rules elm
Bazel rules for building web applications written in Elm
Stars: ✭ 22 (-64.52%)
Mutual labels:  bazel, bazel-rules
bazel-maven-proxy
A local (read-only) proxy for Bazel to access Maven resources behind a secure repository or from the local Maven repository
Stars: ✭ 22 (-64.52%)
Mutual labels:  bazel, bazel-rules
Rules kotlin
Bazel rules for Kotlin
Stars: ✭ 235 (+279.03%)
Mutual labels:  bazel, bazel-rules
rules helm
rules_helm: Bazel rules for managing helm charts
Stars: ✭ 46 (-25.81%)
Mutual labels:  bazel, bazel-rules
Rules rust
Rust rules for Bazel
Stars: ✭ 241 (+288.71%)
Mutual labels:  bazel, bazel-rules
rules antlr
ANTLR rules for Bazel
Stars: ✭ 24 (-61.29%)
Mutual labels:  bazel, bazel-rules
Rules protobuf
Bazel rules for building protocol buffers and gRPC services (java, c++, go, ...)
Stars: ✭ 206 (+232.26%)
Mutual labels:  bazel, bazel-rules
rules dart
Dart rules for Bazel
Stars: ✭ 35 (-43.55%)
Mutual labels:  bazel, bazel-rules
rules ocaml
OCaml build rules for Bazel
Stars: ✭ 38 (-38.71%)
Mutual labels:  bazel, bazel-rules
Rules python
Experimental Bazel Python Rules
Stars: ✭ 233 (+275.81%)
Mutual labels:  bazel, bazel-rules
rules gitops
This repository contains rules for continuous, GitOps driven Kubernetes deployments.
Stars: ✭ 112 (+80.65%)
Mutual labels:  bazel, bazel-rules
Rules k8s
This repository contains rules for interacting with Kubernetes configurations / clusters.
Stars: ✭ 222 (+258.06%)
Mutual labels:  bazel, bazel-rules
rules java
Java rules for Bazel
Stars: ✭ 44 (-29.03%)
Mutual labels:  bazel, bazel-rules
Rules apple
Bazel rules to build apps for Apple platforms.
Stars: ✭ 217 (+250%)
Mutual labels:  bazel, bazel-rules
rules proto grpc
Bazel rules for building Protobuf and gRPC code and libraries from proto_library targets
Stars: ✭ 201 (+224.19%)
Mutual labels:  bazel, bazel-rules
Rules kotlin
Bazel rules for Kotlin
Stars: ✭ 162 (+161.29%)
Mutual labels:  bazel, bazel-rules
Rules haskell
Haskell rules for Bazel.
Stars: ✭ 196 (+216.13%)
Mutual labels:  bazel, bazel-rules
bazel-latex
Bazel build system rules for LaTeX
Stars: ✭ 67 (+8.06%)
Mutual labels:  bazel, bazel-rules
rules sass
Sass rules for Bazel
Stars: ✭ 47 (-24.19%)
Mutual labels:  bazel, bazel-rules

higherkindness/rules_scala

Build Status

higherkindness/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.

higherkindness/rules_scala allows for the optional use of Zinc incremental compilation to provide a stepping stone for these projects as they migrate to Bazel.

higherkindness/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

WORKSPACE

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Load rules scala annex
rules_scala_annex_version = "ae99fcb08bbddfc24fef00d7b13f6c065e1df8d5"
rules_scala_annex_sha256 = "1630fc7ecc7a4ffeabcdef73c7600eab9cf3fd2377db1f69b8ce1927560211ff"
http_archive(
    name = "rules_scala_annex",
    sha256 = rules_scala_annex_sha256,
    strip_prefix = "rules_scala-{}".format(rules_scala_annex_version),
    url = "https://github.com/higherkindness/rules_scala/archive/{}.zip".format(rules_scala_annex_version),
)

rules_jvm_external_tag = "2.9"
rules_jvm_external_sha256 = "e5b97a31a3e8feed91636f42e19b11c49487b85e5de2f387c999ea14d77c7f45"
http_archive(
    name = "rules_jvm_external",
    sha256 = rules_jvm_external_sha256,
    strip_prefix = "rules_jvm_external-{}".format(rules_jvm_external_tag),
    url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.zip".format(rules_jvm_external_tag),
)

load("@rules_scala_annex//rules/scala:workspace.bzl", "scala_register_toolchains", "scala_repositories")
scala_repositories()
load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install")
annex_pinned_maven_install()
scala_register_toolchains()

load("@rules_scala_annex//rules/scalafmt:workspace.bzl", "scalafmt_default_config", "scalafmt_repositories")
scalafmt_repositories()
load("@annex_scalafmt//:defs.bzl", annex_scalafmt_pinned_maven_install = "pinned_maven_install")
annex_scalafmt_pinned_maven_install()
scalafmt_default_config()

load("@rules_scala_annex//rules/scala_proto:workspace.bzl", "scala_proto_register_toolchains", "scala_proto_repositories",)
scala_proto_repositories()
load("@annex_proto//:defs.bzl", annex_proto_pinned_maven_install = "pinned_maven_install")
annex_proto_pinned_maven_install()
scala_proto_register_toolchains()

# Load bazel skylib and google protobuf
bazel_skylib_tag = "1.0.2"
bazel_skylib_sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44"
http_archive(
    name = "bazel_skylib",
    sha256 = bazel_skylib_sha256,
    urls = [
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{tag}/bazel-skylib-{tag}.tar.gz".format(tag = bazel_skylib_tag),
        "https://github.com/bazelbuild/bazel-skylib/releases/download/{tag}/bazel-skylib-{tag}.tar.gz".format(tag = bazel_skylib_tag),
    ],
)

protobuf_tag = "3.10.1"
protobuf_sha256 = "678d91d8a939a1ef9cb268e1f20c14cd55e40361dc397bb5881e4e1e532679b1"
http_archive(
    name = "com_google_protobuf",
    sha256 = protobuf_sha256,
    strip_prefix = "protobuf-{}".format(protobuf_tag),
    type = "zip",
    url = "https://github.com/protocolbuffers/protobuf/archive/v{}.zip".format(protobuf_tag),
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()

# Specify the scala compiler we wish to use; in this case, we'll use the default one specified in rules_scala_annex
bind(
    name = "default_scala",
    actual = "@rules_scala_annex//src/main/scala:zinc_2_12_10",
)

BUILD

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

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

Further Documentation

See contributing guidlines for help on contributing to this project.

For all rules and attributes, see the Stardoc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].