Skip to content

Commit

Permalink
Rename .gen -> gen for go 1.16 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxx committed Feb 17, 2021
1 parent d39d428 commit bde61b5
Show file tree
Hide file tree
Showing 159 changed files with 329 additions and 330 deletions.
26 changes: 13 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ $(BIN)/protoc: | $(BIN)
cp $(BIN)/protoc-zip/bin/protoc $(BIN)/protoc

# any generated file - they all depend on each other / are generated at once, so any will work
PROTO_GEN_SRC = ./.gen/proto/admin/v1/service.pb.go
PROTO_GEN_SRC = ./gen/proto/admin/v1/service.pb.go

THRIFT_GENDIR=.gen/go
THRIFT_GENDIR=gen/go
THRIFT_SRCS := $(shell find idls -name '*.thrift')
# concrete targets to build / the "sentinel" go files that need to be produced per thrift file.
# idls/thrift/thing.thrift -> thing.thrift -> thing -> ./.gen/go/thing/thing.go
# idls/thrift/thing.thrift -> thing.thrift -> thing -> ./gen/go/thing/thing.go
THRIFT_GEN_SRC := $(foreach tsrc,$(basename $(subst idls/thrift/,,$(THRIFT_SRCS))),./$(THRIFT_GENDIR)/$(tsrc)/$(tsrc).go)

# this is a "false" dependency chain, but it convinces make that "need to make thriftrw(-plugin-yarpc)"
Expand All @@ -130,7 +130,7 @@ $(THRIFT_SRCS): $(BIN)/thriftrw $(BIN)/thriftrw-plugin-yarpc
# how to generate each thrift file.
# note that each generated file depends on ALL thrift files - this is necessary because they can import each other.
$(THRIFT_GEN_SRC): $(THRIFT_SRCS) go.mod
@# .gen/go/thing/thing.go -> thing.go -> "thing " -> thing -> idls/thrift/thing.thrift
@# gen/go/thing/thing.go -> thing.go -> "thing " -> thing -> idls/thrift/thing.thrift
@echo 'thriftrw for idls/thrift/$(strip $(basename $(notdir $@))).thrift...'
@$(BIN_PATH) $(BIN)/thriftrw \
--plugin=yarpc \
Expand Down Expand Up @@ -163,7 +163,7 @@ ALL_SRC := $(FRESH_ALL_SRC)
ALL_SRC += $(THRIFT_GEN_SRC)
ALL_SRC += $(PROTO_GEN_SRC)
ALL_SRC := $(sort $(ALL_SRC)) # dedup
LINT_SRC := $(filter-out %_test.go ./.gen/%, $(ALL_SRC))
LINT_SRC := $(filter-out %_test.go ./gen/%, $(ALL_SRC))
# all directories with *_test.go files in them (exclude host/xdc)
TEST_DIRS := $(filter-out $(INTEG_TEST_XDC_ROOT)%, $(sort $(dir $(filter %_test.go,$(ALL_SRC)))))
# all tests other than end-to-end integration test fall into the pkg_test category
Expand Down Expand Up @@ -201,7 +201,7 @@ thriftc: $(THRIFT_GEN_SRC) copyright ## rebuild thrift-generated source files
proto: proto-lint proto-compile fmt copyright

PROTO_ROOT := proto
PROTO_OUT := .gen/proto
PROTO_OUT := gen/proto
PROTO_FILES = $(shell find ./$(PROTO_ROOT) -name "*.proto" | grep -v "persistenceblobs")
PROTO_DIRS = $(sort $(dir $(PROTO_FILES)))

Expand Down Expand Up @@ -342,13 +342,13 @@ cover_ndc_profile: clean bins_nothrift

$(COVER_ROOT)/cover.out: $(UNIT_COVER_FILE) $(INTEG_COVER_FILE_CASS) $(INTEG_COVER_FILE_MYSQL) $(INTEG_COVER_FILE_POSTGRES) $(INTEG_NDC_COVER_FILE_CASS) $(INTEG_NDC_COVER_FILE_MYSQL) $(INTEG_NDC_COVER_FILE_POSTGRES)
@echo "mode: atomic" > $(COVER_ROOT)/cover.out
cat $(UNIT_COVER_FILE) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_CASS) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_MYSQL) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_POSTGRES) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_CASS) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_MYSQL) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_POSTGRES) | grep -v "^mode: \w\+" | grep -vP ".gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(UNIT_COVER_FILE) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_CASS) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_MYSQL) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_COVER_FILE_POSTGRES) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_CASS) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_MYSQL) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out
cat $(INTEG_NDC_COVER_FILE_POSTGRES) | grep -v "^mode: \w\+" | grep -vP "gen|[Mm]ock[s]?" >> $(COVER_ROOT)/cover.out

cover: $(COVER_ROOT)/cover.out
go tool cover -html=$(COVER_ROOT)/cover.out;
Expand Down
2 changes: 1 addition & 1 deletion client/admin/thriftClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"go.uber.org/yarpc"

"github.com/uber/cadence/.gen/go/admin/adminserviceclient"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/admin/adminserviceclient"
)

type thriftClient struct {
Expand Down
8 changes: 4 additions & 4 deletions client/clientfactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import (

"go.uber.org/yarpc"

"github.com/uber/cadence/.gen/go/admin/adminserviceclient"
"github.com/uber/cadence/.gen/go/cadence/workflowserviceclient"
"github.com/uber/cadence/.gen/go/history/historyserviceclient"
"github.com/uber/cadence/.gen/go/matching/matchingserviceclient"
"github.com/uber/cadence/client/admin"
"github.com/uber/cadence/client/frontend"
"github.com/uber/cadence/client/history"
Expand All @@ -38,6 +34,10 @@ import (
"github.com/uber/cadence/common/membership"
"github.com/uber/cadence/common/metrics"
"github.com/uber/cadence/common/service/dynamicconfig"
"github.com/uber/cadence/gen/go/admin/adminserviceclient"
"github.com/uber/cadence/gen/go/cadence/workflowserviceclient"
"github.com/uber/cadence/gen/go/history/historyserviceclient"
"github.com/uber/cadence/gen/go/matching/matchingserviceclient"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion client/frontend/thriftClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"go.uber.org/yarpc"

"github.com/uber/cadence/.gen/go/cadence/workflowserviceclient"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/cadence/workflowserviceclient"
)

type thriftClient struct {
Expand Down
2 changes: 1 addition & 1 deletion client/history/thriftClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"go.uber.org/yarpc"

"github.com/uber/cadence/.gen/go/history/historyserviceclient"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/history/historyserviceclient"
)

type thriftClient struct {
Expand Down
2 changes: 1 addition & 1 deletion client/matching/thriftClient.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (

"go.uber.org/yarpc"

"github.com/uber/cadence/.gen/go/matching/matchingserviceclient"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/matching/matchingserviceclient"
)

type thriftClient struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/copyright/licensegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func hasCopyright(f *os.File) (bool, error) {
}

func isFileAutogenerated(path string) bool {
return strings.HasPrefix(path, ".gen")
return strings.HasPrefix(path, "gen")
}

func mustProcessPath(path string) bool {
Expand Down
2 changes: 1 addition & 1 deletion common/checksum/crc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"github.com/pborman/uuid"
"github.com/stretchr/testify/assert"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/gen/go/shared"
)

func TestCRC32OverThrift(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion common/codec/version0Thriftrw_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/stretchr/testify/suite"

workflow "github.com/uber/cadence/.gen/go/shared"
workflow "github.com/uber/cadence/gen/go/shared"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion common/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"go.uber.org/cadence/.gen/go/shared"

s "github.com/uber/cadence/.gen/go/shared"
s "github.com/uber/cadence/gen/go/shared"
)

// IntPtr makes a copy and returns the pointer to an int.
Expand Down
2 changes: 1 addition & 1 deletion common/definition/indexedKeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package definition

import "github.com/uber/cadence/.gen/go/shared"
import "github.com/uber/cadence/gen/go/shared"

// valid indexed fields on ES
const (
Expand Down
2 changes: 1 addition & 1 deletion common/domain/replication_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"sync/atomic"
"time"

"github.com/uber/cadence/.gen/go/replicator"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/codec"
"github.com/uber/cadence/common/log"
Expand All @@ -39,6 +38,7 @@ import (
"github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/replicator"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion common/elasticsearch/defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

package elasticsearch

import "github.com/uber/cadence/.gen/go/indexer"
import "github.com/uber/cadence/gen/go/indexer"

// All legal fields allowed in elastic search index
const (
Expand Down
2 changes: 1 addition & 1 deletion common/elasticsearch/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"fmt"
"time"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/metrics"
p "github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/service/config"
workflow "github.com/uber/cadence/gen/go/shared"
)

// NewGenericClient create a ES client
Expand Down
2 changes: 1 addition & 1 deletion common/messaging/kafka/producerImpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ import (

"github.com/Shopify/sarama"

"github.com/uber/cadence/.gen/go/indexer"
"github.com/uber/cadence/common/codec"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/log/tag"
"github.com/uber/cadence/common/messaging"
"github.com/uber/cadence/gen/go/indexer"
)

type (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"fmt"
"time"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/log"
p "github.com/uber/cadence/common/persistence"
Expand All @@ -34,6 +33,7 @@ import (
"github.com/uber/cadence/common/service/config"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
workflow "github.com/uber/cadence/gen/go/shared"
)

// Fixed domain values for now
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/dataInterfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import (

"github.com/pborman/uuid"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/checksum"
"github.com/uber/cadence/common/codec"
"github.com/uber/cadence/common/types"
workflow "github.com/uber/cadence/gen/go/shared"
)

// Domain status
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/elasticsearch/decodeBench_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ import (

es "github.com/uber/cadence/common/elasticsearch"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/definition"
p "github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/shared"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions common/persistence/elasticsearch/esVisibilityStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import (
"github.com/cch123/elasticsql"
"github.com/valyala/fastjson"

"github.com/uber/cadence/.gen/go/indexer"
workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/definition"
es "github.com/uber/cadence/common/elasticsearch"
Expand All @@ -46,6 +44,8 @@ import (
"github.com/uber/cadence/common/service/config"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/indexer"
workflow "github.com/uber/cadence/gen/go/shared"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions common/persistence/elasticsearch/esVisibilityStore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import (
"github.com/stretchr/testify/suite"
"github.com/valyala/fastjson"

"github.com/uber/cadence/.gen/go/indexer"
workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/definition"
es "github.com/uber/cadence/common/elasticsearch"
Expand All @@ -47,6 +45,8 @@ import (
"github.com/uber/cadence/common/service/dynamicconfig"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
"github.com/uber/cadence/gen/go/indexer"
workflow "github.com/uber/cadence/gen/go/shared"
)

type ESVisibilitySuite struct {
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/historyStore.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (

"github.com/pborman/uuid"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/codec"
"github.com/uber/cadence/common/log"
"github.com/uber/cadence/common/log/tag"
"github.com/uber/cadence/common/service/dynamicconfig"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/common/types/mapper/thrift"
workflow "github.com/uber/cadence/gen/go/shared"
)

type (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ import (
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/backoff"
p "github.com/uber/cadence/common/persistence"
"github.com/uber/cadence/common/types"
workflow "github.com/uber/cadence/gen/go/shared"
)

type (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/stretchr/testify/suite"
"github.com/uber-go/tally"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/backoff"
"github.com/uber/cadence/common/cluster"
Expand All @@ -47,6 +46,7 @@ import (
"github.com/uber/cadence/common/service"
"github.com/uber/cadence/common/service/config"
"github.com/uber/cadence/common/types"
workflow "github.com/uber/cadence/gen/go/shared"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/persistenceInterface.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import (
"fmt"
"time"

workflow "github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/checksum"
"github.com/uber/cadence/common/types"
workflow "github.com/uber/cadence/gen/go/shared"
)

type (
Expand Down
2 changes: 1 addition & 1 deletion common/persistence/serialization/thrift_decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"go.uber.org/thriftrw/protocol"
"go.uber.org/thriftrw/wire"

"github.com/uber/cadence/.gen/go/sqlblobs"
"github.com/uber/cadence/gen/go/sqlblobs"
)

type (
Expand Down
4 changes: 2 additions & 2 deletions common/persistence/serialization/thrift_mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ package serialization
import (
"time"

"github.com/uber/cadence/.gen/go/shared"
"github.com/uber/cadence/.gen/go/sqlblobs"
"github.com/uber/cadence/common"
"github.com/uber/cadence/common/types"
"github.com/uber/cadence/gen/go/shared"
"github.com/uber/cadence/gen/go/sqlblobs"
)

func shardInfoToThrift(info *ShardInfo) *sqlblobs.ShardInfo {
Expand Down
Loading

0 comments on commit bde61b5

Please sign in to comment.