Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
Remove interfaces attribute from source mode (#42)
Browse files Browse the repository at this point in the history
* Remove interfaces attribute from source mode

* update readme
  • Loading branch information
linzhp authored and jmhodges committed Jan 10, 2020
1 parent 9e487dc commit ed0530b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ file with the interfaces you want in it.
|------|---------------|------|---------------|
| name | | string | The name of the target. (Required.) |
| library| | Label | The go_library to find the interfaces in. (Required.) |
| interfaces | | list of string | The names of interfaces in `library` to generate mocks for. (Required.) |
| interfaces | | list of string | The names of interfaces in `library` to generate mocks for. (Required when `source` is not provided) |
| source | | string | The Go source file that contains interfaces to be mocked. See the gomock documentation on `-source` for more information. |
| out | | string | The file name to give the generated output. (Required.) |
| package | | string | The package name to use in the generated output. See the gomock documentation on `-package` for more information. |
| imports | | string\_dict | Dictionary of keys of package names and values of import paths to use the keys as the identifier to use when the generated output uses the given import path. See the gomock documentation on `-imports` for more information. |
| imports | | string\_dict | Dictionary of keys of package names and values of import paths to use the keys as the identifier to use when the generated output uses the given import path. See the gomock documentation on `-imports` for more information. |
| self\_package | | string | The full import path for the generated code. See the gomock documentation on `-self_package` for more information. |
| mock\_names | | string\_dict | Dictionary of interface name to mock name pairs to change the output names of the mock objects. Mock names default to 'Mock' prepended to the name of the interface. See the gomock documentation on `-mock_names` for more information. |
| copyright\_file | | Label | The file containing the copyright to prepend to the generated output. See the gomock documentation on `-copyright_file` for more information. |
Expand Down
7 changes: 0 additions & 7 deletions gomock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ def _gomock_source_impl(ctx):
aux_files.append("{0}={1}".format(pkg, mapped_f))
args += ["-aux_files", ",".join(aux_files)]

args += [",".join(ctx.attr.interfaces)]

inputs = (
ctx.attr.gopath_dep.files.to_list() + needed_files +
go_ctx.sdk.headers + go_ctx.sdk.srcs + go_ctx.sdk.tools
Expand Down Expand Up @@ -74,11 +72,6 @@ _gomock_source = go_rule(
doc = "The new Go file to emit the generated mocks into",
mandatory = True,
),
"interfaces": attr.string_list(
allow_empty = False,
doc = "The names of the Go interfaces to generate mocks for. If not set, all of the interfaces in the library or source file will have mocks generated for them.",
mandatory = True,
),
"aux_files": attr.string_list_dict(
default = {},
doc = "A map from packages to auxilliary Go source files to load for those packages.",
Expand Down

0 comments on commit ed0530b

Please sign in to comment.