-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (53 loc) · 2.14 KB
/
Makefile
File metadata and controls
67 lines (53 loc) · 2.14 KB
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
# This Makefile is not intended to be used as part of Buf
# examples. It exists only for CI purposes.
# See https://tech.davis-hansson.com/p/make/
SHELL := bash
.DELETE_ON_ERROR:
.SHELLFLAGS := -eu -o pipefail -c
.DEFAULT_GOAL := all
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
BIN := .tmp/bin
COPYRIGHT_HOLDER := Buf Technologies, Inc.
COPYRIGHT_YEARS := 2020-2026
LICENSE_IGNORE := \
gen
BUF_VERSION := 1.34.0
# Used to transform LICENSE_IGNORE into a comma-delimited list
SPACE :=
SPACE +=
COMMA := ,
.PHONY: all
all: license-header ci
################################################################################
# Code generation/manipulation #
################################################################################
# Add license headers across all build systems. The files ignored are included
# into docs via @BufCode, where we don't want to print the header.
.PHONY: license-header
license-header: $(BIN)/license-header
license-header \
--ignore bsr/api-access/example/example.go \
--ignore bsr/quickstart/finish/client/cmd/main.go \
--ignore cli/quickstart/finish/server/main.go \
--ignore bsr/webhooks/cmd/main.go \
--license-type apache \
--copyright-holder "$(COPYRIGHT_HOLDER)" \
--year-range "$(COPYRIGHT_YEARS)" --ignore $(subst $(SPACE),$(COMMA),${LICENSE_IGNORE})
################################################################################
# CI for all examples #
################################################################################
.PHONY: ci
ci: ci-bsr ci-protovalidate \
.PHONY: ci-bsr
ci-bsr:
cd bsr && $(MAKE)
.PHONY: ci-protovalidate
ci-protovalidate:
cd protovalidate && $(MAKE)
################################################################################
# Dependency installation #
################################################################################
$(BIN)/license-header: Makefile
@mkdir -p $(@D)
go install github.com/bufbuild/buf/private/pkg/licenseheader/cmd/license-header@v${BUF_VERSION}