jmhodges / bazel_gomock

Code to create Go mocks for bazel targets using mockgen
MIT License
58 stars 30 forks source link

speed up mock generation in mockgen's reflect mode #6

Closed jmhodges closed 5 years ago

jmhodges commented 5 years ago

This dramatically speeds up mock generation by letting mockgen use bazel's cache and build graph. We use mockgen's -prog_only and -exec_only modes to split up mockgen's generation of the interface printing program and mockgen's use of that program to generate the actual mock code.

By doing that, mockgen no longer runs the go binary to build the interface printing code which transitively builds the entire GOPATH we created.

Fixes #2