Skip to content
Draft
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
69 changes: 2 additions & 67 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@

.PHONY: generate
generate:
protoc \
-I. \
--go_out=paths=source_relative:. \
s12/protobuf/proto/*.proto s12/flags/permissions/*.proto

ARCH := $(shell uname -p)
ifeq ($(ARCH), arm)
SYS_ROOT = /opt/homebrew/
Expand All @@ -25,47 +18,15 @@ protobuf/protoc-gen-cruxclient/api_generator.o \
protobuf/protoc-gen-cruxclient/mock_service_generator.o
$(CXX) $^ $(LDFLAGS) -o $@

.PHONY: install-govalidator
install-govalidator:
go install ./protobuf/protoc-gen-govalidator

.PHONY: install-logger
go install github.com/SafetyCulture/s12-proto/protobuf/protoc-gen-logger

.PHONY: install-s12perm
install-s12perm: generate
go install ./protobuf/protoc-gen-s12perm

.PHONY: install-cruxclient
install-cruxclient: protoc-gen-cruxclient
install protoc-gen-cruxclient $(SYS_ROOT)/bin/protoc-gen-cruxclient

.PHONY: install
install: install-govalidator install-logger

.PHONY: govalidator
govalidator: install-govalidator
protoc \
-I./protobuf/protoc-gen-govalidator/example \
-I$(GOPATH)/src \
-I. \
--go_out=paths=source_relative:protobuf/protoc-gen-govalidator/example \
--govalidator_out=paths=source_relative:protobuf/protoc-gen-govalidator/example \
protobuf/protoc-gen-govalidator/example/*.proto

.PHONY: govalidator-test
govalidator-test:
go test github.com/SafetyCulture/s12-proto/protobuf/protoc-gen-govalidator/example

.PHONY: govalidator-valtest
govalidator-valtest: install-govalidator
protoc \
-I./protobuf/protoc-gen-govalidator/valtest \
-I$(GOPATH)/src \
-I. \
--go_out=paths=source_relative:protobuf/protoc-gen-govalidator/valtest \
--govalidator_out=paths=source_relative:protobuf/protoc-gen-govalidator/valtest \
protobuf/protoc-gen-govalidator/valtest/*.proto
install: install-logger

PLAYGROUND=./protobuf/protoc-gen-govalidator/playground
PLAYGROUND_GEN=$(PLAYGROUND)/gen
Expand All @@ -82,32 +43,6 @@ endif
--debug_out="${PLAYGROUND}:${PLAYGROUND}" \
$(PLAYGROUND)/*.proto

.PHONY: govalidator-valtest1
playground-generated-code: install-govalidator # Generates code from protobuf files
protoc \
-I$(PLAYGROUND) \
-I$(GOPATH)/src \
-I. \
--go_out=paths=source_relative:$(PLAYGROUND_GEN) \
--govalidator_out=paths=source_relative:$(PLAYGROUND_GEN) \
$(PLAYGROUND)/*.proto

.PHONY: govalidator-valtest-test
govalidator-valtest-test:
go test github.com/SafetyCulture/s12-proto/protobuf/protoc-gen-govalidator/valtest

.PHONY: s12perm
s12perm: install-s12perm
protoc \
-I./protobuf/protoc-gen-s12perm/example \
-I$(GOPATH)/src \
-I. \
--s12perm_out=paths=source_relative:protobuf/protoc-gen-s12perm/example \
protobuf/protoc-gen-s12perm/example/*proto

.PHONY: s12perm-test
s12perm-test: s12perm
cd protobuf/protoc-gen-s12perm/example && go test

.PHONY: logger
logger: install-logger
Expand Down Expand Up @@ -143,4 +78,4 @@ gogrpcmock: install-gogrpcmock


.PHONY: example
example: govalidator logger
example: logger
11 changes: 2 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,13 @@ go 1.18
require (
github.com/gofrs/uuid v3.3.0+incompatible
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.5.4
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428
github.com/stretchr/testify v1.7.0
google.golang.org/protobuf v1.34.2
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)

require (
github.com/corpix/uarand v0.1.1 // indirect
golang.org/x/text v0.18.0
)
require github.com/corpix/uarand v0.1.1 // indirect
9 changes: 0 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ github.com/gofrs/uuid v3.3.0+incompatible h1:8K4tyRfvU1CYPgJsveYFQMhpFd/wXNM7iK6
github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls=
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428 h1:Mo9W14pwbO9VfRe+ygqZ8dFbPpoIK1HFrG/zjTuQ+nc=
github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428/go.mod h1:uhpZMVGznybq1itEKXj6RYw9I71qK4kH+OGMjRC4KEo=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
Expand All @@ -27,12 +23,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
74 changes: 0 additions & 74 deletions protobuf/protoc-gen-govalidator/README.md

This file was deleted.

Loading