Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions hack/hack-cli.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,5 @@ cli:


# Check and install CLI tool.
.PHONY: cli.install
cli.install:
@set -e; \
gf -v > /dev/null 2>&1 || if [[ "$?" -ne "0" ]]; then \
echo "GoFame CLI is not installed, start proceeding auto installation..."; \
make cli; \
fi;
$(GOPATH)/bin/gf:
@make cli
18 changes: 9 additions & 9 deletions hack/hack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@ include ../../hack/hack-cli.mk

# Update GoFrame and its CLI to latest stable version.
.PHONY: up
up: cli.install
up: $(GOPATH)/bin/gf
@gf up -a

# Build binary using configuration from hack/config.yaml.
.PHONY: build
build: cli.install
build: $(GOPATH)/bin/gf
@gf build -ew

# Parse api and generate controller/sdk.
.PHONY: ctrl
ctrl: cli.install
ctrl: $(GOPATH)/bin/gf
@gf gen ctrl

# Generate Go files for DAO/DO/Entity.
.PHONY: dao
dao: cli.install
dao: $(GOPATH)/bin/gf
@gf gen dao

# Parse current project go files and generate enums go file.
.PHONY: enums
enums: cli.install
enums: $(GOPATH)/bin/gf
@gf gen enums

# Generate Go files for Service.
.PHONY: service
service: cli.install
service: $(GOPATH)/bin/gf
@gf gen service


# Build docker image.
.PHONY: image
image: cli.install
image: $(GOPATH)/bin/gf
$(eval _TAG = $(shell git describe --dirty --always --tags --abbrev=8 --match 'v*' | sed 's/-/./2' | sed 's/-/./2'))
ifneq (, $(shell git status --porcelain 2>/dev/null))
$(eval _TAG = $(_TAG).dirty)
Expand Down Expand Up @@ -66,10 +66,10 @@ deploy:

# Parsing protobuf files and generating go files.
.PHONY: pb
pb: cli.install
pb: $(GOPATH)/bin/gf
@gf gen pb

# Generate protobuf files for database tables.
.PHONY: pbentity
pbentity: cli.install
pbentity: $(GOPATH)/bin/gf
@gf gen pbentity