trpc.group/trpc-go/trpc-cmdline@v1.0.9/Makefile (about)

     1  VERSION := $(shell cat install/VERSION)
     2  DOCKER_IMAGE := trpc-group/trpc-cmdline
     3  GOPROXY := https://goproxy.cn
     4  GOSUMDB := sum.golang.org
     5  
     6  PHONY: fmt bindata_release release submodules image
     7  
     8  
     9  fmt:
    10  	@gofmt -s -w .
    11  	@goimports -w -local trpc.group .
    12  
    13  # If you want to construct bindata and then restore to the initial
    14  # status of submodules, use `make release`
    15  #
    16  # If you only want to construct bindata, use `make bindata_release`,
    17  # but be cautious that the files of submodules has been modified, if
    18  # you want to create a merge request, you need to run `make submodules`
    19  # to restore the status.
    20  release: bindata_release submodules
    21  
    22  bindata_release:
    23  	# -git submodule update --init --recursive
    24  	# -rm -rf install/submodules/* && git submodule update --remote
    25  	# -cd install/submodules/trpc-protocol && (ls | grep -v "trpc" | xargs rm -rf) && find . -type f ! -name "*.proto" -exec rm -rf '{}' \; && cd -
    26  	@cat config/version.go | grep -oE "(v[0-9]+.[0-9]+.[0-9]+)" | tr -d '\n' > install/VERSION
    27  	@go get -u trpc.group/trpc-go/trpc-cmdline/bindata
    28  	@# in case "go get -u" doesn't work in higher version of Go.
    29  	@go install trpc.group/trpc-go/trpc-cmdline/bindata
    30  	@bindata -input=install -output=gobin/assets.go -gopkg=gobin
    31  	# The dependency on strcase should be forced to v0.2.0 for compatibility.
    32  	@go get -u github.com/iancoleman/strcase@v0.2.0
    33  	@go mod tidy
    34  
    35  submodules:
    36  	# -rm -rf install/submodules/* && git submodule update --remote
    37  
    38  image:
    39  	@docker build \
    40  	--build-arg GOPROXY=${GOPROXY} \
    41  	--build-arg GOSUMDB=${GOSUMDB} \
    42  	-t ${DOCKER_IMAGE}:${VERSION} .