-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reorganize project layout + switch to cayley
- Loading branch information
Showing
60 changed files
with
4,331 additions
and
3,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,64 @@ | ||
GOPKG ?= moul.io/depviz | ||
GOBINS ?= . ./tools/opml-to-github-issues ./tools/sed-i-github-issues | ||
GOBINS = ./cmd/depviz | ||
#GOBINS += ./tools/opml-to-github-issues | ||
#GOBINS += ./tools/sed-i-github-issues | ||
DOCKER_IMAGE ?= moul/depviz | ||
|
||
|
||
all: test install | ||
|
||
|
||
PRE_INSTALL_STEPS += generate | ||
PRE_TEST_STEPS += generate | ||
PRE_BUILD_STEPS += generate | ||
PRE_LING_STEPS += generate | ||
PRE_BUMPDEPS_STEPS += generate | ||
include rules.mk | ||
|
||
|
||
.PHONY: update_examples | ||
update_examples: | ||
for dir in $(sort $(dir $(wildcard examples/*/*))); do (cd $$dir && make); done | ||
@echo "now you can run:" | ||
@echo " git commit examples -m \"chore: update examples\"" | ||
|
||
|
||
## | ||
## generate | ||
## | ||
|
||
|
||
PROTOS_SRC := $(wildcard ./api/*.proto) $(wildcard ./api/internal/*.proto) | ||
GEN_SRC := $(PROTOS_SRC) Makefile | ||
.PHONY: generate | ||
generate: gen.sum | ||
gen.sum: $(GEN_SRC) | ||
shasum $(GEN_SRC) | sort > gen.sum.tmp | ||
diff -q gen.sum gen.sum.tmp || ( \ | ||
set -e; \ | ||
GO111MODULE=on go mod vendor; \ | ||
docker run \ | ||
--user=`id -u` \ | ||
--volume="$(PWD):/go/src/moul.io/depviz" \ | ||
--workdir="/go/src/moul.io/depviz" \ | ||
--entrypoint="sh" \ | ||
--rm \ | ||
moul/depviz-protoc:1 \ | ||
-xec 'make generate_local'; \ | ||
make tidy \ | ||
) | ||
|
||
|
||
.PHONY: generate_local | ||
generate_local: | ||
@set -e; for proto in $(PROTOS_SRC); do ( set -xe; \ | ||
protoc -I ./api:./vendor:/protobuf --grpc-gateway_out=logtostderr=true:"$(GOPATH)/src" --gogofaster_out="plugins=grpc:$(GOPATH)/src" "$$proto" \ | ||
); done | ||
goimports -w ./pkg ./cmd ./internal | ||
shasum $(GEN_SRC) | sort > gen.sum.tmp | ||
mv gen.sum.tmp gen.sum | ||
|
||
|
||
.PHONY: clean | ||
clean: | ||
rm -f gen.sum $(wildcard */*/*.pb.go */*/*.pb.gw.go) $(wildcard out/*) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.