From d11e96acfefbf1f38cd57f62f082a3b5c2250e99 Mon Sep 17 00:00:00 2001 From: Naud Ghebre <30516046+naudzghebre@users.noreply.github.com> Date: Wed, 18 May 2022 17:30:57 -0400 Subject: [PATCH] [dart_component][hello_world] Add a hello world dart component. Following PRs will incorporate this in an integration test (flutter/engine#33465) --- .../tests/startup_integration_test/BUILD.gn | 8 +++++ .../hello_world/BUILD.gn | 30 +++++++++++++++++++ .../hello_world/main.dart | 7 +++++ .../hello_world/meta/hello-world.cml | 6 ++++ 4 files changed, 51 insertions(+) create mode 100644 engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn create mode 100644 engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/BUILD.gn create mode 100644 engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/main.dart create mode 100644 engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/meta/hello-world.cml diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn new file mode 100644 index 0000000000..fffb456dec --- /dev/null +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/BUILD.gn @@ -0,0 +1,8 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +group("tests") { + testonly = true + deps = [ "hello_world:hello_world_dart" ] +} diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/BUILD.gn new file mode 100644 index 0000000000..42fcd964a7 --- /dev/null +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/BUILD.gn @@ -0,0 +1,30 @@ +# Copyright 2013 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//flutter/tools/fuchsia/dart/dart_component.gni") +import("//flutter/tools/fuchsia/dart/dart_library.gni") +import("//flutter/tools/fuchsia/gn-sdk/package.gni") + +dart_library("lib") { + testonly = true + package_name = "hello_world" + language_version = "2.12" + source_dir = "." + sources = [ "main.dart" ] + deps = [] +} + +dart_component("hello-world-dart-component") { + testonly = true + manifest = "meta/hello-world.cml" + main_package = "hello_world" + component_name = "hello_world" + deps = [ ":lib" ] +} + +fuchsia_component("hello_world_dart") { + testonly = true + deps = [ ":hello-world-dart-component" ] + manifest = "meta/hello-world.cml" +} diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/main.dart b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/main.dart new file mode 100644 index 0000000000..a4f6425cf1 --- /dev/null +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/main.dart @@ -0,0 +1,7 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +void main() { + print("Hello, World!"); +} diff --git a/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/meta/hello-world.cml b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/meta/hello-world.cml new file mode 100644 index 0000000000..eb20c2dc53 --- /dev/null +++ b/engine/src/flutter/shell/platform/fuchsia/dart_runner/tests/startup_integration_test/hello_world/meta/hello-world.cml @@ -0,0 +1,6 @@ +{ + program: { + data: "data/hello_world", + runner: "dart_jit_runner" + }, +}