Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1486)

Unified Diff: mojo/public/dart/rules.gni

Issue 996483003: Run dartanalyze on the dartzip file structure. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: most of tonyg's nits. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | mojo/public/tools/dart_analyze.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/dart/rules.gni
diff --git a/mojo/public/dart/rules.gni b/mojo/public/dart/rules.gni
index e8d7c7274be59b03a7f21ebfc6465a88281de9cc..304f2f627cd6601c43027c356addece5d65f68d4 100644
--- a/mojo/public/dart/rules.gni
+++ b/mojo/public/dart/rules.gni
@@ -63,15 +63,16 @@ template("dart_packaged_application") {
mojo_output = "$root_out_dir/" + target_name + ".mojo"
}
- action_foreach(package_analyze_sources) {
- sources = invoker.sources
-
+ action(package_analyze_sources) {
script = rebase_path("mojo/public/tools/dart_analyze.py", ".", mojo_root)
+ sources = [
+ package_output,
+ ]
+
args = [
- rebase_path(root_gen_dir),
- rebase_path("$target_gen_dir/{{source_name_part}}.stamp"),
- "{{source}}",
+ rebase_path(package_output),
+ rebase_path("$target_gen_dir/${target_name}_analyze.stamp"),
"--no-hints",
"--url-mapping=mojo:application,/" +
rebase_path("mojo/public/dart/application.dart", "/", mojo_root),
@@ -81,6 +82,22 @@ template("dart_packaged_application") {
rebase_path("mojo/dart/embedder/builtin.dart", "/", mojo_root),
"--url-mapping=mojo:core,/" +
rebase_path("mojo/public/dart/core.dart", "/", mojo_root),
+
+ # The dart bindings refer to the autogenerated application interface in
+ # their source code; since that code is then packaged into the image, we
+ # need to manually resolve these package urls to the autogenerated code.
+ "--url-mapping=package:mojo/public/interfaces/application/application.mojom.dart,/" + rebase_path(
+ "mojo/public/interfaces/application/application.mojom.dart",
+ "/",
+ root_gen_dir + mojo_root),
+ "--url-mapping=package:mojo/public/interfaces/application/service_provider.mojom.dart,/" + rebase_path(
+ "mojo/public/interfaces/application/service_provider.mojom.dart",
+ "/",
+ root_gen_dir + mojo_root),
+ "--url-mapping=package:mojo/public/interfaces/application/shell.mojom.dart,/" + rebase_path(
+ "mojo/public/interfaces/application/shell.mojom.dart",
+ "/",
+ root_gen_dir + mojo_root),
]
if (defined(invoker.deps)) {
@@ -92,7 +109,7 @@ template("dart_packaged_application") {
}
outputs = [
- "$target_gen_dir/{{source_name_part}}.stamp",
+ "$target_gen_dir/${target_name}_analyze.stamp",
]
}
@@ -123,9 +140,7 @@ template("dart_packaged_application") {
]
deps = [
- # TODO(erg): When dartanalyze runs at an acceptable speed, add
- # ":$package_analyze_sources" as a dependency here and remove the
- # manual group("check") in the toplevel build file.
+ ":$package_analyze_sources",
":$package_name",
]
if (defined(invoker.deps)) {
« no previous file with comments | « BUILD.gn ('k') | mojo/public/tools/dart_analyze.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698