OpenAPITools / openapi-generator-bazel

Bazel plugin for OpenAPI Generator
Apache License 2.0
66 stars 46 forks source link

bzlmod support #51

Open Sovietaced opened 1 year ago

Sovietaced commented 1 year ago

This is my attempt at adding bzlmod support for this library https://github.com/OpenAPITools/openapi-generator-bazel/issues/50.

Context around changes

I moved away from using jvm_maven_import_external because it did not seem to support bzlmod and only generated a WORKSPACE file. So I migrated the code to using rules_jvm_external.

Open issues

  1. I haven't looked into it yet but using the maven_install.json lock file doesn't seem to work for non-bzlmod usage of rules_jvm_external. I'm not sure why. Ideally I would like to preserve the hermiticity of the original code.

  2. Another thing that I haven't figured out it how someone would customize the version of the CLI to use when running under bzlmod. I'd think this would happen with a module extension, but I'm not able to find a way to trigger the extension logic in my attempts.

  3. I still need to cleanup the README.

Testing

Tested locally (worked with commenting out WORKSPACE content as well)

jparraga@U-2AQ9340S9KI77:~/code/openapi-generator-bazel$ bazel build //... --experimental_enable_bzlmod
INFO: Analyzed 8 targets (80 packages loaded, 835 targets configured).
INFO: Found 8 targets...
INFO: Elapsed time: 2.018s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action

I'm relatively new to Bazel so there are a few things I'm not sure how to solve.

wing328 commented 2 months ago

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

wing328 commented 2 months ago

please resolve the merge conflicts when you've time. thanks

geoffreygarrett commented 1 month ago

Hi, @wing328 @Sovietaced, I was about to do this myself as I wanted it integrated in my repo. Any thoughts on moving this forward? More than happy to take over the merging.

Sovietaced commented 1 month ago

@geoffreygarrett feel free to take the changes and merge them.