From c6b927d8b882d5a913f8fa36e62ecf6ec1435913 Mon Sep 17 00:00:00 2001 From: Brian Slesinsky Date: Thu, 18 Aug 2016 17:11:18 -0700 Subject: [PATCH] Stop using dart2dart in Makefile It has been deprecated for a long time and no longer works in Dart 1.18. BUG=https://github.com/dart-lang/dart-protoc-plugin/issues/58 Review URL: https://chromiumcodereview.appspot.com//2107023003 . --- Makefile | 12 ++---------- bin/protoc-gen-dart | 2 ++ prepend.dart | 12 ------------ 3 files changed, 4 insertions(+), 22 deletions(-) create mode 100755 bin/protoc-gen-dart delete mode 100755 prepend.dart diff --git a/Makefile b/Makefile index 3f9c34419..bd370d4b5 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ PLUGIN_SRC = \ OUTPUT_DIR=out PLUGIN_NAME=protoc-gen-dart -PLUGIN_PATH=$(OUTPUT_DIR)/$(PLUGIN_NAME) +PLUGIN_PATH=bin/$(PLUGIN_NAME) BENCHMARK_PROTOS = $(wildcard benchmark/protos/*.proto) @@ -47,16 +47,8 @@ TEST_PROTO_SRCS=$(foreach proto, $(TEST_PROTO_LIST), \ PREGENERATED_SRCS=lib/descriptor.proto lib/plugin.proto - -$(PLUGIN_PATH): $(PLUGIN_SRC) - [ -d $(OUTPUT_DIR) ] || mkdir $(OUTPUT_DIR) - # --categories=all is a hack, it should be --categories=Server once dart2dart bug is fixed. - dart2js --checked --output-type=dart --show-package-warnings --categories=all -o$(PLUGIN_PATH) bin/protoc_plugin.dart - dart prepend.dart $(PLUGIN_PATH) - chmod +x $(PLUGIN_PATH) - $(TEST_PROTO_LIBS): $(PLUGIN_PATH) $(TEST_PROTO_SRCS) - [ -d $(TEST_PROTO_DIR) ] || mkdir $(TEST_PROTO_DIR) + [ -d $(TEST_PROTO_DIR) ] || mkdir -p $(TEST_PROTO_DIR) protoc\ --dart_out=$(TEST_PROTO_DIR)\ -I$(TEST_PROTO_SRC_DIR)\ diff --git a/bin/protoc-gen-dart b/bin/protoc-gen-dart new file mode 100755 index 000000000..7b398d0a4 --- /dev/null +++ b/bin/protoc-gen-dart @@ -0,0 +1,2 @@ +#!/bin/bash +dart bin/protoc_plugin.dart -c "$@" diff --git a/prepend.dart b/prepend.dart deleted file mode 100755 index 5ca276f3a..000000000 --- a/prepend.dart +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env dart -import 'dart:io'; - -main(List arguments) { - final fileName = arguments.first; - final file = new File(fileName); - final content = file.readAsStringSync(); - file.writeAsStringSync('#!/usr/bin/env dart\n$content'); - // For development use the line below instead of the one above to - // avoid using the dart2dart code. - // file.writeAsStringSync('#!/bin/bash\ndart bin/protoc_plugin.dart'); -}