From 9e9adcef57cc80ca2c6b8f751b856a89cb6f58fd Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Wed, 8 Aug 2018 17:21:34 +0000 Subject: [PATCH] [observatory] Include observatory main.dart.js.map with debug build. Having this map file allows for the browser to report source line numbers in case of exception thrown by Observatory code. Change-Id: Ia47789b89b3a14ca6513143bf9d4cc9c4a8cc1fb Reviewed-on: https://dart-review.googlesource.com/68847 Reviewed-by: Zach Anderson Reviewed-by: Ryan Macnak Commit-Queue: Alexander Aprelev --- runtime/observatory/BUILD.gn | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/runtime/observatory/BUILD.gn b/runtime/observatory/BUILD.gn index 599a35f3eda1c..89b4836ffaf89 100644 --- a/runtime/observatory/BUILD.gn +++ b/runtime/observatory/BUILD.gn @@ -19,6 +19,9 @@ prebuilt_dart2js_action("build_observatory") { outputs = [ output, ] + if (is_debug) { + outputs += [ "$target_gen_dir/observatory/web/main.dart.js.map" ] + } version_string = exec_script("../../tools/make_version.py", [ @@ -60,7 +63,6 @@ observatory_ignore_patterns = [ "*.concat.js", "*.dart", "*.log", - "*.map", "*.precompiled.js", "*.scriptUrls", "*_buildLogs*", @@ -78,6 +80,10 @@ observatory_ignore_patterns = [ "webcomponents.*", ] +if (!is_debug) { + observatory_ignore_patterns += [ "*.map" ] +} + # The ignore_patterns entry in the scopes accepted by copy_trees() is a # string of comma delimited patterns. observatory_ignore_string = "\$sdk" @@ -157,8 +163,11 @@ copy("copy_main_dart_js") { sources = [ "$target_gen_dir/observatory/web/main.dart.js", ] + if (is_debug) { + sources += [ "$target_gen_dir/observatory/web/main.dart.js.map" ] + } outputs = [ - "$target_out_dir/observatory/deployed/web/main.dart.js", + "$target_out_dir/observatory/deployed/web/{{source_file_part}}", ] }