Dart: Removes dartzip This change removes support for the dartzip format from the Dart content handler and the build rules. It also removes the upload of apptest.dartzip. In a subsequent CL, I'll move the apptest library under //mojo/public/dart. BUG= R=johnmccutchan@google.com Review URL: https://codereview.chromium.org/1311803002 .
diff --git a/examples/dart/device_info/BUILD.gn b/examples/dart/device_info/BUILD.gn index d70d23a..b063e48 100644 --- a/examples/dart/device_info/BUILD.gn +++ b/examples/dart/device_info/BUILD.gn
@@ -4,19 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_device_info_dartzip") { - output_name = "mojo_dart_device_info" - sources = [ - "lib/main.dart", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//mojo/services/device_info/public/interfaces", - ] -} - -dart_pkg("mojo_dart_device_info_pkg") { +dart_pkg("device_info") { apps = [ "lib/main.dart" ] + app_name_override = "dart_device_info" sources = [ "pubspec.yaml", ] @@ -25,10 +15,3 @@ "//mojo/public/dart", ] } - -group("device_info") { - deps = [ - ":mojo_dart_device_info_dartzip", - ":mojo_dart_device_info_pkg", - ] -}
diff --git a/examples/dart/hello_world/hello/BUILD.gn b/examples/dart/hello_world/hello/BUILD.gn index 70c8a68..e575994 100644 --- a/examples/dart/hello_world/hello/BUILD.gn +++ b/examples/dart/hello_world/hello/BUILD.gn
@@ -4,19 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_hello_dartzip") { - output_name = "mojo_dart_hello" - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - ] -} - -dart_pkg("mojo_dart_hello_pkg") { +dart_pkg("hello") { apps = [ "lib/main.dart" ] + app_name_override = "dart_hello" sources = [ "pubspec.yaml", ] @@ -24,10 +14,3 @@ "//mojo/public/dart", ] } - -group("hello") { - deps = [ - ":mojo_dart_hello_dartzip", - ":mojo_dart_hello_pkg", - ] -}
diff --git a/examples/dart/hello_world/world/BUILD.gn b/examples/dart/hello_world/world/BUILD.gn index 58d663f..bb628d3 100644 --- a/examples/dart/hello_world/world/BUILD.gn +++ b/examples/dart/hello_world/world/BUILD.gn
@@ -4,27 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_world_dartzip") { - output_name = "mojo_dart_world" - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - ] - - # This exercises the ability of the Dart content handler to run isolates in - # either strict or non-strict mode at the same time. In a Debug build, the - # content handler always runs code in strict mode, so we run in different - # modes only in a Release build. - if (!is_debug) { - strict = true - } -} - -dart_pkg("mojo_dart_world_pkg") { +dart_pkg("world") { apps = [ "lib/main.dart" ] + app_name_override = "dart_world" sources = [ "pubspec.yaml", ] @@ -40,10 +22,3 @@ strict = true } } - -group("world") { - deps = [ - ":mojo_dart_world_dartzip", - ":mojo_dart_world_pkg", - ] -}
diff --git a/examples/dart/netcat/BUILD.gn b/examples/dart/netcat/BUILD.gn index 12c8f23..15d8bcf 100644 --- a/examples/dart/netcat/BUILD.gn +++ b/examples/dart/netcat/BUILD.gn
@@ -4,22 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_netcat_dartzip") { - output_name = "mojo_dart_netcat" - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//mojo/services/files/public/interfaces", - "//mojo/services/network/public/interfaces", - "//mojo/services/terminal/public/interfaces", - ] -} - -dart_pkg("mojo_dart_netcat_pkg") { +dart_pkg("netcat") { apps = [ "lib/main.dart" ] + app_name_override = "dart_netcat" sources = [ "pubspec.yaml", ] @@ -28,10 +15,3 @@ "//mojo/public/dart", ] } - -group("netcat") { - deps = [ - ":mojo_dart_netcat_dartzip", - ":mojo_dart_netcat_pkg", - ] -}
diff --git a/examples/dart/traced_application/BUILD.gn b/examples/dart/traced_application/BUILD.gn index aad037d..bb16548 100644 --- a/examples/dart/traced_application/BUILD.gn +++ b/examples/dart/traced_application/BUILD.gn
@@ -4,20 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_traced_application_dartzip") { - output_name = "mojo_dart_traced_application" - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/common/dart:dart_dartzip", - "//mojo/public/dart:dart_dartzip", - ] -} - -dart_pkg("mojo_dart_traced_application_pkg") { +dart_pkg("traced_application") { apps = [ "lib/main.dart" ] + app_name_override = "dart_traced_application" sources = [ "pubspec.yaml", ] @@ -26,10 +15,3 @@ "//mojo/public/dart", ] } - -group("traced_application") { - deps = [ - ":mojo_dart_traced_application_dartzip", - ":mojo_dart_traced_application_pkg", - ] -}
diff --git a/examples/dart/wget/BUILD.gn b/examples/dart/wget/BUILD.gn index 563beb8..de4d861 100644 --- a/examples/dart/wget/BUILD.gn +++ b/examples/dart/wget/BUILD.gn
@@ -4,20 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_wget_dartzip") { - output_name = "dart_wget" - sources = [ - "lib/main.dart", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//mojo/public/interfaces/network", - "//mojo/services/network/public/interfaces", - ] -} - -dart_pkg("mojo_dart_wget_pkg") { +dart_pkg("wget") { apps = [ "lib/main.dart" ] + app_name_override = "dart_wget" sources = [ "pubspec.yaml", ] @@ -26,10 +15,3 @@ "//mojo/public/dart", ] } - -group("wget") { - deps = [ - ":mojo_dart_wget_dartzip", - ":mojo_dart_wget_pkg", - ] -}
diff --git a/mojo/common/dart/BUILD.gn b/mojo/common/dart/BUILD.gn index 5637a67..e296077 100644 --- a/mojo/common/dart/BUILD.gn +++ b/mojo/common/dart/BUILD.gn
@@ -4,19 +4,7 @@ import("//mojo/public/dart/rules.gni") -dartzip_package("dart_dartzip") { - sources = [ - "lib/trace_provider_impl.dart", - "lib/tracing_helper.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//mojo/services/tracing/public/interfaces", - ] -} - -dart_pkg("dart_pkg") { +dart_pkg("dart") { libs = [ "lib/tracing_helper.dart" ] sources = [ "lib/trace_provider_impl.dart", @@ -27,10 +15,3 @@ "//mojo/dart/mojo_services", ] } - -group("dart") { - deps = [ - ":dart_dartzip", - ":dart_pkg", - ] -}
diff --git a/mojo/dart/apptest/BUILD.gn b/mojo/dart/apptest/BUILD.gn index ef5b474..36e25c4 100644 --- a/mojo/dart/apptest/BUILD.gn +++ b/mojo/dart/apptest/BUILD.gn
@@ -4,18 +4,7 @@ import("//mojo/public/dart/rules.gni") -dartzip_package("mojo_dart_apptest_dartzip") { - uses_pub = true - sources = [ - "lib/apptest.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - ] -} - -dart_pkg("mojo_dart_apptest_pkg") { +dart_pkg("apptest") { libs = [ "lib/apptest.dart" ] sources = [ "pubspec.yaml", @@ -25,10 +14,3 @@ "//third_party/dart-pkg", ] } - -group("apptest") { - deps = [ - ":mojo_dart_apptest_dartzip", - ":mojo_dart_apptest_pkg", - ] -}
diff --git a/mojo/dart/apptest/lib/apptest.dart b/mojo/dart/apptest/lib/apptest.dart index 9d02309..96c76f0 100644 --- a/mojo/dart/apptest/lib/apptest.dart +++ b/mojo/dart/apptest/lib/apptest.dart
@@ -10,8 +10,7 @@ import 'package:mojo/bindings.dart'; import 'package:mojo/core.dart'; -// Import and reexport the test package. We are a *.dartzip file designed to -// be linked into your_apptest.mojo file and are your main entrypoint. +// Import and reexport the test package. import 'package:test/test.dart'; export 'package:test/test.dart';
diff --git a/mojo/dart/http_load_test/BUILD.gn b/mojo/dart/http_load_test/BUILD.gn index 45888ed..b439ed0 100644 --- a/mojo/dart/http_load_test/BUILD.gn +++ b/mojo/dart/http_load_test/BUILD.gn
@@ -4,21 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_package("mojo_dart_http_load_test_dartzip") { - uses_pub = true - sources = [ - "lib/main.dart", - "lib/src/part0.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//mojo/dart/mojo_services:mojo_services_dartzip", - ] -} - -dart_pkg("mojo_dart_http_load_test_pkg") { +dart_pkg("http_load_test") { apps = [ "lib/main.dart" ] + app_name_override = "dart_http_load_test" sources = [ "lib/src/part0.dart", "pubspec.yaml", @@ -28,10 +16,3 @@ "//mojo/dart/mojo_services", ] } - -group("http_load_test") { - deps = [ - ":mojo_dart_http_load_test_dartzip", - ":mojo_dart_http_load_test_pkg", - ] -}
diff --git a/mojo/dart/mojo_services/BUILD.gn b/mojo/dart/mojo_services/BUILD.gn index 3b06c0a..bda57f8 100644 --- a/mojo/dart/mojo_services/BUILD.gn +++ b/mojo/dart/mojo_services/BUILD.gn
@@ -5,16 +5,7 @@ import("//mojo/public/dart/rules.gni") import("//mojo/services/mojo_services.gni") -dartzip_package("mojo_services_dartzip") { - sources = [ - "CHANGELOG.md", - "README.md", - "pubspec.yaml", - ] - deps = mojo_services -} - -dart_pkg("mojo_services_pkg") { +dart_pkg("mojo_services") { sources = [ "CHANGELOG.md", "README.md", @@ -25,10 +16,3 @@ "//mojo/services", ] } - -group("mojo_services") { - deps = [ - ":mojo_services_dartzip", - ":mojo_services_pkg", - ] -}
diff --git a/mojo/dart/observatory_test/BUILD.gn b/mojo/dart/observatory_test/BUILD.gn index 08c8415..87c2389 100644 --- a/mojo/dart/observatory_test/BUILD.gn +++ b/mojo/dart/observatory_test/BUILD.gn
@@ -4,18 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("observatory_test_dartzip") { - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - ] -} - -dart_pkg("observatory_test_pkg") { +dart_pkg("observatory_test") { apps = [ "lib/main.dart" ] + app_name_override = "dart_observatory_test" sources = [ "pubspec.yaml", ] @@ -23,10 +14,3 @@ "//mojo/public/dart", ] } - -group("observatory_test") { - deps = [ - ":observatory_test_dartzip", - ":observatory_test_pkg", - ] -}
diff --git a/mojo/dart/observatory_tester/runner.py b/mojo/dart/observatory_tester/runner.py index 3c2cac2..4cd1b4b 100755 --- a/mojo/dart/observatory_tester/runner.py +++ b/mojo/dart/observatory_tester/runner.py
@@ -11,7 +11,7 @@ import sys MOJO_SHELL = 'mojo_shell' -TESTEE = 'mojo:observatory_test_dartzip' +TESTEE = 'mojo:dart_observatory_test' def main(build_dir, dart_exe, tester_script): shell_exe = os.path.join(build_dir, MOJO_SHELL)
diff --git a/mojo/public/dart/BUILD.gn b/mojo/public/dart/BUILD.gn index a6fa7d0..1c78bd1 100644 --- a/mojo/public/dart/BUILD.gn +++ b/mojo/public/dart/BUILD.gn
@@ -31,22 +31,7 @@ "lib/src/utils.dart", ] -dartzip_package("dart_dartzip") { - sources = dart_mojo_sdk_entrypoints + dart_mojo_sdk_sources + [ - "pubspec.yaml", - "CHANGELOG.md", - "README.md", - ] - uses_pub = true - package_name_override = "mojo" - deps = [ - "../interfaces/application", - "../interfaces/bindings", - "../interfaces/network", - ] -} - -dart_pkg("dart_pkg") { +dart_pkg("dart") { libs = dart_mojo_sdk_entrypoints sources = dart_mojo_sdk_sources + [ "lib/_sdkext", @@ -62,10 +47,3 @@ "../interfaces", ] } - -group("dart") { - deps = [ - ":dart_dartzip", - ":dart_pkg", - ] -}
diff --git a/mojo/public/dart/README.md b/mojo/public/dart/README.md index 6252690..5decce3 100644 --- a/mojo/public/dart/README.md +++ b/mojo/public/dart/README.md
@@ -8,53 +8,47 @@ ## Application Packaging All Dart sources for a Mojo application are collected in a specially formatted -zip file, which is understood by Dart's content handler in the Mojo shell. +snapshot file, which is understood by Dart's content handler in the Mojo shell. This section describes what the various parts of that package are, and how they all make it to the right place. ### GN Template -Dart Mojo applications are built with the GN template -'dartzip_packaged_application' defined in `//mojo/public/dart/rules.gni`. -Here is an example: +Dart Mojo applications are built with the GN template 'dart_pkg' defined in +`//mojo/public/dart/rules.gni`. Here is an example: ``` -dartzip_packaged_application("foo") { - output_name = "dart_foo" - uses_pub = true +dart_pkg("foo") { + app_name_override = "dart_foo" + app = "lib/main.dart" sources = [ - "main.dart", - "foo.dart", + "lib/foo.dart", + "pubspec.yaml", ] deps = [ + ":foo_mojom", "//mojo/public/dart", - "//mojo/services/network/public/interfaces", + ] +} + +mojom("foo_mojom") { + sources = [ + "foo.mojom", ] } ``` -There are several parts: -* `output_name` is the name of the resulting .mojo file if it should be - different from the name of the target. (In this case we get dart_foo.mojo - instead of foo.mojo.) -* `uses_pub` should be true when the application depends on Dart packages pulled - down from pub. The application should have `pubspec.yaml` and `pubspec.lock` - files adjacent to `main.dart`. More on this below. -* `sources` is the list of Dart sources for the application. Each application - **must** contain a `main.dart` file. `main.dart` must be the library entry - point, and must contain the `main()` function. -* `deps` has the usual meaning. In the example above, - `//mojo/services/network/public/interfaces` indicates that the "foo" - application uses the Dart bindings generated for the network service. +There are several parts. See the documentation in `//mojo/public/dart/rules.gni` +for all the details. ### pub packages Dart Mojo applications may use packages from the pub package repository at pub.dartlang.org. -The "foo" example above has `uses_pub` set to true. Suppose its `pubspec.yaml` -is as follows: +The "foo" example above has `uses_pub` set to true. Suppose the "foo" package's +`pubspec.yaml` is as follows: ``` name: foo @@ -73,8 +67,8 @@ pub packages to specific versions. This `pubspec.lock` file must be checked in in order to have hermetic builds. -During the build, The `dartzip_packaged_application` rule looks for a -"packages/" directory, and copies its contents into the zip file. +During the build, The `dart_pkg` rule looks for a "packages/" directory, and +ensures that its contents are available when running the application. ### Generated bindings @@ -82,45 +76,53 @@ and the templates under `//mojo/public/tools/bindings/generators/dart_templates` govern how `.mojom` files are compiled into Dart code. -Consider the `network_error.mojom` file from the network services used by our -"foo" example: +Consider the `foo.mojom` file used by our example: ``` -module mojo; +[DartPackage="foo"] +module foo; -struct NetworkError { +struct Foo { int32 code; string? description; }; ``` -This contents of this file are in the `mojo` module. The Dart source generated -for this file will end up under, e.g. -`//out/Debug/gen/dart-gen/mojom/mojo/network_error.mojom.dart`, along with the -other Dart sources generated for `.mojom` files in the `mojo` module. +This contents of this file are in the `foo` module. The Dart source generated +for this file will end up under, e.g. `//out/Debug/gen/dart- +pkg/foo/lib/foo/network_error.mojom.dart`, along with the other Dart sources +generated for `.mojom` files with the "foo" `DartPackage` annotation in the +`foo` module. -### Resulting layout +### Resulting file + +The `dart_pkg` rule has two results. The first result is a Dart snapshot file +zipped up into a .mojo file in the build output directory---something like +`//out/Release/foo.mojo`. This file is understood by the Dart content handler +and is suitable for deployment. The second result is a directory layout of the +"foo" app that can be served by a webserver. When the URL of `lib/main.dart` is +given to the `mojo_shell`, the app will be run in the Dart content handler. They layout for our "foo" example will be the following: ``` -//main.dart -//foo.dart -//crypto/... # Dart's crypto pub package. -//mojo/public/dart/... # Mojo SDK Dart libraries. -//mojom/mojo/... # Generated bindings in the mojo module. +//lib/main.dart +//lib/foo.dart +//lib/foo/foo.mojom.dart +//packages/crypto/... # Dart's crypto pub package. +//packages/mojo/... # Mojo SDK Dart libraries. ``` -Where `//mojo/public/dart` contains Dart's Mojo bindings, `//crypto` contains -the `crypto` pub package, and `//mojom/mojo` contains the generated bindings in -the mojom module for the network service. +Where `//packages/mojo` contains Dart's Mojo bindings, `//packages/crypto` +contains the `crypto` pub package, and `//lib/foo/` contains the bindings +generated for `foo.mojom`. Mojo's Dart content handler sets the package root for a Dart application to be -the root directory of the unpacked zip file. Therefore, Dart sources in this -application can use the following imports: +the packages directory. Therefore, Dart sources in this application can use the +following imports: ```dart import 'package:crypto/crypto.dart'; -import 'package:mojo/public/dart/application.dart'; -import 'package:mojom/mojo/network_error.mojom.dart'; +import 'package:foo/foo/foo.mojom.dart'; +import 'package:mojo/application.dart'; ```
diff --git a/mojo/public/dart/rules.gni b/mojo/public/dart/rules.gni index ada9e4b..f8c7ccb 100644 --- a/mojo/public/dart/rules.gni +++ b/mojo/public/dart/rules.gni
@@ -3,11 +3,7 @@ # found in the LICENSE file. # This file has rules for making Dart packages and Dart-based Mojo applications. -# -# Entrypoint rules are: -# - dart_pkg -# - dartzip_package -# - dartzip_packaged_application +# The entrypoint is the dart_pkg rule. import("../mojo.gni") import("//build/module_args/mojo.gni") @@ -411,208 +407,3 @@ } } } - -# Creates a dartzip package. -template("dartzip_package") { - package_target_name = "$target_name" - package_output = "$target_out_dir/$target_name.dartzip" - - if (defined(invoker.uses_pub) && invoker.uses_pub) { - # Repackage all dependencies pulled in via "pub get" in a dartzip file. - action("${package_target_name}_repackage") { - target_dir = get_label_info(":$target_name", "dir") - script = rebase_path("mojo/public/tools/gn/zip.py", ".", mojo_sdk_root) - - package_name = "$package_target_name" - if (defined(invoker.package_name_override)) { - package_name = invoker.package_name_override - } - - # Get a list of the files in packages/ as inputs. - list_packages_contents_script = - rebase_path("mojo/public/tools/dart_list_packages_contents.py", - ".", - mojo_sdk_root) - rebase_target_dir = rebase_path(target_dir, root_build_dir) - inputs = exec_script(list_packages_contents_script, - [ - "--target-directory", - rebase_target_dir, - "--package-name", - package_name, - ], - "list lines", - [ target_dir + "/pubspec.lock" ]) - - # Zip up all the pulled-in files relative to their location in the - # packages dir. - output = "$target_out_dir/$target_name.dartzip" - outputs = [ - output, - ] - rebase_base_dir = rebase_target_dir - rebase_inputs = rebase_path(inputs, root_build_dir) - rebase_output = rebase_path(output, root_build_dir) - args = [ - "--base-dir=$rebase_base_dir", - "--inputs=$rebase_inputs", - "--output=$rebase_output", - ] - } - } - - action("${package_target_name}_package") { - script = - rebase_path("mojo/public/tools/dart_package.py", ".", mojo_sdk_root) - - inputs = invoker.sources - - deps = [] - zip_inputs = [] - - if (defined(invoker.uses_pub) && invoker.uses_pub) { - deps += [ ":${package_target_name}_repackage" ] - } - - if (defined(invoker.deps)) { - deps += invoker.deps - foreach(d, deps) { - dep_name = get_label_info(d, "name") - dep_target_out_dir = get_label_info(d, "target_out_dir") - zip_inputs += [ "$dep_target_out_dir/$dep_name.dartzip" ] - } - } - - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps - } - - output = package_output - outputs = [ - output, - ] - - rebase_base_dir = - rebase_path(get_label_info(":$package_target_name", "dir"), - root_build_dir) - if (defined(invoker.base_dir)) { - rebase_base_dir = invoker.base_dir - } - rebase_inputs = rebase_path(inputs, root_build_dir) - rebase_zip_inputs = rebase_path(zip_inputs, root_build_dir) - rebase_output = rebase_path(output, root_build_dir) - - args = [ - "--base-dir=$rebase_base_dir", - "--inputs=$rebase_inputs", - "--zip-inputs=$rebase_zip_inputs", - "--output=$rebase_output", - ] - } - - action(target_name) { - script = - rebase_path("mojo/public/tools/dart_analyze.py", ".", mojo_sdk_root) - - sources = [ - package_output, - ] - - args = [ - "--dart-sdk", - rebase_path(dart_sdk_root), - "--dartzip-file", - rebase_path(package_output), - "--stamp-file", - rebase_path("$target_gen_dir/${package_target_name}_analyze.stamp"), - "--no-hints", - ] - - public_deps = [ - ":${package_target_name}_package", - ] - if (defined(invoker.deps)) { - deps = invoker.deps - } - - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps - } - - outputs = [ - "$target_gen_dir/${package_target_name}_analyze.stamp", - ] - } -} - -# Use this template to generate a .mojo dart application. One of the source -# files should be named main.dart and contain a main function as the -# entry point. Dependencies of dart_packaged_application targets should be -# either mojom targets (and specified using the mojom_deps variable) or -# dartzip_package targets. -template("dartzip_packaged_application") { - package_name = "${target_name}_package" - package_output = "$target_out_dir/$package_name.dartzip" - - if (defined(invoker.output_name)) { - mojo_output = "$root_out_dir/" + invoker.output_name + ".mojo" - } else { - mojo_output = "$root_out_dir/" + target_name + ".mojo" - } - - dartzip_package(package_name) { - sources = invoker.sources - if (defined(invoker.deps)) { - deps = invoker.deps - } - if (defined(invoker.uses_pub)) { - uses_pub = invoker.uses_pub - } - if (defined(invoker.mojom_deps)) { - mojom_deps = invoker.mojom_deps - } - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps - } - } - - action(target_name) { - script = rebase_path("mojo/public/tools/prepend.py", ".", mojo_sdk_root) - - input = package_output - inputs = [ - input, - ] - - output = mojo_output - outputs = [ - output, - ] - - deps = [ - ":$package_name", - ] - if (defined(invoker.deps)) { - deps += invoker.deps - } - if (defined(invoker.mojom_deps)) { - deps += invoker.mojom_deps - } - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps - } - - line = "#!mojo mojo:dart_content_handler" - if (is_debug || (defined(invoker.strict) && invoker.strict == true)) { - line = "#!mojo mojo:dart_content_handler?strict=true" - } - - rebase_input = rebase_path(input, root_build_dir) - rebase_output = rebase_path(output, root_build_dir) - args = [ - "--input=$rebase_input", - "--output=$rebase_output", - "--line=$line", - ] - } -}
diff --git a/mojo/public/tools/BUILD.gn b/mojo/public/tools/BUILD.gn index 28a4925..1162586 100644 --- a/mojo/public/tools/BUILD.gn +++ b/mojo/public/tools/BUILD.gn
@@ -101,18 +101,3 @@ ] } } - -# This rule can be seen as a sort of adapter. This takes a dart framework -# loaded from Google Storage and then puts it in a rule which the -# "dartzip_package" template in mojo/public/dart/rules.gni can introspect on, -# accessing the 'label' and 'target_out_dir' variables. -if (mojo_use_dart_apptest_framework) { - copy("dart_apptest_framework") { - sources = [ - "prebuilt/frameworks/apptest.dartzip", - ] - outputs = [ - "$target_out_dir/dart_apptest_framework.dartzip", - ] - } -}
diff --git a/mojo/public/tools/bindings/mojom.gni b/mojo/public/tools/bindings/mojom.gni index f990b21..0c0f294 100644 --- a/mojo/public/tools/bindings/mojom.gni +++ b/mojo/public/tools/bindings/mojom.gni
@@ -149,7 +149,6 @@ generator_java_outputs = [ "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar" ] } - generator_dart_zip_output = "$target_out_dir/$target_name.dartzip" generator_python_zip_output = "$target_out_dir/${target_name}_python.pyzip" rebased_mojo_sdk_public_deps = [] @@ -234,7 +233,6 @@ if (defined(invoker.deps)) { deps += invoker.deps } - data_deps = [ ":${target_name}_dart" ] if (defined(invoker.mojo_sdk_deps)) { foreach(sdk_dep, invoker.mojo_sdk_deps) { # Check that the SDK dep was not mistakenly given as an absolute path. @@ -309,50 +307,6 @@ } } - action("${target_name}_dart") { - script = rebase_path("mojo/public/tools/gn/zip.py", ".", mojo_root) - - deps = [] - zip_inputs = [] - - if (defined(invoker.sources)) { - inputs = process_file_template(invoker.sources, generator_dart_outputs) - deps += [ ":$generator_target_name" ] - } - - foreach(d, all_deps) { - # Resolve the name, so that a target //mojo/something becomes - # //mojo/something:something and we can append "_dart" to get the dart - # dependency name. - full_name = get_label_info(d, "label_no_toolchain") - dep_name = get_label_info(d, "name") - dep_target_out_dir = get_label_info(d, "target_out_dir") - deps += [ "${full_name}_dart" ] - zip_inputs += [ "$dep_target_out_dir/$dep_name.dartzip" ] - } - - output = generator_dart_zip_output - outputs = [ - output, - ] - - rebase_import_from = - rebase_path("$root_build_dir/gen/dart-gen", root_build_dir) - if (defined(invoker.sources)) { - rebase_inputs = rebase_path(inputs, root_build_dir) - } - rebase_zip_inputs = rebase_path(zip_inputs, root_build_dir) - rebase_output = rebase_path(output, root_build_dir) - args = [ - "--base-dir=$rebase_import_from", - "--zip-inputs=$rebase_zip_inputs", - "--output=$rebase_output", - ] - if (defined(invoker.sources)) { - args += [ "--link-inputs=$rebase_inputs" ] - } - } - if (defined(invoker.sources)) { # The generated C++ source files. The main reason to introduce this target # is so that mojo/public/cpp/bindings can depend on mojom interfaces without
diff --git a/mojo/public/tools/dart_analyze.py b/mojo/public/tools/dart_analyze.py index 23119ee..0b49c23 100755 --- a/mojo/public/tools/dart_analyze.py +++ b/mojo/public/tools/dart_analyze.py
@@ -6,8 +6,7 @@ # To integrate dartanalyze with our build system, we take an input file, run # the analyzer on it, and write a stamp file if it passed. -# This script can either analyze a dartzip package, specified with the -# --dartzip-file flag, or a set of entrypoints specified with the --entrypoints +# This script analyzes a set of entrypoints specified with the --entrypoints # flag. The location of the Dart SDK must be specified with the --dart-sdk # flag. A stamp file can optionally be written with the location given by the # --stamp-file flag. Any command line arguments not recognized by this script @@ -21,7 +20,6 @@ import subprocess import sys import tempfile -import zipfile _IGNORED_PATTERNS = [ # Ignored because they're not indicative of specific errors. @@ -63,36 +61,6 @@ return errors -def analyze_dartzip(dart_sdk, dartzip_file, stamp_file, args): - dartzip_basename = os.path.basename(dartzip_file) + ":" - - # Unzip |dartzip_file| to a temporary directory. - try: - temp_dir = tempfile.mkdtemp() - zipfile.ZipFile(dartzip_file).extractall(temp_dir) - - cmd = [ os.path.join(dart_sdk, 'bin', 'dartanalyzer') ] - - # Grab all the toplevel dart files in the archive. - dart_files = glob.glob(os.path.join(temp_dir, "*.dart")) - - if not dart_files: - return _success(stamp_file) - - cmd.extend(dart_files) - cmd.extend(args) - cmd.append("--package-root=%s/packages" % temp_dir) - cmd.append("--fatal-warnings") - - errors = analyze_and_filter(cmd, temp_dir, dartzip_basename) - - if errors is None: - return _success(stamp_file) - return min(255, len(errors)) - finally: - shutil.rmtree(temp_dir) - - def analyze_entrypoints(dart_sdk, entrypoints, args): cmd = [ os.path.join(dart_sdk, 'bin', 'dartanalyzer') ] cmd.extend(entrypoints) @@ -112,12 +80,6 @@ metavar='dart_sdk', help='Path to the Dart SDK', required=True) - parser.add_argument('--dartzip-file', - action='store', - type=str, - metavar='dartzip_file', - help='dartzip file whose contents to analyze', - default=None) parser.add_argument('--stamp-file', action='store', type=str, @@ -130,19 +92,11 @@ default=[]) args, remainder = parser.parse_known_args() - if args.dartzip_file is None and args.entrypoints == []: + if args.entrypoints == []: parser.print_help() return 1 - if args.dartzip_file is not None: - # Do not run dart analyzer on third_party sources. - if "/third_party/" in args.dartzip_file: - return _success(args.stamp_file) - return analyze_dartzip(args.dart_sdk, args.dartzip_file, args.stamp_file, - remainder) - - if args.entrypoints != []: - return analyze_entrypoints(args.dart_sdk, args.entrypoints, remainder) + return analyze_entrypoints(args.dart_sdk, args.entrypoints, remainder) if __name__ == '__main__': sys.exit(main())
diff --git a/mojo/public/tools/dart_list_packages_contents.py b/mojo/public/tools/dart_list_packages_contents.py deleted file mode 100755 index f6e0d4a..0000000 --- a/mojo/public/tools/dart_list_packages_contents.py +++ /dev/null
@@ -1,42 +0,0 @@ -#!/usr/bin/python -# 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 outputs the filenames of the files that are in the "packages/" -subdir of the given directory, relative to that directory.""" - -import argparse -import os -import sys - -def main(target_directory, package_name): - os.chdir(target_directory) - self_path = 'packages/' + package_name - for root, _, files in os.walk("packages", followlinks=True): - for f in files: - path = os.path.join(root, f) - # Skip the contents of our own packages/package_name symlink. - if not path.startswith(self_path): - print os.path.join(root, f) - -if __name__ == '__main__': - parser = argparse.ArgumentParser( - description="List filenames of files in the packages/ subdir of the " - "given directory.") - parser.add_argument("--target-directory", - dest="target_directory", - metavar="<target-directory>", - type=str, - required=True, - help="The target directory, specified relative to this " - "directory.") - parser.add_argument("--package-name", - dest="package_name", - metavar="<package-name>", - type=str, - required=True, - help="The name of the package whose packages/ is being " - "dumped.") - args = parser.parse_args() - sys.exit(main(args.target_directory, args.package_name))
diff --git a/mojo/public/tools/dart_package.py b/mojo/public/tools/dart_package.py deleted file mode 100755 index 9dcfdf4..0000000 --- a/mojo/public/tools/dart_package.py +++ /dev/null
@@ -1,172 +0,0 @@ -#!/usr/bin/env python -# -# Copyright 2014 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. - -"""Archives a set of dart packages""" - -import ast -import optparse -import os -import sys -import zipfile - -def IsPackagesPath(path): - return path.startswith('packages/') - -def IsMojomPath(path): - return path.startswith('mojom/lib/') - -def IsMojomDartFile(path): - return path.endswith('.mojom.dart') - -# Strips off |package_name|/lib/ returning module/interface.mojom.dart -def MojomDartRelativePath(package_name, path): - assert IsMojomDartFile(path) - return os.path.relpath(path, package_name + '/lib/') - -# Line is a line from pubspec.yaml -def PackageName(line): - assert line.startswith("name:") - return line.split(":")[1].strip() - -# pubspec_contents is the contents of a pubspec.yaml file, returns the package -# name. -def FindPackageName(pubspec_contents): - for line in pubspec_contents.splitlines(): - if line.startswith("name:"): - return PackageName(line) - -# Returns true if path is in lib/. -def IsPathInLib(path): - return path.startswith("lib/") - -# Strips off lib/ -def PackageRelativePath(path): - return os.path.relpath(path, "lib/") - -def HasPubspec(paths): - for path in paths: - _, filename = os.path.split(path) - if 'pubspec.yaml' == filename: - return True - return False - -def ReadPackageName(paths): - for path in paths: - _, filename = os.path.split(path) - if 'pubspec.yaml' == filename: - with open(path, 'r') as f: - return FindPackageName(f.read()) - return None - -def DoZip(inputs, zip_inputs, output, base_dir): - files = [] - with zipfile.ZipFile(output, 'w', zipfile.ZIP_DEFLATED) as outfile: - # Loose file inputs (package source files) - for f in inputs: - file_name = os.path.relpath(f, base_dir) - # We should never see a packages/ path here. - assert not IsPackagesPath(file_name) - files.append(file_name) - outfile.write(f, file_name) - - if HasPubspec(inputs): - # We are writing out a package, write lib/ into packages/<package_name> - # so that package:<package_name>/ imports work within the package. - package_name = ReadPackageName(inputs) - assert not (package_name is None), "pubspec.yaml does not have a name" - package_path = os.path.join("packages/", package_name) - for f in inputs: - file_name = os.path.relpath(f, base_dir) - if IsPathInLib(file_name): - output_name = os.path.join(package_path, - PackageRelativePath(file_name)) - if output_name not in files: - files.append(output_name) - outfile.write(f, output_name) - - # zip file inputs (other packages) - for zf_name in zip_inputs: - with zipfile.ZipFile(zf_name, 'r') as zf: - # Attempt to sniff package_name. If this fails, we are processing a zip - # file with mojom.dart bindings or a packages/ dump. - package_name = None - try: - with zf.open("pubspec.yaml") as pubspec_file: - package_name = FindPackageName(pubspec_file.read()) - except KeyError: - pass - - # Iterate over all files in zip file. - for f in zf.namelist(): - - # Copy any direct mojom dependencies into mojom/ - if IsMojomPath(f): - mojom_dep_copy = os.path.join("lib/mojom/", - MojomDartRelativePath("mojom", f)) - if mojom_dep_copy not in files: - files.append(mojom_dep_copy) - with zf.open(f) as zff: - outfile.writestr(mojom_dep_copy, zff.read()) - # Copy under lib/ as well. - mojom_dep_copy = os.path.join("lib/", - MojomDartRelativePath("mojom", f)) - if mojom_dep_copy not in files: - files.append(mojom_dep_copy) - with zf.open(f) as zff: - outfile.writestr(mojom_dep_copy, zff.read()) - - # Rewrite output file name, if it isn't a packages/ path. - output_name = None - if not IsPackagesPath(f): - if IsMojomDartFile(f): - # Place $package/lib/*.mojom.dart files into packages/$package/ - package = next(p for p in f.split(os.path.sep) if p) - output_name = os.path.join("packages/" + package + "/", - MojomDartRelativePath(package, f)) - else: - # We are processing a package, it must have a package name. - assert not (package_name is None) - package_path = os.path.join("packages/", package_name) - if IsPathInLib(f): - output_name = os.path.join(package_path, PackageRelativePath(f)) - else: - output_name = f; - - if output_name is None: - continue - - if output_name not in files: - files.append(output_name) - with zf.open(f) as zff: - outfile.writestr(output_name, zff.read()) - - -def main(): - parser = optparse.OptionParser() - - parser.add_option('--inputs', help='List of files to archive.') - parser.add_option('--link-inputs', - help='List of files to archive. Symbolic links are resolved.') - parser.add_option('--zip-inputs', help='List of zip files to re-archive.') - parser.add_option('--output', help='Path to output archive.') - parser.add_option('--base-dir', - help='If provided, the paths in the archive will be ' - 'relative to this directory', default='.') - options, _ = parser.parse_args() - - inputs = [] - if (options.inputs): - inputs = ast.literal_eval(options.inputs) - zip_inputs = [] - if options.zip_inputs: - zip_inputs = ast.literal_eval(options.zip_inputs) - output = options.output - base_dir = options.base_dir - - DoZip(inputs, zip_inputs, output, base_dir) - -if __name__ == '__main__': - sys.exit(main())
diff --git a/mojo/public/tools/download_archiecture_independent_frameworks.py b/mojo/public/tools/download_archiecture_independent_frameworks.py deleted file mode 100755 index c7319be..0000000 --- a/mojo/public/tools/download_archiecture_independent_frameworks.py +++ /dev/null
@@ -1,82 +0,0 @@ -#!/usr/bin/env python -# 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. - -import argparse -import os -import sys - -CURRENT_PATH = os.path.dirname(os.path.realpath(__file__)) -sys.path.insert(0, os.path.join(CURRENT_PATH, "pylib")) -import gs - -PREBUILT_FILE_PATH = os.path.join(CURRENT_PATH, "prebuilt", "frameworks") - -FILES_TO_DOWNLOAD = [ - "apptest.dartzip", -] - -def download(tools_directory, version_file): - stamp_path = os.path.join(PREBUILT_FILE_PATH, "VERSION") - - version_path = os.path.join(CURRENT_PATH, version_file) - with open(version_path) as version_file: - version = version_file.read().strip() - - try: - with open(stamp_path) as stamp_file: - current_version = stamp_file.read().strip() - if current_version == version: - return 0 # Already have the right version. - except IOError: - pass # If the stamp file does not exist we need to download new binaries. - - for file_name in FILES_TO_DOWNLOAD: - download_file(file_name, version, tools_directory) - - with open(stamp_path, 'w') as stamp_file: - stamp_file.write(version) - return 0 - - -def download_file(basename, version, tools_directory): - find_depot_tools_path = os.path.join(CURRENT_PATH, tools_directory) - sys.path.insert(0, find_depot_tools_path) - # pylint: disable=F0401 - import find_depot_tools - depot_tools_path = find_depot_tools.add_depot_tools_to_path() - - gs_path = "gs://mojo/file/" + version + "/" + basename - - output_file = os.path.join(PREBUILT_FILE_PATH, basename) - gs.download_from_public_bucket(gs_path, output_file, - depot_tools_path) - - -def main(): - parser = argparse.ArgumentParser(description="Downloads bundled frameworks " - "binaries from google storage.") - parser.add_argument("--tools-directory", - dest="tools_directory", - metavar="<tools-directory>", - type=str, - required=True, - help="Path to the directory containing " - "find_depot_tools.py, specified as a relative path " - "from the location of this file.") - parser.add_argument("--version-file", - dest="version_file", - metavar="<version-file>", - type=str, - default="../VERSION", - help="Path to the file containing the version of the " - "shell to be fetched, specified as a relative path " - "from the location of this file (default: " - "%(default)s).") - args = parser.parse_args() - return download(args.tools_directory, args.version_file) - - -if __name__ == "__main__": - sys.exit(main())
diff --git a/mojo/tools/data/apptests b/mojo/tools/data/apptests index c5e238d..6cada41 100644 --- a/mojo/tools/data/apptests +++ b/mojo/tools/data/apptests
@@ -115,11 +115,7 @@ "test": "mojo:reaper_apptests", }, { - "test": "mojo:dart_apptests_dartzip", - "type": "dart", - }, - { - "test": "mojo:dart_apptests_pkg", + "test": "mojo:dart_apptests", "type": "dart", }, {
diff --git a/mojo/tools/upload_binaries.py b/mojo/tools/upload_binaries.py index 9cd4a04..5b3aa9f 100755 --- a/mojo/tools/upload_binaries.py +++ b/mojo/tools/upload_binaries.py
@@ -38,12 +38,6 @@ "network_service_apptests.mojo", ] -ARCHITECTURE_INDEPENDENT_FILES = [ - # These are files other than *.mojo files which are part of our binary - # artifact scheme. These files must be architecture independent. - "obj/mojo/dart/apptest/apptest.dartzip", -] - def target(config): target_name = config.target_os + "-" + config.target_cpu @@ -51,6 +45,7 @@ target_name += "-official" return target_name + def find_apps_to_upload(build_dir): apps = [] for path in glob.glob(build_dir + "/*"): @@ -65,15 +60,6 @@ return apps -def find_architecture_independent_files(build_dir): - existing_files = [] - for path in ARCHITECTURE_INDEPENDENT_FILES: - joined_path = os.path.join(build_dir, path) - if os.path.isfile(joined_path): - existing_files.append(joined_path) - return existing_files - - def check_call(command_line, dry_run, **kwargs): if dry_run: print command_line @@ -194,15 +180,6 @@ upload(config, app_binary_path, gsutil_app_location, dry_run) -def upload_file(file_path, config, dry_run): - file_binary_name = os.path.basename(file_path) - version = Version().version - gsutil_file_location = "gs://mojo/file/%s/%s" % (version, file_binary_name) - - # Upload the new binary. - upload(config, file_path, gsutil_file_location, dry_run) - - def write_file_to_gs(file_contents, dest, config, dry_run): with tempfile.NamedTemporaryFile() as temp_version_file: temp_version_file.write(file_contents) @@ -251,10 +228,6 @@ for app in apps_to_upload: upload_app(app, config, args.dry_run) - files_to_upload = find_architecture_independent_files(build_directory) - for file_to_upload in files_to_upload: - upload_file(file_to_upload, config, args.dry_run) - upload_symbols(config, build_directory, args.symbols_upload_url, args.dry_run)
diff --git a/services/dart/content_handler_main.cc b/services/dart/content_handler_main.cc index b451b83..f0adeea 100644 --- a/services/dart/content_handler_main.cc +++ b/services/dart/content_handler_main.cc
@@ -165,8 +165,8 @@ base::FilePath application_dir; std::string url = response->url.get(); if (IsDartZip(response->url.get())) { - // Loading a .dartzip: - // 1) Extract the .dartzip + // Loading a zipped snapshot: + // 1) Extract the zip file. // 2) Launch from temporary directory (|application_dir|). handler_task_runner_->PostTask( FROM_HERE,
diff --git a/services/dart/dart_app.cc b/services/dart/dart_app.cc index 4ac0d25..029e86f 100644 --- a/services/dart/dart_app.cc +++ b/services/dart/dart_app.cc
@@ -26,18 +26,12 @@ bool strict) : application_request_(application_request.Pass()), application_dir_(application_dir) { - base::FilePath package_root = application_dir_.AppendASCII("packages"); - base::FilePath entry_path = application_dir_.Append("lib") - .Append("main.dart"); base::FilePath snapshot_path = application_dir_.Append("snapshot_blob.bin"); // Look for snapshot_blob.bin. If exists, then load from snapshot. if (base::PathExists(snapshot_path)) { config_.script_uri = snapshot_path.AsUTF8Unsafe(); config_.package_root = ""; - } else if (base::PathExists(entry_path)) { - config_.script_uri = entry_path.AsUTF8Unsafe(); - config_.package_root = package_root.AsUTF8Unsafe(); } else { LOG(ERROR) << "Dart entry point could not be found under: " << application_dir_.AsUTF8Unsafe();
diff --git a/services/dart/dart_apptests/BUILD.gn b/services/dart/dart_apptests/BUILD.gn index 8aa0438..92dc7bd 100644 --- a/services/dart/dart_apptests/BUILD.gn +++ b/services/dart/dart_apptests/BUILD.gn
@@ -4,33 +4,7 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("dart_apptests_dartzip") { - sources = [ - "lib/main.dart", - "lib/src/connect_to_loader_apptests.dart", - "lib/src/echo_apptests.dart", - "lib/src/io_http_apptests.dart", - "lib/src/io_internet_address_apptests.dart", - "lib/src/pingpong_apptests.dart", - "lib/src/versioning_apptests.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/dart/apptest:mojo_dart_apptest_dartzip", - "//mojo/public/interfaces/bindings/tests:versioning_test_client_interfaces", - "//mojo/public/interfaces/bindings/tests:versioning_test_service_interfaces", - "//mojo/services/url_response_disk_cache/public/interfaces", - "//services/dart/test:echo_service_interface", - "//services/dart/test:pingpong_service_interface", - ] - datadeps = [ - "//services/dart/test/echo", - "//services/dart/test/pingpong", - "//services/dart/test/pingpong_target", - ] -} - -dart_pkg("dart_apptests_pkg") { +dart_pkg("dart_apptests") { apps = [ "lib/main.dart" ] sources = [ "lib/src/connect_to_loader_apptests.dart", @@ -53,10 +27,3 @@ "//services/dart/test/pingpong_target", ] } - -group("dart_apptests") { - deps = [ - ":dart_apptests_dartzip", - ":dart_apptests_pkg", - ] -}
diff --git a/services/dart/dart_apptests/lib/src/echo_apptests.dart b/services/dart/dart_apptests/lib/src/echo_apptests.dart index 230486d..d5a817c 100644 --- a/services/dart/dart_apptests/lib/src/echo_apptests.dart +++ b/services/dart/dart_apptests/lib/src/echo_apptests.dart
@@ -16,7 +16,7 @@ group('Echo Service Apptests', () { test('String', () async { var echoProxy = new EchoServiceProxy.unbound(); - application.connectToService("mojo:mojo_dart_echo_pkg", echoProxy); + application.connectToService("mojo:dart_echo", echoProxy); var v = await echoProxy.ptr.echoString("foo"); expect(v.value, equals("foo")); @@ -29,7 +29,7 @@ test('Empty String', () async { var echoProxy = new EchoServiceProxy.unbound(); - application.connectToService("mojo:mojo_dart_echo_pkg", echoProxy); + application.connectToService("mojo:dart_echo", echoProxy); var v = await echoProxy.ptr.echoString(""); expect(v.value, equals("")); @@ -42,7 +42,7 @@ test('Null String', () async { var echoProxy = new EchoServiceProxy.unbound(); - application.connectToService("mojo:mojo_dart_echo_pkg", echoProxy); + application.connectToService("mojo:dart_echo", echoProxy); var v = await echoProxy.ptr.echoString(null); expect(v.value, equals(null)); @@ -55,7 +55,7 @@ test('Delayed Success', () async { var echoProxy = new EchoServiceProxy.unbound(); - application.connectToService("mojo:mojo_dart_echo_pkg", echoProxy); + application.connectToService("mojo:dart_echo", echoProxy); var milliseconds = 100; var watch = new Stopwatch()..start(); @@ -72,7 +72,7 @@ test('Delayed Close', () { var echoProxy = new EchoServiceProxy.unbound(); - application.connectToService("mojo:mojo_dart_echo_pkg", echoProxy); + application.connectToService("mojo:dart_echo", echoProxy); var milliseconds = 100; echoProxy.ptr.delayedEchoString("quit", milliseconds).then((_) {
diff --git a/services/dart/dart_apptests/lib/src/pingpong_apptests.dart b/services/dart/dart_apptests/lib/src/pingpong_apptests.dart index e9ed515..83fb0ba 100644 --- a/services/dart/dart_apptests/lib/src/pingpong_apptests.dart +++ b/services/dart/dart_apptests/lib/src/pingpong_apptests.dart
@@ -38,7 +38,7 @@ test('Ping Service To Pong Client', () async { var pingPongServiceProxy = new PingPongServiceProxy.unbound(); application.connectToService( - "mojo:mojo_dart_pingpong_pkg", pingPongServiceProxy); + "mojo:dart_pingpong", pingPongServiceProxy); var pingPongClient = new _TestingPingPongClient.unbound(); pingPongServiceProxy.ptr.setClient(pingPongClient.stub); @@ -61,10 +61,10 @@ test('Ping Target URL', () async { var pingPongServiceProxy = new PingPongServiceProxy.unbound(); application.connectToService( - "mojo:mojo_dart_pingpong_pkg", pingPongServiceProxy); + "mojo:dart_pingpong", pingPongServiceProxy); var r = await pingPongServiceProxy.ptr.pingTargetUrl( - "mojo:mojo_dart_pingpong_target_pkg", 9); + "mojo:dart_pingpong_target", 9); expect(r.ok, equals(true)); await pingPongServiceProxy.close(); @@ -75,11 +75,11 @@ test('Ping Target Service', () async { var pingPongServiceProxy = new PingPongServiceProxy.unbound(); application.connectToService( - "mojo:mojo_dart_pingpong_pkg", pingPongServiceProxy); + "mojo:dart_pingpong", pingPongServiceProxy); var targetServiceProxy = new PingPongServiceProxy.unbound(); application.connectToService( - "mojo:mojo_dart_pingpong_target_pkg", targetServiceProxy); + "mojo:dart_pingpong_target", targetServiceProxy); var r = await pingPongServiceProxy.ptr.pingTargetService( targetServiceProxy.impl, 9); @@ -95,7 +95,7 @@ test('Get Target Service', () async { var pingPongServiceProxy = new PingPongServiceProxy.unbound(); application.connectToService( - "mojo:mojo_dart_pingpong_pkg", pingPongServiceProxy); + "mojo:dart_pingpong", pingPongServiceProxy); var targetServiceProxy = new PingPongServiceProxy.unbound(); pingPongServiceProxy.ptr.getPingPongService(targetServiceProxy);
diff --git a/services/dart/test/echo/BUILD.gn b/services/dart/test/echo/BUILD.gn index dd3467d..01b3637 100644 --- a/services/dart/test/echo/BUILD.gn +++ b/services/dart/test/echo/BUILD.gn
@@ -4,19 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_echo_dartzip") { - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//services/dart/test:echo_service_interface", - ] -} - -dart_pkg("mojo_dart_echo_pkg") { +dart_pkg("echo") { apps = [ "lib/main.dart" ] + app_name_override = "dart_echo" sources = [ "pubspec.yaml", ] @@ -25,10 +15,3 @@ "//services/dart/test:echo_service_interface", ] } - -group("echo") { - deps = [ - ":mojo_dart_echo_dartzip", - ":mojo_dart_echo_pkg", - ] -}
diff --git a/services/dart/test/pingpong/BUILD.gn b/services/dart/test/pingpong/BUILD.gn index 98e1e75..7fe74f6 100644 --- a/services/dart/test/pingpong/BUILD.gn +++ b/services/dart/test/pingpong/BUILD.gn
@@ -4,19 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_pingpong_dartzip") { - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//services/dart/test:pingpong_service_interface", - ] -} - -dart_pkg("mojo_dart_pingpong_pkg") { +dart_pkg("pingpong") { apps = [ "lib/main.dart" ] + app_name_override = "dart_pingpong" sources = [ "pubspec.yaml", ] @@ -25,10 +15,3 @@ "//services/dart/test:pingpong_service_interface", ] } - -group("pingpong") { - deps = [ - ":mojo_dart_pingpong_dartzip", - ":mojo_dart_pingpong_pkg", - ] -}
diff --git a/services/dart/test/pingpong_target/BUILD.gn b/services/dart/test/pingpong_target/BUILD.gn index 6a3293d..848221d 100644 --- a/services/dart/test/pingpong_target/BUILD.gn +++ b/services/dart/test/pingpong_target/BUILD.gn
@@ -4,19 +4,9 @@ import("//mojo/public/dart/rules.gni") -dartzip_packaged_application("mojo_dart_pingpong_target_dartzip") { - sources = [ - "lib/main.dart", - "pubspec.yaml", - ] - deps = [ - "//mojo/public/dart:dart_dartzip", - "//services/dart/test:pingpong_service_interface", - ] -} - -dart_pkg("mojo_dart_pingpong_target_pkg") { +dart_pkg("pingpong_target") { apps = [ "lib/main.dart" ] + app_name_override = "dart_pingpong_target" sources = [ "pubspec.yaml", ] @@ -25,10 +15,3 @@ "//services/dart/test:pingpong_service_interface", ] } - -group("pingpong_target") { - deps = [ - ":mojo_dart_pingpong_target_dartzip", - ":mojo_dart_pingpong_target_pkg", - ] -}