Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: Makefile

Issue 2107023003: stop using dart2dart in Makefile (Closed) Base URL: git@github.com:dart-lang/dart-protoc-plugin.git@master
Patch Set: fix description Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | bin/protoc-gen-dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 PLUGIN_SRC = \ 1 PLUGIN_SRC = \
2 prepend.dart \ 2 prepend.dart \
3 bin/protoc_plugin.dart \ 3 bin/protoc_plugin.dart \
4 lib/*.dart \ 4 lib/*.dart \
5 lib/src/descriptor.pb.dart \ 5 lib/src/descriptor.pb.dart \
6 lib/src/plugin.pb.dart 6 lib/src/plugin.pb.dart
7 7
8 OUTPUT_DIR=out 8 OUTPUT_DIR=out
9 PLUGIN_NAME=protoc-gen-dart 9 PLUGIN_NAME=protoc-gen-dart
10 PLUGIN_PATH=$(OUTPUT_DIR)/$(PLUGIN_NAME) 10 PLUGIN_PATH=bin/$(PLUGIN_NAME)
11 11
12 BENCHMARK_PROTOS = $(wildcard benchmark/protos/*.proto) 12 BENCHMARK_PROTOS = $(wildcard benchmark/protos/*.proto)
13 13
14 TEST_PROTO_LIST = \ 14 TEST_PROTO_LIST = \
15 google/protobuf/unittest_import \ 15 google/protobuf/unittest_import \
16 google/protobuf/unittest_optimize_for \ 16 google/protobuf/unittest_optimize_for \
17 google/protobuf/unittest \ 17 google/protobuf/unittest \
18 dart_name \ 18 dart_name \
19 dart_options \ 19 dart_options \
20 descriptor_2_5_opensource \ 20 descriptor_2_5_opensource \
(...skipping 19 matching lines...) Expand all
40 $(TEST_PROTO_DIR)/$(f).pb.dart \ 40 $(TEST_PROTO_DIR)/$(f).pb.dart \
41 $(TEST_PROTO_DIR)/$(f).pbenum.dart \ 41 $(TEST_PROTO_DIR)/$(f).pbenum.dart \
42 $(TEST_PROTO_DIR)/$(f).pbserver.dart \ 42 $(TEST_PROTO_DIR)/$(f).pbserver.dart \
43 $(TEST_PROTO_DIR)/$(f).pbjson.dart) 43 $(TEST_PROTO_DIR)/$(f).pbjson.dart)
44 TEST_PROTO_SRC_DIR=test/protos 44 TEST_PROTO_SRC_DIR=test/protos
45 TEST_PROTO_SRCS=$(foreach proto, $(TEST_PROTO_LIST), \ 45 TEST_PROTO_SRCS=$(foreach proto, $(TEST_PROTO_LIST), \
46 $(TEST_PROTO_SRC_DIR)/$(proto).proto) 46 $(TEST_PROTO_SRC_DIR)/$(proto).proto)
47 47
48 PREGENERATED_SRCS=lib/descriptor.proto lib/plugin.proto 48 PREGENERATED_SRCS=lib/descriptor.proto lib/plugin.proto
49 49
50
51 $(PLUGIN_PATH): $(PLUGIN_SRC)
52 [ -d $(OUTPUT_DIR) ] || mkdir $(OUTPUT_DIR)
53 # --categories=all is a hack, it should be --categories=Server once dart 2dart bug is fixed.
54 dart2js --checked --output-type=dart --show-package-warnings --categorie s=all -o$(PLUGIN_PATH) bin/protoc_plugin.dart
55 dart prepend.dart $(PLUGIN_PATH)
56 chmod +x $(PLUGIN_PATH)
57
58 $(TEST_PROTO_LIBS): $(PLUGIN_PATH) $(TEST_PROTO_SRCS) 50 $(TEST_PROTO_LIBS): $(PLUGIN_PATH) $(TEST_PROTO_SRCS)
59 » [ -d $(TEST_PROTO_DIR) ] || mkdir $(TEST_PROTO_DIR) 51 » [ -d $(TEST_PROTO_DIR) ] || mkdir -p $(TEST_PROTO_DIR)
60 protoc\ 52 protoc\
61 --dart_out=$(TEST_PROTO_DIR)\ 53 --dart_out=$(TEST_PROTO_DIR)\
62 -I$(TEST_PROTO_SRC_DIR)\ 54 -I$(TEST_PROTO_SRC_DIR)\
63 --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH))\ 55 --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH))\
64 $(TEST_PROTO_SRCS) 56 $(TEST_PROTO_SRCS)
65 57
66 .PHONY: build-plugin build-benchmark-protos build-benchmarks \ 58 .PHONY: build-plugin build-benchmark-protos build-benchmarks \
67 update-pregenerated protos run-tests clean 59 update-pregenerated protos run-tests clean
68 60
69 build-plugin: $(PLUGIN_PATH) 61 build-plugin: $(PLUGIN_PATH)
70 62
71 update-pregenerated: $(PLUGIN_PATH) $(PREGENERATED_SRCS) 63 update-pregenerated: $(PLUGIN_PATH) $(PREGENERATED_SRCS)
72 protoc --dart_out=lib/src -Ilib --plugin=protoc-gen-dart=$(realpath $(PL UGIN_PATH)) $(PREGENERATED_SRCS) 64 protoc --dart_out=lib/src -Ilib --plugin=protoc-gen-dart=$(realpath $(PL UGIN_PATH)) $(PREGENERATED_SRCS)
73 65
74 protos: $(PLUGIN_PATH) $(TEST_PROTO_LIBS) 66 protos: $(PLUGIN_PATH) $(TEST_PROTO_LIBS)
75 mkdir -p benchmark/lib/generated 67 mkdir -p benchmark/lib/generated
76 protoc \ 68 protoc \
77 --dart_out=benchmark/lib/generated \ 69 --dart_out=benchmark/lib/generated \
78 -Ibenchmark/protos \ 70 -Ibenchmark/protos \
79 --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH)) \ 71 --plugin=protoc-gen-dart=$(realpath $(PLUGIN_PATH)) \
80 $(BENCHMARK_PROTOS) 72 $(BENCHMARK_PROTOS)
81 73
82 run-tests: protos 74 run-tests: protos
83 pub run test 75 pub run test
84 76
85 clean: 77 clean:
86 rm -rf benchmark/lib/generated 78 rm -rf benchmark/lib/generated
87 rm -rf $(OUTPUT_DIR) 79 rm -rf $(OUTPUT_DIR)
OLDNEW
« no previous file with comments | « no previous file | bin/protoc-gen-dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698