forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
78 lines (59 loc) · 3.27 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Makefile
all: deps test build-modules build
.PHONY: deps test build-modules build image format
# deps will clean out the vendor directory and use go mod for a fresh install
deps:
GOPROXY="https://proxy.golang.org" go mod vendor -v && go mod tidy -v
# test will ensure that all of our dependencies are available and run validate.sh
test: deps
# If there is no indentation, Make will treat it as a directive for itself; otherwise, it's regarded as a shell script.
# https://stackoverflow.com/a/4483467
ifeq "$(adapter)" ""
./validate.sh
else
go test github.com/prebid/prebid-server/v2/adapters/$(adapter) -bench=.
endif
# build-modules generates modules/builder.go file which provides a list of all available modules
build-modules:
go generate modules/modules.go
# build will ensure all of our tests pass and then build the go binary
build: test
go build -mod=vendor ./...
# image will build a docker image
image:
docker build -t prebid-server .
# format runs format
format:
./scripts/format.sh -f true
# formatcheck runs format for diagnostics, without modifying the code
formatcheck:
./scripts/format.sh -f false
mockgen: mockgeninstall mockgendb mockgencache mockgenmetrics mockgenlogger mockgenpublisherfeature mockgenprofilemetadata mockgenwakanda
# export GOPATH=~/go ; GOBIN=~/go/bin; export PATH=$PATH:$GOBIN
mockgeninstall:
go install github.com/golang/mock/mockgen@v1.6.0
mockgendb:
mkdir -p modules/pubmatic/openwrap/database/mock modules/pubmatic/openwrap/database/mock_driver
mockgen database/sql/driver Driver,Connector,Conn,DriverContext > modules/pubmatic/openwrap/database/mock_driver/mock.go
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/database Database > modules/pubmatic/openwrap/database/mock/mock.go
mockgencache:
mkdir -p modules/pubmatic/openwrap/cache/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/cache Cache > modules/pubmatic/openwrap/cache/mock/mock.go
mockgenmetrics:
mkdir -p modules/pubmatic/openwrap/metrics/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/metrics MetricsEngine > modules/pubmatic/openwrap/metrics/mock/mock.go
mockgengeodb:
mkdir -p modules/pubmatic/openwrap/geodb/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/geodb Geography > modules/pubmatic/openwrap/geodb/mock/mock.go
mockgenlogger:
mkdir -p analytics/pubmatic/mhttp/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/analytics/pubmatic/mhttp HttpCallInterface,MultiHttpContextInterface > analytics/pubmatic/mhttp/mock/mock.go
mockgenpublisherfeature:
mkdir -p modules/pubmatic/openwrap/publisherfeature
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/publisherfeature Feature > modules/pubmatic/openwrap/publisherfeature/mock/mock.go
mockgenwakanda:
mkdir -p modules/pubmatic/openwrap/wakanda/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/wakanda Commands,DebugInterface > modules/pubmatic/openwrap/wakanda/mock/mock.go
mockgenprofilemetadata:
mkdir -p modules/pubmatic/openwrap/profilemetadata/mock
mockgen github.com/PubMatic-OpenWrap/prebid-server/v2/modules/pubmatic/openwrap/profilemetadata ProfileMetaData > modules/pubmatic/openwrap/profilemetadata/mock/mock.go