Skip to content

Commit 0e710cb

Browse files
authored
Merge pull request #72 from daniel-hutao/reflactor-test
refactor: make Makefile better
2 parents d1bce2c + eeee513 commit 0e710cb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
build: ## Build dtm & plugins locally.
2-
go get ./...
1+
help: ## Display this help.
2+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
3+
4+
build: fmt vet ## Build dtm & plugins locally.
5+
go mod tidy
36
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o plugins/githubactions_0.0.1.so ./cmd/githubactions/
47
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o plugins/argocd_0.0.1.so ./cmd/argocd/
58
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o plugins/argocdapp_0.0.1.so ./cmd/argocdapp/
69
go build -trimpath -gcflags="all=-N -l" -o dtm ./cmd/devstream/
710

8-
build-core: ## Build dtm core only, locally.
9-
go get ./...
11+
build-core: fmt vet ## Build dtm core only, locally.
12+
go mod tidy
1013
go build -trimpath -gcflags="all=-N -l" -o dtm ./cmd/devstream/
1114

1215
fmt: ## Run go fmt against code.
16+
go get golang.org/x/tools/cmd/goimports
1317
goimports -local="github.com/merico-dev/stream" -d -w cmd
1418
goimports -local="github.com/merico-dev/stream" -d -w internal
1519
go fmt ./...

0 commit comments

Comments
 (0)