From 10ca050890b37979c8327ea28083fa6723ab8574 Mon Sep 17 00:00:00 2001 From: Matt Perry Date: Wed, 23 Sep 2015 14:09:38 -0400 Subject: [PATCH] Replace C++ UpdateTask with an empty dart version, loaded as a snapshot. This adds a new placeholder dart package updater in sky/packages. This is built into a snapshot and compiled into the Sky engine binary using the same mechanism as the Dart isolate. I also added a SkyHeadless class, similar to SkyView, used for running Dart code without a view. --- packages/updater/BUILD.gn | 30 ++++++++++++++++++++++++++++++ packages/updater/lib/main.dart | 14 ++++++++++++++ packages/updater/pubspec.yaml | 9 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 packages/updater/BUILD.gn create mode 100644 packages/updater/lib/main.dart create mode 100644 packages/updater/pubspec.yaml diff --git a/packages/updater/BUILD.gn b/packages/updater/BUILD.gn new file mode 100644 index 0000000000..a900d09137 --- /dev/null +++ b/packages/updater/BUILD.gn @@ -0,0 +1,30 @@ +# 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. + +action("updater") { + snapshot = "$target_gen_dir/updater_snapshot.bin" + main_dart = "lib/main.dart" + + inputs = [ + main_dart, + ] + outputs = [ + snapshot, + ] + + sky_snapshot_dir = + get_label_info("//sky/tools/sky_snapshot($host_toolchain)", "root_out_dir") + script = "//sky/tools/run_sky_snapshot.py" + + args = [ + "--compiler", rebase_path("$sky_snapshot_dir/sky_snapshot", root_build_dir), + "--package-root", rebase_path("packages", root_build_dir), + "--snapshot", rebase_path(snapshot, root_build_dir), + "--main", rebase_path(main_dart, root_build_dir), + ] + + deps = [ + "//sky/tools/sky_snapshot($host_toolchain)", + ] +} diff --git a/packages/updater/lib/main.dart b/packages/updater/lib/main.dart new file mode 100644 index 0000000000..4c71346b86 --- /dev/null +++ b/packages/updater/lib/main.dart @@ -0,0 +1,14 @@ +// 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. + +class UpdateTask { + UpdateTask() {} + + String toString() => "UpdateTask()"; +} + +void main() { + var x = new UpdateTask(); + print("Success: $x"); +} diff --git a/packages/updater/pubspec.yaml b/packages/updater/pubspec.yaml new file mode 100644 index 0000000000..e76531eaaa --- /dev/null +++ b/packages/updater/pubspec.yaml @@ -0,0 +1,9 @@ +name: sky_updater +version: 0.0.1 +author: Chromium Authors +description: The autoupdater for flutter +homepage: http://flutter.io +dependencies: + mojo: ^0.0.21 +environment: + sdk: '>=1.12.0 <2.0.0'