From e6b662cfa63bc6a7e0fc1690da68566ef84cc299 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Tue, 30 May 2023 15:48:19 +0300 Subject: [PATCH] [#75] Add `make` targets `policy` and `docker/%` Signed-off-by: Anton Nikiforov --- Dockerfile | 4 ++++ Makefile | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb6b420 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM golang:1.19 + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install make openjdk-11-jre -y +WORKDIR /work diff --git a/Makefile b/Makefile index 3210743..e149de9 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ #!/usr/bin/make -f +ANTLR_VERSION="4.13.0" + # Run tests test: @go test ./... -cover @@ -29,6 +31,19 @@ format: @echo "⇒ Processing goimports check" @goimports -w ./ +policy: + @wget -q https://www.antlr.org/download/antlr-${ANTLR_VERSION}-complete.jar -O antlr4-tool.jar + @java -Xmx500M -cp "`pwd`/antlr4-tool.jar" "org.antlr.v4.Tool" -o `pwd`/netmap/parser/ -Dlanguage=Go -no-listener -visitor `pwd`/netmap/parser/Query.g4 `pwd`/netmap/parser/QueryLexer.g4 + +# Run `make %` in truecloudlab/frostfs-sdk-go container(Golang+Java) +docker/%: + @docker build -t truecloudlab/frostfs-sdk-go --platform linux/amd64 . > /dev/null + @docker run --rm -t \ + -v `pwd`:/work \ + -u "$$(id -u):$$(id -g)" \ + --env HOME=/work \ + truecloudlab/frostfs-sdk-go make $* + # Show this help prompt help: @echo ' Usage:'