Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bazel/rules/gomock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ def gomock(name, out, library = None, source_importpath = "", source = None, int
package = package,
self_package = self_package,
mockgen_tool = mockgen_tool,
mockgen_args = mockgen_args,
copyright_file = copyright_file,
mock_names = mock_names,
**kwargs
Expand All @@ -239,6 +240,7 @@ def _gomock_archive_impl(ctx):
args.add("-destination", ctx.outputs.out)
args.add("-package", ctx.attr.package)
args.add("-self_package", ctx.attr.self_package)
args.add_all(ctx.attr.mockgen_args)
args.add(ctx.attr.library[GoInfo].importpath)
args.add_joined(ctx.attr.interfaces, join_with = ",")

Expand Down Expand Up @@ -297,6 +299,10 @@ _gomock_archive = rule(
executable = True,
cfg = "exec",
),
"mockgen_args": attr.string_list(
doc = "Additional arguments to pass to the mockgen tool",
mandatory = False,
),
"use_underlying_names": attr.bool(
doc = "Use alias underlying type names in generated mocks instead of the alias names directly",
default = False,
Expand Down