openapi-generator-bazel icon indicating copy to clipboard operation
openapi-generator-bazel copied to clipboard

bzlmod support

Open Sovietaced opened this issue 1 year ago • 4 comments

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.

Sovietaced avatar Jul 21 '23 19:07 Sovietaced

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 avatar Jul 09 '24 07:07 wing328

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

wing328 avatar Jul 09 '24 07:07 wing328

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.

geoffreygarrett avatar Jul 27 '24 15:07 geoffreygarrett

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

Sovietaced avatar Jul 27 '24 16:07 Sovietaced