]> khamidou — GitHub mirrors - electron.git/commitdiff
mac: Disable crash reporter for MAS build
authorCheng Zhao <zcbenz@gmail.com>
Mon, 28 Sep 2015 06:52:55 +0000 (14:52 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Wed, 14 Oct 2015 03:53:52 +0000 (11:53 +0800)
atom.gyp
atom/common/crash_reporter/crash_reporter.cc
atom/common/crash_reporter/crash_reporter.h
script/update.py

index f5933b8631eccf4ceb87ab8b9e263845d6da9255..9838edf54a54b6c99568a06def24f775b3cc4195 100644 (file)
--- a/atom.gyp
+++ b/atom.gyp
             'vendor/breakpad/breakpad.gyp:breakpad_sender',
           ],
         }],  # OS=="win"
-        ['OS=="mac"', {
+        ['OS=="mac" and mas_build==0', {
           'dependencies': [
             'vendor/crashpad/client/client.gyp:crashpad_client',
             'vendor/crashpad/handler/handler.gyp:crashpad_handler',
           ],
-        }],  # OS=="mac"
+        }],  # OS=="mac" and mas_build==0
+        ['OS=="mac" and mas_build==1', {
+          'defines': [
+            'MAS_BUILD',
+          ],
+          'sources!': [
+            'atom/common/crash_reporter/crash_reporter_mac.h',
+            'atom/common/crash_reporter/crash_reporter_mac.mm',
+          ],
+        }],  # OS=="mac" and mas_build==1
         ['OS=="linux"', {
           'link_settings': {
             'ldflags': [
                 '<@(copied_libraries)',
               ],
             },
-            {
-              'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Resources',
-              'files': [
-                '<(PRODUCT_DIR)/crashpad_handler',
-              ],
-            },
           ],
           'postbuilds': [
             {
               ],
             },
           ],
+          'conditions': [
+            ['mas_build==0', {
+              'copies': [
+                {
+                  'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Resources',
+                  'files': [
+                    '<(PRODUCT_DIR)/crashpad_handler',
+                  ],
+                },
+              ],
+            }],
+          ],
         },  # target framework
         {
           'target_name': '<(project_name)_helper',
index 59b7fd51e45e2618fe8110fe7cfa2f7f5280521c..3658931ec188424a8fb2403f67ec4f64aa53dbb2 100644 (file)
@@ -64,4 +64,23 @@ CrashReporter::GetUploadedReports(const std::string& path) {
   return result;
 }
 
+#if defined(OS_MACOSX) && defined(MAS_BUILD)
+void CrashReporter::InitBreakpad(const std::string& product_name,
+                                 const std::string& version,
+                                 const std::string& company_name,
+                                 const std::string& submit_url,
+                                 bool auto_submit,
+                                 bool skip_system_crash_handler) {
+}
+
+void CrashReporter::SetUploadParameters() {
+}
+
+// static
+CrashReporter* CrashReporter::GetInstance() {
+  static CrashReporter crash_reporter;
+  return &crash_reporter;
+}
+#endif
+
 }  // namespace crash_reporter
index c7d58ca3aa761b033decaa6118abebba4ff22545..98832fea45de6651d8e6e48f9a17de08c38ee0b3 100644 (file)
@@ -40,8 +40,8 @@ class CrashReporter {
                             const std::string& company_name,
                             const std::string& submit_url,
                             bool auto_submit,
-                            bool skip_system_crash_handler) = 0;
-  virtual void SetUploadParameters() = 0;
+                            bool skip_system_crash_handler);
+  virtual void SetUploadParameters();
 
   StringMap upload_parameters_;
   bool is_browser_;
index abb3756ca365e2e0c6ab7cd698e2e2095a36f23f..e91e8401cbffca0ed484297ebedacfd0383ea940 100755 (executable)
@@ -55,11 +55,17 @@ def run_gyp(target_arch, component):
   # Avoid using the old gyp lib in system.
   env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib,
                                             env.get('PYTHONPATH', '')])
+  # Whether to build for Mac App Store.
+  if os.environ.has_key('MAS_BUILD'):
+    mas_build = 1
+  else:
+    mas_build = 0
   defines = [
     '-Dlibchromiumcontent_component={0}'.format(component),
     '-Dtarget_arch={0}'.format(target_arch),
     '-Dhost_arch={0}'.format(get_host_arch()),
     '-Dlibrary=static_library',
+    '-Dmas_build={0}'.format(mas_build),
   ]
   return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
                           'atom.gyp', '-Icommon.gypi'] + defines, env=env)