Skip to content

Commit adfa90e

Browse files
committed
Add support for older versions with bzlmod
1 parent 7d26362 commit adfa90e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

extension.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
44

55
def get_root_module(module_ctx):
66
for mod in module_ctx.modules:
7-
if mod.is_root:
7+
if mod.is_root and hasattr(mod.tags.client, "version"):
8+
return mod
9+
for mod in module_ctx.modules:
10+
for tags in mod.tags.client:
811
return mod
9-
return None
1012

1113
def _openapi_generator_impl(module_ctx):
1214
wanted_module = get_root_module(module_ctx)
13-
if wanted_module == None:
14-
wanted_module = module_ctx.modules[0]
1515

1616
for install in wanted_module.tags.client:
1717
jvm_maven_import_external(

internal/test/bcr/MODULE.bazel.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/test/older-version/MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)