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

Commit

Permalink
correct gopath use for recent bazels and rules_go (#24)
Browse files Browse the repository at this point in the history
I'm not sure what part of the last commit doesn't produce correct behavior, but
it's fixed up for my bazel 0.28.1.
  • Loading branch information
jmhodges authored Aug 28, 2019
1 parent 0863892 commit a371ff4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gomock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ _MOCKGEN_MODEL_LIB = "@com_github_golang_mock//mockgen/model:go_default_library"

def _gomock_source_impl(ctx):
go_ctx = go_context(ctx)
gopath = "$(pwd)/" + ctx.var["BINDIR"] + "/" + ctx.attr.gopath_dep[GoPath].gopath
gopath = "$(pwd)/" + ctx.bin_dir.path + "/" + ctx.attr.gopath_dep[GoPath].gopath

# passed in source needs to be in gopath to not trigger module mode
args = ["-source", gopath + "/" + ctx.file.source.path]
args = ["-source", gopath + "/src/" + ctx.attr.library[GoLibrary].importmap + "/"+ ctx.file.source.basename]

if ctx.attr.package != "":
args += ["-package", ctx.attr.package]
args += [",".join(ctx.attr.interfaces)]
Expand Down

0 comments on commit a371ff4

Please sign in to comment.