From f5a26f793730a8d94763ba7d64f5575793d6baff Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 12:34:32 -0700 Subject: [PATCH 1/9] storage: make: Use variables for the API version This makes it easier to change in the future Signed-off-by: Ben Walker --- storage/Makefile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/storage/Makefile b/storage/Makefile index 66f18d62..a9d2b3f9 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -2,19 +2,22 @@ # Copyright (C) 2022 Intel Corporation # Copyright (c) 2022 Dell Inc, or its subsidiaries. +CURRENT_VERSION := v1alpha1 +COMMON_VERSION := v1 + all: - rm -rf ./v1alpha1/{autogen.md,gen,google} - mkdir -p ./v1alpha1/gen/{go,cpp,python,java} + rm -rf ./$(CURRENT_VERSION)/{autogen.md,gen,google} + mkdir -p ./$(CURRENT_VERSION)/gen/{go,cpp,python,java} - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.47_2 -i /common --lint -d v1alpha1 -l go -o ./v1alpha1/gen/go/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.47_2 -i /common --lint -d v1alpha1 -l cpp -o ./v1alpha1/gen/cpp/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.47_2 -i /common --lint -d v1alpha1 -l python -o ./v1alpha1/gen/python/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/v1":/common namely/protoc-all:1.47_2 -i /common --lint -d v1alpha1 -l java -o ./v1alpha1/gen/java/ --go-source-relative + docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l go -o ./$(CURRENT_VERSION)/gen/go/ --go-source-relative + docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l cpp -o ./$(CURRENT_VERSION)/gen/cpp/ --go-source-relative + docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l python -o ./$(CURRENT_VERSION)/gen/python/ --go-source-relative + docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l java -o ./$(CURRENT_VERSION)/gen/java/ --go-source-relative # protoc doesn't include annotation and http googleapis, so we have to get them here curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api - mv google "${PWD}"/v1alpha1/ - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format summary" - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/v1":/common -v "${PWD}"/v1alpha1/:/out -w /out -v "${PWD}"/v1alpha1:/protos pseudomuto/protoc-gen-doc -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" - rm -rf "${PWD}"/v1alpha1/google + mv google "${PWD}"/$(CURRENT_VERSION)/ + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format summary" + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out -v "${PWD}"/$(CURRENT_VERSION):/protos pseudomuto/protoc-gen-doc -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" + rm -rf "${PWD}"/$(CURRENT_VERSION)/google From 1944c06eead0bb64adb48328b2baace2725535dc Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 12:37:18 -0700 Subject: [PATCH 2/9] storage: make: Add a docker_compile function Reduce the repeated code by using a function Signed-off-by: Ben Walker --- storage/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/storage/Makefile b/storage/Makefile index a9d2b3f9..738da612 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -5,14 +5,20 @@ CURRENT_VERSION := v1alpha1 COMMON_VERSION := v1 +define docker_compile + rm -rf ./$(CURRENT_VERSION)/gen/$(1) + mkdir -p ./$(CURRENT_VERSION)/gen/$(1) + docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 \ + -i /common --lint -d "$(CURRENT_VERSION)" -l $(1) -o ./$(CURRENT_VERSION)/gen/$(1)/ --go-source-relative +endef + all: - rm -rf ./$(CURRENT_VERSION)/{autogen.md,gen,google} - mkdir -p ./$(CURRENT_VERSION)/gen/{go,cpp,python,java} + rm -rf ./$(CURRENT_VERSION)/{autogen.md,google} - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l go -o ./$(CURRENT_VERSION)/gen/go/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l cpp -o ./$(CURRENT_VERSION)/gen/cpp/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l python -o ./$(CURRENT_VERSION)/gen/python/ --go-source-relative - docker run --user=$$(id -u):$$(id -g) --rm -v "${PWD}":/defs -v "${PWD}/../common/$(COMMON_VERSION)":/common namely/protoc-all:1.47_2 -i /common --lint -d "$(CURRENT_VERSION)" -l java -o ./$(CURRENT_VERSION)/gen/java/ --go-source-relative + $(call docker_compile,python) + $(call docker_compile,go) + $(call docker_compile,cpp) + $(call docker_compile,java) # protoc doesn't include annotation and http googleapis, so we have to get them here curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api From 37c4e09a5a88f5ac9d5c7eeafbbacfd724612821 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 13:09:35 -0700 Subject: [PATCH 3/9] storage: make: Avoid downloading the googleapis archive every build Signed-off-by: Ben Walker --- storage/.gitignore | 1 + storage/Makefile | 41 +++++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 storage/.gitignore diff --git a/storage/.gitignore b/storage/.gitignore new file mode 100644 index 00000000..d4b05a81 --- /dev/null +++ b/storage/.gitignore @@ -0,0 +1 @@ +googleapis diff --git a/storage/Makefile b/storage/Makefile index 738da612..cfade051 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -12,18 +12,43 @@ define docker_compile -i /common --lint -d "$(CURRENT_VERSION)" -l $(1) -o ./$(CURRENT_VERSION)/gen/$(1)/ --go-source-relative endef -all: - rm -rf ./$(CURRENT_VERSION)/{autogen.md,google} +all: googleapis/google + rm -rf ./$(CURRENT_VERSION)/autogen.md $(call docker_compile,python) $(call docker_compile,go) $(call docker_compile,cpp) $(call docker_compile,java) - # protoc doesn't include annotation and http googleapis, so we have to get them here + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ + -v "${PWD}/../common/$(COMMON_VERSION)":/common \ + -v "${PWD}/$(CURRENT_VERSION)/":/out \ + -v "${PWD}/googleapis":/googleapis \ + -w /out \ + ghcr.io/docker-multiarch/google-api-linter:1.36.0 \ + -c "api-linter -I /common -I /googleapis /out/*.proto --output-format summary" + + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ + -v "${PWD}/../common/$(COMMON_VERSION)":/common \ + -v "${PWD}/$(CURRENT_VERSION)/":/out \ + -v "${PWD}/googleapis":/googleapis \ + -w /out \ + ghcr.io/docker-multiarch/google-api-linter:1.36.0 \ + -c "api-linter -I /common -I /googleapis /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" + + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ + -v "${PWD}/../common/$(COMMON_VERSION)":/common \ + -v "${PWD}/$(CURRENT_VERSION)/":/out \ + -v "${PWD}"/$(CURRENT_VERSION):/protos \ + -v "${PWD}/googleapis":/googleapis \ + -w /out \ + pseudomuto/protoc-gen-doc \ + -c "protoc -I /common -I /googleapis -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" + +googleapis/google: curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api - mv google "${PWD}"/$(CURRENT_VERSION)/ - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format summary" - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out ghcr.io/docker-multiarch/google-api-linter:1.36.0 -c "api-linter -I /common /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh -v "${PWD}/../common/$(COMMON_VERSION)":/common -v "${PWD}"/$(CURRENT_VERSION)/:/out -w /out -v "${PWD}"/$(CURRENT_VERSION):/protos pseudomuto/protoc-gen-doc -c "protoc -I /common -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" - rm -rf "${PWD}"/$(CURRENT_VERSION)/google + mkdir -p googleapis + mv google googleapis/ + +clean: + rm -rf googleapis From 35a76723bb7af6806d2a6d6c5d25d8ce52601962 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 12:30:09 -0700 Subject: [PATCH 4/9] storage: Add individual targets per language If you want to build just one binding, or just the documentation, etc. now you can. This also makes parallel make work, so the whole thing builds much more quickly. Signed-off-by: Ben Walker --- storage/Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/storage/Makefile b/storage/Makefile index cfade051..bd4b4c63 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -12,14 +12,21 @@ define docker_compile -i /common --lint -d "$(CURRENT_VERSION)" -l $(1) -o ./$(CURRENT_VERSION)/gen/$(1)/ --go-source-relative endef -all: googleapis/google - rm -rf ./$(CURRENT_VERSION)/autogen.md +all: python cpp go java doc lint +python: $(call docker_compile,python) - $(call docker_compile,go) + +cpp: $(call docker_compile,cpp) + +go: + $(call docker_compile,go) + +java: $(call docker_compile,java) +lint: googleapis/google docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ -v "${PWD}/../common/$(COMMON_VERSION)":/common \ -v "${PWD}/$(CURRENT_VERSION)/":/out \ @@ -36,6 +43,7 @@ all: googleapis/google ghcr.io/docker-multiarch/google-api-linter:1.36.0 \ -c "api-linter -I /common -I /googleapis /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" +doc: googleapis/google docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ -v "${PWD}/../common/$(COMMON_VERSION)":/common \ -v "${PWD}/$(CURRENT_VERSION)/":/out \ From 2b62c70e5b139922d608c8476a7978e8ab131fab Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 13:28:29 -0700 Subject: [PATCH 5/9] storage: make: Move autogen.md to v1alpha1/gen/doc This is the same as any other generated output. Signed-off-by: Ben Walker --- storage/Makefile | 2 +- storage/v1alpha1/{ => gen/doc}/autogen.md | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename storage/v1alpha1/{ => gen/doc}/autogen.md (100%) diff --git a/storage/Makefile b/storage/Makefile index bd4b4c63..aaf3b92e 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -51,7 +51,7 @@ doc: googleapis/google -v "${PWD}/googleapis":/googleapis \ -w /out \ pseudomuto/protoc-gen-doc \ - -c "protoc -I /common -I /googleapis -I /protos --doc_out=/out --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" + -c "protoc -I /common -I /googleapis -I /protos --doc_out=/out/gen/doc --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" googleapis/google: curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api diff --git a/storage/v1alpha1/autogen.md b/storage/v1alpha1/gen/doc/autogen.md similarity index 100% rename from storage/v1alpha1/autogen.md rename to storage/v1alpha1/gen/doc/autogen.md From 343a57ead681a3679e5b415d4a1133172bb4b0d3 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 13:30:53 -0700 Subject: [PATCH 6/9] storage: make: Remove extra mount when building docs The same directory was mounted at /protos and /out. Only mount it once. Signed-off-by: Ben Walker --- storage/Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/storage/Makefile b/storage/Makefile index aaf3b92e..49025622 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -47,11 +47,10 @@ doc: googleapis/google docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ -v "${PWD}/../common/$(COMMON_VERSION)":/common \ -v "${PWD}/$(CURRENT_VERSION)/":/out \ - -v "${PWD}"/$(CURRENT_VERSION):/protos \ -v "${PWD}/googleapis":/googleapis \ -w /out \ pseudomuto/protoc-gen-doc \ - -c "protoc -I /common -I /googleapis -I /protos --doc_out=/out/gen/doc --doc_opt=markdown,autogen.md /protos/*.proto /common/*.proto" + -c "protoc -I /common -I /googleapis -I /out --doc_out=/out/gen/doc --doc_opt=markdown,autogen.md /out/*.proto /common/*.proto" googleapis/google: curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api From 4011ff0141d945b05c595fcd2f44bdfb8cfa6c30 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 13:38:24 -0700 Subject: [PATCH 7/9] storage: make: Add a function to share code between lint and doc targets Signed-off-by: Ben Walker --- storage/Makefile | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/storage/Makefile b/storage/Makefile index 49025622..4f4850a1 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -5,6 +5,9 @@ CURRENT_VERSION := v1alpha1 COMMON_VERSION := v1 +# Make a variable named ','. Used to pass arguments to functions that contain a comma +, := , + define docker_compile rm -rf ./$(CURRENT_VERSION)/gen/$(1) mkdir -p ./$(CURRENT_VERSION)/gen/$(1) @@ -12,8 +15,20 @@ define docker_compile -i /common --lint -d "$(CURRENT_VERSION)" -l $(1) -o ./$(CURRENT_VERSION)/gen/$(1)/ --go-source-relative endef +define docker_run + docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ + -v "${PWD}/../common/$(COMMON_VERSION)":/common \ + -v "${PWD}/$(CURRENT_VERSION)/":/out \ + -v "${PWD}/googleapis":/googleapis \ + -w /out \ + $(1) \ + -c "$(2)" +endef + all: python cpp go java doc lint +.PHONY: python cpp go java lint doc + python: $(call docker_compile,python) @@ -27,30 +42,18 @@ java: $(call docker_compile,java) lint: googleapis/google - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ - -v "${PWD}/../common/$(COMMON_VERSION)":/common \ - -v "${PWD}/$(CURRENT_VERSION)/":/out \ - -v "${PWD}/googleapis":/googleapis \ - -w /out \ - ghcr.io/docker-multiarch/google-api-linter:1.36.0 \ - -c "api-linter -I /common -I /googleapis /out/*.proto --output-format summary" + $(call docker_run,\ + ghcr.io/docker-multiarch/google-api-linter:1.36.0,\ + api-linter -I /common -I /googleapis /out/*.proto --output-format summary) - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ - -v "${PWD}/../common/$(COMMON_VERSION)":/common \ - -v "${PWD}/$(CURRENT_VERSION)/":/out \ - -v "${PWD}/googleapis":/googleapis \ - -w /out \ - ghcr.io/docker-multiarch/google-api-linter:1.36.0 \ - -c "api-linter -I /common -I /googleapis /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status" + $(call docker_run,\ + ghcr.io/docker-multiarch/google-api-linter:1.36.0,\ + api-linter -I /common -I /googleapis /out/*.proto --output-format github --disable-rule=core::0192::has-comments --disable-rule=core::0136 --disable-rule=core::0127 --set-exit-status) doc: googleapis/google - docker run --user=$$(id -u):$$(id -g) --rm --entrypoint=sh \ - -v "${PWD}/../common/$(COMMON_VERSION)":/common \ - -v "${PWD}/$(CURRENT_VERSION)/":/out \ - -v "${PWD}/googleapis":/googleapis \ - -w /out \ - pseudomuto/protoc-gen-doc \ - -c "protoc -I /common -I /googleapis -I /out --doc_out=/out/gen/doc --doc_opt=markdown,autogen.md /out/*.proto /common/*.proto" + $(call docker_run,\ + pseudomuto/protoc-gen-doc,\ + protoc -I /common -I /googleapis -I /out --doc_out=/out/gen/doc --doc_opt=markdown$(,)autogen.md /out/*.proto /common/*.proto) googleapis/google: curl -kL https://github.com/googleapis/googleapis/archive/master.tar.gz | tar --strip=1 -zxvf - googleapis-master/google/api From 2951a9a621c787c9e09da05203e8b2b8d83c9cb8 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Fri, 21 Oct 2022 13:12:35 -0700 Subject: [PATCH 8/9] storage: Add 'make local' This will compile without any docker containers, using a locally installed protoc. BEWARE - every version of protoc generates different output, so don't check in generated output from this option. Signed-off-by: Ben Walker --- storage/Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/storage/Makefile b/storage/Makefile index 4f4850a1..cf04dea6 100644 --- a/storage/Makefile +++ b/storage/Makefile @@ -8,6 +8,14 @@ COMMON_VERSION := v1 # Make a variable named ','. Used to pass arguments to functions that contain a comma , := , +define protoc_compile + mkdir -p $(CURRENT_VERSION)/gen/$(1) + protoc --proto_path=../common/$(COMMON_VERSION) --proto_path=$(CURRENT_VERSION) --proto_path=googleapis \ + --$(1)_out=$(CURRENT_VERSION)/gen/$(1) \ + $(2) \ + $(CURRENT_VERSION)/*.proto +endef + define docker_compile rm -rf ./$(CURRENT_VERSION)/gen/$(1) mkdir -p ./$(CURRENT_VERSION)/gen/$(1) @@ -62,3 +70,21 @@ googleapis/google: clean: rm -rf googleapis + +local: python_local cpp_local go_local java_local doc_local + +python_local: googleapis/google + $(call protoc_compile,python,) + +cpp_local: googleapis/google + $(call protoc_compile,cpp,) + +go_local: googleapis/google + $(call protoc_compile,go,) + mv $(CURRENT_VERSION)/gen/go/github.com/opiproject/opi-api/storage/$(CURRENT_VERSION)/gen/go/* $(CURRENT_VERSION)/gen/go/ + +java_local: googleapis/google + $(call protoc_compile,java,) + +doc_local: googleapis/google + $(call protoc_compile,doc,--doc_opt=markdown$(,)autogen.md) From bf48eabd1759c48aea87cac7d334534aec1fad62 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 8 Nov 2022 13:44:40 -0700 Subject: [PATCH 9/9] linter: Ignore all generated code in storage Don't lint anything generated Signed-off-by: Ben Walker --- .github/workflows/linters.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index fd9fc742..1418aab2 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -13,7 +13,7 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run tests - run: docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest --ignore ./storage/v1alpha1/autogen.md --ignore ./security/v1/autogen.md --ignore ./network/v1/autogen.md --ignore ./common/v1/autogen.md --disable=MD013 "**/*.md" + run: docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest --ignore ./storage/v1alpha1/gen/ --ignore ./security/v1/autogen.md --ignore ./network/v1/autogen.md --ignore ./common/v1/autogen.md --disable=MD013 "**/*.md" api-lint: runs-on: ubuntu-latest