From 3a138caad214ac13dad5a925bece9a5250f9ee6e Mon Sep 17 00:00:00 2001 From: Colin Blundell Date: Wed, 13 May 2015 11:48:47 +0200 Subject: [PATCH] Create wrapper script around mojom's generate.dart in the Sky package. This CL does the following: - Moves mojom's generate.dart from bin/ to lib/ to make it available for use by a wrapper scripts in the Sky package, thus avoiding all consumers of Sky needing to directly depend on mojom to be able to call "pub run mojom:generate". - Adds a sky->mojom pub dependency and creates a wrapper script around mojom's generate.dart in the Sky package. - Augments the Sky README to explain the usage of this script. R=eseidel@chromium.org, sethladd@google.com Review URL: https://codereview.chromium.org/1136503002 --- packages/flutter/bin/init.dart | 17 +++++++++++++++++ packages/flutter/pubspec.yaml | 1 + 2 files changed, 18 insertions(+) create mode 100644 packages/flutter/bin/init.dart diff --git a/packages/flutter/bin/init.dart b/packages/flutter/bin/init.dart new file mode 100644 index 0000000000..7616fec98d --- /dev/null +++ b/packages/flutter/bin/init.dart @@ -0,0 +1,17 @@ +// Copyright 2015 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/* +* This script should be invoked via 'pub run' after 'pub get': +* $ pub run sky:init +* NOTE: The 'dart' executable must be on your $PATH for this script to work. +*/ + +import 'dart:io'; + +main(List arguments) { + ProcessResult result = Process.runSync('dart', ['-p', 'packages', 'packages/mojom/generate.dart']); + stdout.write(result.stdout); + stderr.write(result.stderr); +} diff --git a/packages/flutter/pubspec.yaml b/packages/flutter/pubspec.yaml index 12f7fafdd4..23e101f514 100644 --- a/packages/flutter/pubspec.yaml +++ b/packages/flutter/pubspec.yaml @@ -5,3 +5,4 @@ homepage: https://github.com/domokit/mojo/tree/master/sky version: 0.0.5 dependencies: mojo: '>=0.0.1 <1.0.0' + mojom: '>=0.0.4 <1.0.0'