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

added bzlmod support #797

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

added bzlmod support #797

wants to merge 1 commit into from

Conversation

zaucy
Copy link

@zaucy zaucy commented Aug 28, 2023

Description

This adds support for the latest bazel MODULE system (bzlmod) and refactors the older minimal bazel support. Consuming doctest in a bazel project becomes as simple as adding this to a users MODULE.bazel file:

bazel_dep(name = "doctest", version = "2.4.11")

Additionally I added GitHub actions to help with bazel integration. I could only get the 1 example to work correctly, but I think that example would be the most common use case when using bazel.

GitHub Issues

prepares for #687, but does not close it until actually submitted to the BCR

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Merging #797 (006d692) into dev (ae7a135) will decrease coverage by 0.01%.
Report is 2 commits behind head on dev.
The diff coverage is n/a.

@@            Coverage Diff             @@
##              dev     #797      +/-   ##
==========================================
- Coverage   92.11%   92.11%   -0.01%     
==========================================
  Files           2        2              
  Lines        2169     2168       -1     
==========================================
- Hits         1998     1997       -1     
  Misses        171      171              

see 1 file with indirect coverage changes

Comment on lines +47 to +58
# update MODULE.bazel file with version
print("updating the MODULE.bazel file")
bzlmod_contents = ""
for line in fileinput.input(["../MODULE.bazel"]):
if line.startswith(" version = "):
bzlmod_contents += " version = \"" + version + "\",\n"
else:
bzlmod_contents += line

bzlmod = open("../MODULE.bazel", "w")
bzlmod.write(bzlmod_contents)
bzlmod.close()
Copy link
Author

Choose a reason for hiding this comment

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

I didn't test this, but it's almost an exact copy of the meson.build above!

@zaucy
Copy link
Author

zaucy commented Aug 29, 2023

The codecov report seems to be inaccurate. It's complaining about a file that I haven't touched 😅

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

Successfully merging this pull request may close these issues.

None yet

1 participant