salesforce / rules_spring

Bazel rule for building Spring Boot apps as a deployable jar
BSD 3-Clause "New" or "Revised" License
228 stars 49 forks source link

Update documentation to show how to reference this rule #21

Closed simontoens closed 4 years ago

simontoens commented 4 years ago

The documentation says this rule should be copied. However, it can referenced as a remote repository, using git_repository, which is nicer than copying.

plaird commented 4 years ago

Until we get to this doc, this is what we use internally:

WORKSPACE

git_repository( name = "bazel_springboot_rule", remote = "https://github.com/salesforce/bazel-springboot-rule.git", commit = "ed5908c25487cd5806a5583006864cde8cf312a3" )

BUILD

load("@bazel_springboot_rule//tools/springboot:springboot.bzl", "springboot")

springboot( name = "helloworld", boot_app_class = "com.salesforce.helloworld.HelloWorld", fail_on_duplicate_classes = True, java_library = ":base_lib", deps = deps, )

deps = [...]

java_library( name = "base_lib", srcs = glob(["src/main/java/*/.java"]), resources = glob(["src/main/resources/**"]), deps = deps, )

plaird commented 4 years ago

This was written into our docs here: https://github.com/salesforce/bazel-springboot-rule/tree/master/tools/springboot#add-the-rule-to-your-workspace