forked from jrnd-io/jr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (41 loc) · 1.1 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
VERSION=0.3.9
USER=$(shell id -u -n)
TIME=$(shell date)
hello:
@echo "JR,the JSON Random Generator"
install-gogen:
go install github.com/actgardner/gogen-avro/v10/cmd/...@latest
#go install github.com/hamba/avro/v2/cmd/avrogen@latest
generate:
go generate pkg/generator/generate.go
compile:
@echo "Compiling"
go build -v -ldflags="-X 'github.com/ugol/jr/pkg/cmd.Version=$(VERSION)' -X 'github.com/ugol/jr/pkg/cmd.BuildUser=$(USER)' -X 'github.com/ugol/jr/pkg/cmd.BuildTime=$(TIME)'" -o build/jr jr.go
run: compile
./build/jr
clean:
go clean
rm build/*
test:
go test ./...
test_coverage:
go test ./... -coverprofile=coverage.out
dep:
go mod download
vet:
go vet
lint:
golangci-lint run --enable-all
help: hello
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}all${RESET}'
@echo ''
copy_templates:
mkdir -p ~/.jr/kafka && cp -r templates ~/.jr/ && cp -r pkg/producers/kafka/*.properties.example ~/.jr/kafka/
copy_config:
mkdir -p ~/.jr && cp config/* ~/.jr/
install:
install build/jr /usr/local/bin
all: hello install-gogen generate compile
all_offline: hello generate compile