1 Star 0 Fork 0

Hyperledger/firefly-common

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.65 KB
一键复制 编辑 原始数据 按行查看 历史
VGO=go
GOFILES := $(shell find pkg -name '*.go' -print)
GOBIN := $(shell $(VGO) env GOPATH)/bin
LINT := $(GOBIN)/golangci-lint
MOCKERY := $(GOBIN)/mockery
# Expect that FireFly compiles with CGO disabled
CGO_ENABLED=0
GOGC=30
.DELETE_ON_ERROR:
all: build test go-mod-tidy
test: deps lint
$(VGO) test ./pkg/... -cover -coverprofile=coverage.txt -covermode=atomic -timeout=30s
coverage.html:
$(VGO) tool cover -html=coverage.txt
coverage: test coverage.html
lint: ${LINT}
GOGC=20 $(LINT) run -v --timeout 5m
${MOCKERY}:
$(VGO) install github.com/vektra/mockery/v2@latest
${LINT}:
$(VGO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
dbmigrate:
$(eval DBMIGRATE_PATH := $(shell $(VGO) list -f '{{.Dir}}' github.com/golang-migrate/migrate/v4/database))
define makemock
mocks: mocks-$(strip $(1))-$(strip $(2))
mocks-$(strip $(1))-$(strip $(2)): ${MOCKERY} dbmigrate
${MOCKERY} --case underscore --dir $(1) --name $(2) --outpkg $(3) --output mocks/$(strip $(3))
endef
$(eval $(call makemock, $$(DBMIGRATE_PATH), Driver, dbmigratemocks))
$(eval $(call makemock, pkg/httpserver, GoHTTPServer, httpservermocks))
$(eval $(call makemock, pkg/auth, Plugin, authmocks))
$(eval $(call makemock, pkg/wsserver, Protocol, wsservermocks))
$(eval $(call makemock, pkg/wsserver, WebSocketServer, wsservermocks))
$(eval $(call makemock, pkg/dbsql, CRUD, crudmocks))
firefly-common: ${GOFILES}
$(VGO) build ./pkg/*
go-mod-tidy: .ALWAYS
$(VGO) mod tidy
build: firefly-common
.ALWAYS: ;
clean:
$(VGO) clean
deps:
$(VGO) get ./pkg/*
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hyperledger/firefly-common.git
git@gitee.com:hyperledger/firefly-common.git
hyperledger
firefly-common
firefly-common
main

搜索帮助