Re-land "Enable dSYMS in runtime_deps on official mac builds properly."

This reverts commit 5c5db6461a98651d65af70f1abaa6d6283a93b65 and
re-lands f090d8b6a02e69611e0d180f6e39d584d1f8aad1
with a fix to correct the .dSYM path for plugins; this fix won't
work if the plugin doesn't end in .so, but currently, neither
will the rest of the mac_plugin_bundle template.

R=bpastene@chromium.org
BUG=961548

Change-Id: Iaf520829cfcb495985d1dfdb3788f58a41936597
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1674406
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671789}
diff --git a/build/config/mac/rules.gni b/build/config/mac/rules.gni
index 71c450d..714bf700 100644
--- a/build/config/mac/rules.gni
+++ b/build/config/mac/rules.gni
@@ -351,6 +351,12 @@
       ":$_shared_library_bundle_data",
     ]
 
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.dSYM/",
+      ]
+    }
+
     bundle_root_dir = _framework_base_dir
     bundle_contents_dir = _framework_root_dir
     bundle_resources_dir = "$bundle_contents_dir/Resources"
@@ -551,6 +557,13 @@
     if (_write_pkg_info) {
       deps += [ ":$_pkg_info_bundle_data" ]
     }
+
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.dSYM/",
+      ]
+    }
+
     product_type = _product_type
     bundle_root_dir = "$root_out_dir/${_output_name}.${_output_extension}"
     bundle_contents_dir = "$bundle_root_dir/Contents"
@@ -617,6 +630,12 @@
     }
     deps += [ ":$_loadable_module_bundle_data" ]
 
+    if (enable_dsyms) {
+      data = [
+        "$root_out_dir/$_output_name.so.dSYM/",
+      ]
+    }
+
     bundle_root_dir = "$root_out_dir/$_output_name.plugin"
     bundle_contents_dir = "$bundle_root_dir/Contents"
     bundle_executable_dir = "$bundle_contents_dir/MacOS"