Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpringBoot rule should pull through deps and runtime_deps from java_library #31

Closed
plaird opened this issue Apr 8, 2020 · 4 comments
Closed

Comments

@plaird
Copy link
Contributor

plaird commented Apr 8, 2020

Given my base lib definition here:

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

I have to construct the deps attribute for my springboot rule invocation like this:

springboot(
    name = "test-service",
    boot_app_class = "com.salesforce.services.test.TestServiceMain",
    java_library = ":base_lib",
    deps = deps + runtime_deps,
)

I shouldn't have to provide the deps or runtime_deps in the deps attribute, the rule should do that automatically.

@plaird plaird changed the title SpringBoot rule should pull through runtime_deps from java_library SpringBoot rule should pull through deps and runtime_deps from java_library Apr 8, 2020
@yishanhe
Copy link

should the springboot rule also exposes only runtime_deps instead of deps?

@plaird
Copy link
Contributor Author

plaird commented Oct 14, 2020

@yishanhe are you consuming the output of springboot rule somehow in other java_* rules? for us, the springboot rule is always a terminal node in the dependency graph, aside from docker rules. Since the springboot rule outputs a self-contained jar with all the dependencies contained within, I don't think there is a use case where it needs to expose deps or runtime_deps to downstream rules?

@yishanhe
Copy link

yishanhe commented Dec 14, 2020

@plaird , Thank you for your explanation, and it is great to see this one gets improved.

A follow-up question, would it be clear if we put the deps in this way

java_library(
    name = "helloworld_lib",
    srcs = glob(["src/main/java/**/*.java"]),
    resources = glob(["src/main/resources/**"]),
    deps = lib_deps,
    runtime_deps = springboot_deps,
)

springboot(
    name = "helloworld",
    boot_app_class = "com.sample.SampleMain",
    java_library = ":helloworld_lib",
    # NO DEPS NEED TO BE DECLARED HERE
)

Thanks

@plaird
Copy link
Contributor Author

plaird commented Dec 20, 2020

Yes, I can add the comment to the example, that will make it more clear. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants