File tree 3 files changed +11
-15
lines changed
3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -48,14 +48,7 @@ GO_INSTALL := GOBIN='$(LOCAL_BIN)' $(GO) install
48
48
49
49
# Prefer tools we've installed with go install and Yarn to those elsewhere on
50
50
# the PATH.
51
- #
52
- # Usually, we could use the yarn run command to avoid changing the PATH
53
- # globally. Unfortunately, yarn run must be executed in or beneath UI_ROOT, but
54
- # protobuf.mk, which depends on Yarn-installed executables, needs to execute in
55
- # ORG_ROOT. It's much simpler to add the Yarn executable-installation directory
56
- # to the PATH than have protobuf.mk adjust its paths to work in both ORG_ROOT
57
- # and UI_ROOT.
58
- export PATH := $(LOCAL_BIN ) :$(UI_ROOT ) /node_modules/.bin:$(PATH )
51
+ export PATH := $(LOCAL_BIN ) :$(PATH )
59
52
60
53
# HACK: Make has a fast path and a slow path for command execution,
61
54
# but the fast path uses the PATH variable from when make was started,
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ GW_SOURCES := $(GW_PROTOS:%.proto=%.pb.gw.go)
51
51
GO_PROTOS := $(addprefix $(REPO_ROOT ) /, $(sort $(shell git -C $(REPO_ROOT ) ls-files --exclude-standard --cached --others -- '* .proto') ) )
52
52
GO_SOURCES := $(GO_PROTOS:%.proto=%.pb.go )
53
53
54
+ PBJS := $(UI_ROOT ) /node_modules/.bin/pbjs
55
+ PBTS := $(UI_ROOT ) /node_modules/.bin/pbts
56
+
54
57
UI_JS := $(UI_ROOT ) /src/js/protos.js
55
58
UI_TS := $(UI_ROOT ) /src/js/protos.d.ts
56
59
UI_SOURCES := $(UI_JS ) $(UI_TS )
@@ -101,15 +104,15 @@ $(CPP_SOURCES_TARGET): $(PROTOC) $(CPP_PROTOS)
101
104
$(UI_JS ) : $(GO_PROTOS ) $(COREOS_RAFT_PROTOS ) $(YARN_INSTALLED_TARGET )
102
105
# Add comment recognized by reviewable.
103
106
echo ' // GENERATED FILE DO NOT EDIT' > $@
104
- pbjs -t static-module -w es6 --strict-long --keep-case --path $(ORG_ROOT ) --path $(GOGO_PROTOBUF_PATH ) --path $(COREOS_PATH ) --path $(GRPC_GATEWAY_GOOGLEAPIS_PATH ) $(GW_PROTOS ) >> $@
107
+ $( PBJS ) -t static-module -w es6 --strict-long --keep-case --path $(ORG_ROOT ) --path $(GOGO_PROTOBUF_PATH ) --path $(COREOS_PATH ) --path $(GRPC_GATEWAY_GOOGLEAPIS_PATH ) $(GW_PROTOS ) >> $@
105
108
106
109
$(UI_TS ) : $(UI_JS ) $(YARN_INSTALLED_TARGET )
107
110
# Install a known-good version of jsdoc; see
108
111
# https://github.com/dcodeIO/protobuf.js/issues/716.
109
112
(cd $( UI_ROOT) /node_modules/protobufjs/cli && npm install --silent jsdoc@3.4.3)
110
113
# Add comment recognized by reviewable.
111
114
echo ' // GENERATED FILE DO NOT EDIT' > $@
112
- pbts $(UI_JS ) >> $@
115
+ $( PBTS ) $(UI_JS ) >> $@
113
116
114
117
.DEFAULT_GOAL := protos
115
118
.PHONY : protos
Original file line number Diff line number Diff line change @@ -32,20 +32,20 @@ generate: $(GOBINDATA_TARGET)
32
32
33
33
.PHONY : lint
34
34
lint : $(YARN_INSTALLED_TARGET ) | protos
35
- stylint -c .stylintrc styl
36
- tslint -c tslint.json -p tsconfig.json --type-check
35
+ yarn run -- stylint -c .stylintrc styl
36
+ yarn run -- tslint -c tslint.json -p tsconfig.json --type-check
37
37
38
38
.PHONY : test
39
39
test : $(YARN_INSTALLED_TARGET ) | protos
40
- karma start
40
+ yarn run -- karma start
41
41
42
42
.PHONY : test-watch
43
43
test-watch : $(YARN_INSTALLED_TARGET ) | protos
44
- karma start --no-single-run --auto-watch
44
+ yarn run -- karma start --no-single-run --auto-watch
45
45
46
46
$(GOBINDATA_TARGET ) : $(YARN_INSTALLED_TARGET ) $(shell git ls-files | grep -vF $(GOBINDATA_TARGET ) ) | protos
47
47
rm -rf dist
48
- webpack -p
48
+ yarn run -- webpack -p
49
49
go-bindata -nometadata -pkg ui -o $@ -prefix dist dist/...
50
50
# Add comment recognized by reviewable.
51
51
echo ' // GENERATED FILE DO NOT EDIT' >> $@
You can’t perform that action at this time.
0 commit comments