Skip to content

Commit

Permalink
[observatory] Include observatory main.dart.js.map with debug build.
Browse files Browse the repository at this point in the history
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 <zra@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Commit-Queue: Alexander Aprelev <aam@google.com>
  • Loading branch information
aam authored and commit-bot@chromium.org committed Aug 8, 2018
1 parent 7eda513 commit 9e9adce
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions runtime/observatory/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
[
Expand Down Expand Up @@ -60,7 +63,6 @@ observatory_ignore_patterns = [
"*.concat.js",
"*.dart",
"*.log",
"*.map",
"*.precompiled.js",
"*.scriptUrls",
"*_buildLogs*",
Expand All @@ -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"
Expand Down Expand Up @@ -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}}",
]
}

Expand Down

0 comments on commit 9e9adce

Please sign in to comment.