Giter VIP home page Giter VIP logo

rules_lombok_java_library's Introduction

Introduction

Bazel rule to run delombok over a set of lombok source files that can be used as source to a java_library even on Bazel 4+

Usage

In your workspace add this lines:

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

LOMBOK_RULES_VERSION = "0.0.2"
LOMBOK_RULES_SHA = "d28a6bb946be9780637df5b3e9acd12873ca8bbdceecd1f6d41859ac23a0c30b"
http_archive(
    name="rules_lombok_java_library",
    urls = ["https://github.com/bookingcom/rules_lombok_java_library/archive/refs/tags/v%s.tar.gz" % LOMBOK_RULES_VERSION],
    sha256 = LOMBOK_RULES_SHA,
    strip_prefix = "rules_lombok_java_library-%s" % LOMBOK_RULES_VERSION
)

# if you're not retrieving lombok from another source like jvm_rules_external maven repos
# then add the following two lines
# load("@rules_lombok_java_library//:deps.bzl", "lombok_java_library_dependencies")
# lombok_java_library_dependencies()

In your build file you do something like:

load("@rules_lombok_java_library//:rules.bzl", "lombok_java_library")

lombok_java_library(
    name = "lombok_java_library",
    srcs = ["LombokExample.java"],
    lombok_jar = "@maven//org_projectlombok_lombok",
    deps = [
        "@maven//org_projectlombok_lombok", # we're using lombok log support for instance
        "@maven//:org_slf4j_slf4j_api"
    ]
)

java_library(
    name = "lombok_example",
    srcs = [":lombok_java_library"] + OTHER_SOURCES,
)

Building and running the example

$ git clone https://github.com/bookingcom/rules_lombok_java_library
$ cd rules_lombok_java_library
$ bazel run //example/src/main/java/com/example:runner
....
INFO: Build completed successfully, 1 total action
Hi!
[main] INFO com.example.cmdline.LombokExample - static builder
Test

rules_lombok_java_library's People

Contributors

manuelnaranjo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.