-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (25 loc) · 998 Bytes
/
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
BUF_VERSION=v0.41.0
PROTOC_GEN_GO_VERSION=v1.26.0
CORENLP_VERSION=v4.2.1
BIN_PATH=./bin
BUF=$(BIN_PATH)/buf
PROTOC_GEN_GO=$(BIN_PATH)/protoc-gen-go
GOLANGCI_LINT=$(BIN_PATH)/golangci-lint
GOLANGCI_LINT_VERSION=v1.40.0
$(BIN_PATH):
mkdir $(BIN_PATH)
$(GOLANGCI_LINT): $(BIN_PATH)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BIN_PATH) $(GOLANGCI_LINT_VERSION)
$(PROTOC_GEN_GO): $(BIN_PATH)
GOBIN=$(realpath $(BIN_PATH)) go install google.golang.org/protobuf/cmd/protoc-gen-go@$(PROTOC_GEN_GO_VERSION)
$(BUF): $(BIN_PATH)
curl -L -o $(BUF) https://github.com/bufbuild/buf/releases/download/$(BUF_VERSION)/buf-Linux-x86_64
chmod +x $(BUF)
gen: $(BUF) $(PROTOC_GEN_GO)
$(BUF) generate --template buf.gen.yaml "https://github.com/stanfordnlp/CoreNLP.git#tag=$(CORENLP_VERSION)" --path src/edu/stanford/nlp/pipeline/
.PHONY: lint
lint: $(GOLANGCI_LINT)
$(GOLANGCI_LINT) run --config ./.golangci.yml
.PHONY: test
test:
go test ./...