Skip to content
This repository was archived by the owner on Mar 24, 2022. It is now read-only.

Commit

Permalink
Fix mock generation
Browse files Browse the repository at this point in the history
* Switch to fork that supports generating mocks for vendored dependencies (golang/mock#28)
* Install vendored mockgen before generating mocks
* Do not try to find files when no directories are found
  • Loading branch information
mdelillo committed Aug 18, 2016
1 parent 570ba87 commit cea41d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/cloudfoundry/cli.git
[submodule "vendor/github.com/golang/mock"]
path = vendor/github.com/golang/mock
url = https://github.com/golang/mock.git
url = https://github.com/pcfdev-forks/mock.git
[submodule "vendor/github.com/onsi/ginkgo"]
path = vendor/github.com/onsi/ginkgo
url = https://github.com/onsi/ginkgo
Expand Down
5 changes: 4 additions & 1 deletion bin/generate-mocks
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

pcfdev_dir=$(cd `dirname $0` && cd .. && pwd)
mocks_dirs=$(go list -f '{{.Dir}}' github.com/pivotal-cf/pcfdev-cli/... | grep -v /vendor/ | grep '/mocks$')
find $mocks_dirs -name "*.go" -exec rm {} \;
if [[ -n "$mocks_dirs" ]]; then
find $mocks_dirs -name "*.go" -exec rm {} \;
fi

go install github.com/pivotal-cf/pcfdev-cli/vendor/github.com/golang/mock/mockgen
go generate $(go list github.com/pivotal-cf/pcfdev-cli/... | grep -v /vendor/)
2 changes: 1 addition & 1 deletion vendor/github.com/golang/mock
Submodule mock updated from bd3c8e to c974af

0 comments on commit cea41d2

Please sign in to comment.