Skip to content

Commit

Permalink
Update protoc_plugin Makefile: (#858)
Browse files Browse the repository at this point in the history
- Update `PLUGIN_SRC`

- No need to check the dir before calling `mkdir -p` as it succeeds when
the dir already exists. Remove the check.

- `build-plugin` target doesn't do anything, remove it.

- Update `clean` dirs: we no longer have a `benchmark` dir in
protoc_plugin.
  • Loading branch information
osa1 authored Jun 29, 2023
1 parent acc0462 commit 7bebbc6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions protoc_plugin/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
PLUGIN_SRC = \
prepend.dart \
bin/protoc_plugin.dart \
lib/*.dart \
lib/src/descriptor.pb.dart \
lib/src/plugin.pb.dart
lib/**/*.dart

OUTPUT_DIR=out
PLUGIN_NAME=protoc-gen-dart
Expand Down Expand Up @@ -79,8 +76,8 @@ TEST_PROTO_SRCS=$(foreach proto, $(TEST_PROTO_LIST), \

PREGENERATED_SRCS=protos/descriptor.proto protos/plugin.proto protos/dart_options.proto

$(TEST_PROTO_LIBS): $(PLUGIN_PATH) $(TEST_PROTO_SRCS)
[ -d $(TEST_PROTO_DIR) ] || mkdir -p $(TEST_PROTO_DIR)
$(TEST_PROTO_LIBS): $(PLUGIN_SRC) $(TEST_PROTO_SRCS)
mkdir -p $(TEST_PROTO_DIR)
protoc\
--experimental_allow_proto3_optional\
--dart_out=$(TEST_PROTO_DIR)\
Expand All @@ -90,8 +87,6 @@ $(TEST_PROTO_LIBS): $(PLUGIN_PATH) $(TEST_PROTO_SRCS)
$(TEST_PROTO_SRCS)
dart format $(TEST_PROTO_DIR)

build-plugin: $(PLUGIN_PATH)

update-pregenerated: $(PLUGIN_PATH) $(PREGENERATED_SRCS)
protoc --dart_out=lib/src/generated -Iprotos --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH)) $(PREGENERATED_SRCS)
rm lib/src/generated/descriptor.pb{json,server}.dart
Expand All @@ -109,5 +104,4 @@ update-goldens: protos
dart run test

clean:
rm -rf benchmark/lib/generated
rm -rf $(OUTPUT_DIR)

0 comments on commit 7bebbc6

Please sign in to comment.