-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile
57 lines (44 loc) · 1.54 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
# SPDX-FileCopyrightText: 2020-present Open Networking Foundation <info@opennetworking.org>
#
# SPDX-License-Identifier: Apache-2.0
.PHONY: build
ONOS_PROTOC_VERSION := v1.3.0
BUF_VERSION := 1.8.0
GOLANG_CI_VERSION := v1.52.2
all: build
build: # @HELP compile Golang sources
cd go && go build ./... && gofmt -s -w .
test: # @HELP run the unit tests and source code validation
test: build lint license
cd go && go test -race github.com/onosproject/onos-api/go/...
lint: # @HELP examines all source code and report coding problems
cd ./go; \
golangci-lint --version | grep $(GOLANG_CI_VERSION) || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b `go env GOPATH`/bin $(GOLANG_CI_VERSION); \
golangci-lint run --timeout 15m
protos: # @HELP compile the protobuf files (using protoc-go Docker)
protos:
docker run \
-v `pwd`:/onos-api \
-w /onos-api \
--entrypoint build/bin/compile-protos.sh \
onosproject/protoc-go:${ONOS_PROTOC_VERSION}
mocks:
./build/bin/generate-mocks.sh
license: # @HELP run license checks
rm -rf venv
python3 -m venv venv
. ./venv/bin/activate;\
python3 -m pip install --upgrade pip;\
python3 -m pip install reuse;\
reuse lint
check-version: # @HELP check version is duplicated
./build/bin/version_check.sh all
clean: # @HELP remove all the build artifacts
rm -rf ./build/_output ./vendor
help:
@grep -E '^.*: *# *@HELP' $(MAKEFILE_LIST) \
| sort \
| awk ' \
BEGIN {FS = ": *# *@HELP"}; \
{printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}; \
'