bazel-contrib / rules_jvm_external

Bazel rules to resolve, fetch and export Maven artifacts
Apache License 2.0
337 stars 256 forks source link

pass toolchains to maven_* rules #1264

Closed elwin closed 1 month ago

elwin commented 1 month ago

e.g. to pass a config setting for variabel substitution

string_flag(
    name = "version",
    build_setting_default = "0.0.0-dev",
    make_variable = "VERSION",
    visibility = ["//visibility:public"],
)

maven_bom(
    name = "bom",
    dependencies_maven_coordinates = "com.examplet:bom:$(VERSION)",
    java_exports = [
        # ...
    ],
    maven_coordinates = "com.examplet:bom:$(VERSION)",
    toolchains = [":version"],
)
jin commented 1 month ago

Can you add a test that utilizes this code path? Something in your example that expands the templated variable with a defualt value will be good.

elwin commented 1 month ago

Hej Jin, apologies for the delayed response, somehow I'm not receiving notifications on GitHub.

I've just added a test with it in action and re-generated the docs, please let me know if there's anything missing! :)