Skip to content
New issue

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

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

Already on GitHub? # to your account

Use attr.output instead of deprecated outputs dict #21

Merged

Conversation

fmeum
Copy link
Contributor

@fmeum fmeum commented Oct 15, 2022

Backwards compatibility is preserved by wrapping the jar_jar rule in a
macro that populates the new output_jar attribute if the user doesn't
set it. The output of a jar_jar target can still be referenced as a
file target as demonstrated by new tests.

In addition, user can now provide a custom name for the output jar.

@fmeum
Copy link
Contributor Author

fmeum commented Oct 15, 2022

Stacked on #20, please review that one first.

Backwards compatibility is preserved by wrapping the `jar_jar` rule in a
macro that populates the new `output_jar` attribute if the user doesn't
set it. The output of a `jar_jar` target can still be referenced as a
file target as demonstrated by new tests.

In addition, user can now provide a custom name for the output jar.
@fmeum fmeum force-pushed the prepare-for-bzlmod-2 branch from ee75902 to cbe5a26 Compare October 15, 2022 20:18
@fmeum fmeum marked this pull request as ready for review October 15, 2022 20:21
@fmeum fmeum requested a review from johnynek October 15, 2022 20:27
return [
JavaInfo(
output_jar = ctx.outputs.output_jar,
compile_jar = ctx.outputs.output_jar,
Copy link
Collaborator

Choose a reason for hiding this comment

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

another update we should consider is using java_common to run ajar on the output jar to make a compile jar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did this in #24. The previous PR also broke a few tests I didn't notice, which is fixed by #22.

@johnynek johnynek merged commit 901c7d3 into bazeltools:master Oct 15, 2022
@fmeum fmeum deleted the prepare-for-bzlmod-2 branch October 15, 2022 21:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants