This repository has been archived by the owner on Mar 14, 2024. It is now read-only.
/
Makefile
55 lines (47 loc) · 1.56 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
# Mock generation is disabled until this PR is merged:
# https://github.com/matryer/moq/pull/105
#
# Until then, we will just leave the existing mocks committed without
# regenerating them.
#
# GENERATED_FILES += axtest/mocks/endpoint.go
# GENERATED_FILES += axtest/mocks/routing.go
# GENERATED_FILES += axtest/mocks/persistence.go
# GENERATED_FILES += axtest/mocks/observability.go
-include .makefiles/Makefile
-include .makefiles/pkg/protobuf/v1/Makefile
-include .makefiles/pkg/go/v1/Makefile
.PHONY: banking
banking: $(GENERATED_FILES)
AX_RMQ_DSN="amqp://localhost" \
AX_MYSQL_DSN="banking:banking@tcp(127.0.0.1:3306)/banking" \
JAEGER_SERVICE_NAME="ax.examples.banking" \
JAEGER_SAMPLER_TYPE="const" \
JAEGER_SAMPLER_PARAM="1" \
JAEGER_REPORTER_LOG_SPANS=true \
go run examples/banking/main.go $(RUN_ARGS)
MOQ := $(GOPATH)/bin/moq
$(MOQ):
go get -u github.com/matryer/moq
axtest/mocks/endpoint.go: $(wildcard endpoint/*.go) | $(MOQ)
$(MOQ) -out "$@" -pkg "mocks" endpoint \
InboundPipeline \
MessageSink \
OutboundPipeline \
SelfValidatingMessage \
InboundTransport \
OutboundTransport \
Validator
axtest/mocks/routing.go: $(wildcard routing/*.go) | $(MOQ)
$(MOQ) -out "$@" -pkg "mocks" routing \
MessageHandler
axtest/mocks/persistence.go: $(wildcard persistence/*.go) | $(MOQ)
$(MOQ) -out "$@" -pkg "mocks" persistence \
Committer \
DataStore \
Tx
axtest/mocks/observability.go: $(wildcard observability/*.go) | $(MOQ)
$(MOQ) -out "$@" -pkg "mocks" observability \
Observer
.makefiles/%:
@curl -sfL https://makefiles.dev/v1 | bash /dev/stdin "$@"