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

Provide JavaInfo so jarjar targets can be a dep of scala targets. #4

Merged
merged 1 commit into from
Jul 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion jar_jar.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ def _jar_jar_impl(ctx):
progress_message="jarjar %s" % ctx.label,
arguments=["process", ctx.file.rules.path, ctx.file.input_jar.path, ctx.outputs.jar.path])

return JavaInfo(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if we do providers like this we might also want to return DefaultInfo with the outputs.jar as well.

Want to follow up with that? (Note you can return a list of providers)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup will do!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't wait, thanks!

output_jar = ctx.outputs.jar,
compile_jar = ctx.outputs.jar
)

jar_jar = rule(
implementation = _jar_jar_impl,
attrs = {
Expand All @@ -16,7 +21,8 @@ jar_jar = rule(
},
outputs = {
"jar": "%{name}.jar"
})
},
provides = [JavaInfo])

def _mvn_name(coord):
nocolon = "_".join(coord.split(":"))
Expand Down