Skip to content

Commit 2f75863

Browse files
committed
Begin development of next release 0.3.0
- update info in package ./version - update to Go 1.13 - regenerate ./examples/binapi for latest VPP: 19.08.1-release - clean code in proxy - refactor Makefile Change-Id: Ibf5c2682c2f4b3cbbea4aa1e35d3f02175d40a9b Signed-off-by: Ondrej Fabry <[email protected]>
1 parent 73733b0 commit 2f75863

File tree

14 files changed

+174
-135
lines changed

14 files changed

+174
-135
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,11 @@
55

66
.idea/
77

8-
# cmds
8+
/bin/
9+
10+
# cmd
911
cmd/binapi-generator/binapi-generator
12+
cmd/vpp-proxy/vpp-proxy
1013

1114
# examples
1215
examples/perf-bench/perf-bench

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ services: docker
33

44
language: go
55
go:
6-
- "1.12.x"
6+
- "1.13.x"
77

88
go_import_path: git.fd.io/govpp.git
99

@@ -14,12 +14,12 @@ env:
1414
before_script:
1515
- export VPP_IMG="ligato/vpp-base:latest"
1616
- docker pull $VPP_IMG
17-
- GO111MODULE=on go mod download
17+
- go mod download
1818

1919
script:
20+
- make lint || true
2021
- make test
2122
- make build
22-
- make examples
2323
- make gen-binapi-docker
2424

2525
notifications:

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This file lists changes for the GoVPP releases.
44

5+
## 0.3.0
6+
> _in development_
7+
8+
// TO BE ADDED
9+
510
## 0.2.0
611
> _04 November 2019_
712
@@ -18,7 +23,6 @@ This file lists changes for the GoVPP releases.
1823
- migrate to Go modules
1924
- print info for users when sockets are missing
2025

21-
2226
## 0.1.0
2327
> _03 July 2019_
2428

Makefile

Lines changed: 72 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,94 @@
1-
SHELL = /bin/bash
2-
3-
GO ?= GO111MODULE=on go
4-
GOVPP_PKG := $(shell go list)
1+
SHELL := /usr/bin/env bash -o pipefail
52

63
VERSION ?= $(shell git describe --always --tags --dirty)
74
COMMIT ?= $(shell git rev-parse HEAD)
85
BUILD_STAMP ?= $(shell git log -1 --format="%ct")
96
BUILD_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
7+
108
BUILD_HOST ?= $(shell hostname)
119
BUILD_USER ?= $(shell id -un)
1210

13-
VPP_VERSION = $(shell dpkg-query -f '\${Version}' -W vpp)
14-
15-
VPP_IMG ?= ligato/vpp-base:latest
16-
BINAPI_DIR ?= ./examples/binapi
11+
GO ?= go
1712

18-
LDFLAGS = -w -s \
13+
GOVPP_PKG := $(shell go list)
14+
LDFLAGS = \
1915
-X ${GOVPP_PKG}/version.version=$(VERSION) \
2016
-X ${GOVPP_PKG}/version.commitHash=$(COMMIT) \
2117
-X ${GOVPP_PKG}/version.buildStamp=$(BUILD_STAMP) \
2218
-X ${GOVPP_PKG}/version.buildBranch=$(BUILD_BRANCH) \
2319
-X ${GOVPP_PKG}/version.buildUser=$(BUILD_USER) \
2420
-X ${GOVPP_PKG}/version.buildHost=$(BUILD_HOST)
21+
ifeq ($(NOSTRIP),)
22+
LDFLAGS += -w -s
23+
endif
24+
25+
GO_BUILD_TAGS ?= novpp
2526

2627
GO_BUILD_ARGS = -ldflags "${LDFLAGS}"
27-
ifeq ($(V),1)
28-
GO_BUILD_ARGS += -v
29-
endif
3028
ifneq ($(GO_BUILD_TAGS),)
3129
GO_BUILD_ARGS += -tags="${GO_BUILD_TAGS}"
3230
endif
31+
ifneq ($(GO_NOTRIM),0)
32+
GO_BUILD_ARGS += -trimpath
33+
endif
34+
ifeq ($(V),1)
35+
GO_BUILD_ARGS += -v
36+
endif
37+
38+
VPP_VERSION = $(shell dpkg-query -f '\${Version}' -W vpp)
39+
40+
VPP_IMG ?= ligato/vpp-base:latest
41+
BINAPI_DIR ?= ./examples/binapi
42+
43+
help:
44+
@echo "List of make targets:"
45+
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
46+
47+
.DEFAULT = help
48+
49+
bin:
50+
mkdir -p bin
51+
52+
build: ## Build all
53+
@echo "# building ${VERSION}"
54+
$(GO) build ${GO_BUILD_ARGS} ./...
55+
56+
cmd: bin ## Build commands
57+
$(GO) build ${GO_BUILD_ARGS} -o bin ./cmd/...
58+
59+
examples: bin ## Build examples
60+
$(GO) build ${GO_BUILD_ARGS} -o bin ./examples/...
61+
62+
clean: ## Clean all
63+
@echo "# cleaning"
64+
$(GO) clean -v ./...
65+
66+
test: ## Run unit tests
67+
@echo "# running tests"
68+
$(GO) test -tags="${GO_BUILD_TAGS}" ./...
3369

34-
all: test build examples
70+
integration: ## Run integration tests
71+
@echo "# running integration tests"
72+
$(GO) test -tags="integration ${GO_BUILD_TAGS}" ./test/integration
3573

36-
install:
37-
@echo "=> installing binapi-generator ${VERSION}"
74+
lint: ## Run code linter
75+
@echo "# running linter"
76+
@golint ./...
77+
78+
install-generator: ## Install binapi-generator
79+
@echo "# installing binapi-generator ${VERSION}"
3880
$(GO) install ${GO_BUILD_ARGS} ./cmd/binapi-generator
3981

40-
build:
41-
@echo "=> building binapi-generator ${VERSION}"
42-
cd cmd/binapi-generator && $(GO) build ${GO_BUILD_ARGS}
43-
44-
examples:
45-
@echo "=> building examples"
46-
cd examples/perf-bench && $(GO) build ${GO_BUILD_ARGS} -v
47-
cd examples/rpc-service && $(GO) build ${GO_BUILD_ARGS} -v
48-
cd examples/simple-client && $(GO) build ${GO_BUILD_ARGS} -v
49-
cd examples/stats-client && $(GO) build ${GO_BUILD_ARGS} -v
50-
cd examples/union-example && $(GO) build ${GO_BUILD_ARGS} -v
51-
52-
clean:
53-
@echo "=> cleaning"
54-
go clean -v ./cmd/...
55-
go clean -v ./examples/...
56-
57-
test:
58-
@echo "=> running tests"
59-
$(GO) test ${GO_BUILD_ARGS} ./cmd/...
60-
$(GO) test ${GO_BUILD_ARGS} ./ ./api ./adapter ./codec ./core
61-
62-
test-integration:
63-
@echo "=> running integration tests"
64-
$(GO) test ${GO_BUILD_ARGS} ./test/integration
65-
66-
lint:
67-
@echo "=> running linter"
68-
@golint ./... | grep -v vendor | grep -v /binapi/ || true
69-
70-
gen-binapi-docker: install
71-
@echo "=> generating binapi in docker image ${VPP_IMG}"
82+
generate: ## Generate code
83+
@echo "# generating code"
84+
$(GO) generate -x ./...
85+
86+
generate-binapi: install-generator
87+
@echo "# generating binapi VPP $(VPP_VERSION)"
88+
$(GO) generate -x "$(BINAPI_DIR)"
89+
90+
gen-binapi-docker: install-generator
91+
@echo "# generating binapi in docker image ${VPP_IMG}"
7292
$(eval cmds := $(shell go generate -n $(BINAPI_DIR) 2>&1 | tr "\n" ";"))
7393
docker run -t --rm \
7494
-v "$(shell which gofmt):/usr/local/bin/gofmt:ro" \
@@ -78,19 +98,13 @@ gen-binapi-docker: install
7898
"${VPP_IMG}" \
7999
sh -xc "cd $(BINAPI_DIR) && $(cmds)"
80100

81-
generate-binapi: install
82-
@echo "=> generating binapi VPP $(VPP_VERSION)"
83-
$(GO) generate -x "$(BINAPI_DIR)"
84-
85-
generate:
86-
@echo "=> generating code"
87-
$(GO) generate -x ./...
88-
89101
extras:
90102
@make -C extras
91103

92104

93-
.PHONY: all \
94-
install build examples clean test test-integration lint \
95-
generate generate-binapi gen-binapi-docker \
105+
.PHONY: help \
106+
build cmd examples clean \
107+
lint test integration \
108+
install-generator generate generate-binapi gen-binapi-docker \
96109
extras
110+

doc.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright (c) 2019 Cisco and/or its affiliates.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at:
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
// Package govpp provides the entry point to govpp functionality. It provides the API for connecting the govpp core
216
// to VPP either using the default VPP adapter, or using the adapter previously set by SetAdapter function
317
// (useful mostly just for unit/integration tests with mocked VPP adapter).

examples/binapi/interfaces/interfaces.ba.go

Lines changed: 14 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)