Created
March 31, 2023 11:57
-
-
Save petrul/3884b78834785289348bac2a2fef1888 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WORKSPACE: | |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | |
RULES_JVM_EXTERNAL_TAG = "4.3" | |
RULES_JVM_EXTERNAL_SHA = "6274687f6fc5783b589f56a2f1ed60de3ce1f99bc4e8f9edef3de43bdf7c6e74" | |
http_archive( | |
name = "rules_jvm_external", | |
sha256 = RULES_JVM_EXTERNAL_SHA, | |
strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, | |
url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG, | |
) | |
load("@rules_jvm_external//:defs.bzl", "maven_install") | |
maven_install( | |
artifacts = [ | |
"commons-io:commons-io:2.11.0", | |
"org.projectlombok:lombok:1.18.26" | |
], | |
repositories = [ "https://repo1.maven.org/maven2",], | |
) | |
BUILD | |
java_plugin( | |
name = "lombok_plugin", | |
generates_api = True, | |
processor_class = "lombok.launch.AnnotationProcessorHider$AnnotationProcessor", | |
deps = ["@maven//:org_projectlombok_lombok"], | |
) | |
java_library( | |
name = "lombok", | |
exported_plugins = [ | |
":lombok_plugin", | |
], | |
visibility = ["//visibility:public"], | |
exports = [ | |
"@maven//:org_projectlombok_lombok", | |
], | |
) | |
# sources build file | |
java_library( | |
name = "java_sourcces_with_lombok_anotations", | |
srcs = [ | |
"ClassWithLombokAnnotations.java", | |
], | |
deps = [ | |
"//:lombok", | |
], | |
) | |
java_binary( | |
name = "myapp", | |
main_class = "My.App", | |
srcs = glob([ "src/main/java/**/*.java"]), | |
deps = [ | |
"//:lombok", | |
'@maven//:commons_io_commons_io' | |
] | |
) | |
java_library( | |
name = "mylib", | |
srcs = glob( [ "src/main/java/**/*.java" ]), | |
deps = [ | |
"//:lombok", | |
'@maven//:commons_io_commons_io' , | |
] | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment