22PACKAGE_NAME := github.com/onflow/flow-cli
33GOLANG_CROSS_VERSION ?= v1.25.0
44
5- # The tag of the current commit, otherwise empty
5+ # Version tag from git (empty if not on a tagged commit)
66VERSION := $(shell git describe --tags --abbrev=0 --exact-match 2>/dev/null)
7- # Name of the cover profile
7+ # Coverage report output file
88COVER_PROFILE := coverage.txt
9- # Disable go sum database lookup for private repos
10- GOPRIVATE := github.com/dapperlabs/*
11- # Ensure go bin path is in path (Especially for CI)
12- GOPATH ?= $(HOME ) /go
13- PATH := $(PATH ) :$(GOPATH ) /bin
14- # OS
15- UNAME := $(shell uname)
169
10+ # Analytics and account tokens (embedded in binary)
1711MIXPANEL_PROJECT_TOKEN := 3fae49de272be1ceb8cf34119f747073
1812ACCOUNT_TOKEN := lilico:sF60s3wughJBmNh2
1913
14+ # Output binary path (can be overridden)
2015BINARY ?= ./cmd/flow/flow
2116
2217.PHONY : binary
2318binary : $(BINARY )
2419
25- .PHONY : install-tools
26- install-tools :
27- cd ' ${GOPATH}' ; \
28- mkdir -p ' ${GOPATH}' ; \
29- GO111MODULE=on go install github.com/sanderhahn/gozip/cmd/gozip@latest; \
30- GO111MODULE=on go install github.com/vektra/mockery/
[email protected] ; 31-
3220.PHONY : test
3321test :
3422 CGO_ENABLED=1 CGO_CFLAGS=" -O2 -D__BLST_PORTABLE__ -std=gnu11" GO111MODULE=on go test -coverprofile=$(COVER_PROFILE ) $(if $(JSON_OUTPUT ) ,-json,) ./...
@@ -44,12 +32,10 @@ ifeq ($(COVER), true)
4432 go tool cover -html=$(COVER_PROFILE) -o index.html
4533 # Generate textual summary.
4634 go tool cover -func=$(COVER_PROFILE) | tee cover-summary.txt
47- # Optionally zip the HTML (if gozip installed) for CI systems expecting an artifact.
48- if [ -x "$(shell command -v gozip 2>/dev/null)" ]; then gozip -c coverage.zip index.html || true; fi
4935endif
5036
5137.PHONY : ci
52- ci : install-tools generate test coverage
38+ ci : generate test coverage
5339
5440$(BINARY ) :
5541 CGO_ENABLED=1 \
@@ -97,7 +83,7 @@ check-tidy:
9783 go mod tidy
9884
9985.PHONY : generate
100- generate : install-tools
86+ generate :
10187 go generate ./...
10288
10389.PHONY : release
@@ -110,4 +96,4 @@ release:
11096 -v ` pwd` /sysroot:/sysroot \
11197 -w /go/src/$(PACKAGE_NAME ) \
11298 ghcr.io/goreleaser/goreleaser-cross:${GOLANG_CROSS_VERSION} \
113- release --clean
99+ release --clean
0 commit comments