Skip to content

Commit 35fac07

Browse files
committed
mac: Disable crash reporter for MAS build
1 parent 82bb790 commit 35fac07

File tree

4 files changed

+50
-10
lines changed

4 files changed

+50
-10
lines changed

atom.gyp

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,21 @@
285285
'vendor/breakpad/breakpad.gyp:breakpad_sender',
286286
],
287287
}], # OS=="win"
288-
['OS=="mac"', {
288+
['OS=="mac" and mas_build==0', {
289289
'dependencies': [
290290
'vendor/crashpad/client/client.gyp:crashpad_client',
291291
'vendor/crashpad/handler/handler.gyp:crashpad_handler',
292292
],
293-
}], # OS=="mac"
293+
}], # OS=="mac" and mas_build==0
294+
['OS=="mac" and mas_build==1', {
295+
'defines': [
296+
'MAS_BUILD',
297+
],
298+
'sources!': [
299+
'atom/common/crash_reporter/crash_reporter_mac.h',
300+
'atom/common/crash_reporter/crash_reporter_mac.mm',
301+
],
302+
}], # OS=="mac" and mas_build==1
294303
['OS=="linux"', {
295304
'link_settings': {
296305
'ldflags': [
@@ -439,12 +448,6 @@
439448
'<@(copied_libraries)',
440449
],
441450
},
442-
{
443-
'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Resources',
444-
'files': [
445-
'<(PRODUCT_DIR)/crashpad_handler',
446-
],
447-
},
448451
],
449452
'postbuilds': [
450453
{
@@ -476,6 +479,18 @@
476479
],
477480
},
478481
],
482+
'conditions': [
483+
['mas_build==0', {
484+
'copies': [
485+
{
486+
'destination': '<(PRODUCT_DIR)/<(product_name) Framework.framework/Versions/A/Resources',
487+
'files': [
488+
'<(PRODUCT_DIR)/crashpad_handler',
489+
],
490+
},
491+
],
492+
}],
493+
],
479494
}, # target framework
480495
{
481496
'target_name': '<(project_name)_helper',

atom/common/crash_reporter/crash_reporter.cc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,23 @@ CrashReporter::GetUploadedReports(const std::string& path) {
6464
return result;
6565
}
6666

67+
#if defined(OS_MACOSX) && defined(MAS_BUILD)
68+
void CrashReporter::InitBreakpad(const std::string& product_name,
69+
const std::string& version,
70+
const std::string& company_name,
71+
const std::string& submit_url,
72+
bool auto_submit,
73+
bool skip_system_crash_handler) {
74+
}
75+
76+
void CrashReporter::SetUploadParameters() {
77+
}
78+
79+
// static
80+
CrashReporter* CrashReporter::GetInstance() {
81+
static CrashReporter crash_reporter;
82+
return &crash_reporter;
83+
}
84+
#endif
85+
6786
} // namespace crash_reporter

atom/common/crash_reporter/crash_reporter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class CrashReporter {
4040
const std::string& company_name,
4141
const std::string& submit_url,
4242
bool auto_submit,
43-
bool skip_system_crash_handler) = 0;
44-
virtual void SetUploadParameters() = 0;
43+
bool skip_system_crash_handler);
44+
virtual void SetUploadParameters();
4545

4646
StringMap upload_parameters_;
4747
bool is_browser_;

script/update.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,17 @@ def run_gyp(target_arch, component):
5555
# Avoid using the old gyp lib in system.
5656
env['PYTHONPATH'] = os.path.pathsep.join([gyp_pylib,
5757
env.get('PYTHONPATH', '')])
58+
# Whether to build for Mac App Store.
59+
if os.environ.has_key('MAS_BUILD'):
60+
mas_build = 1
61+
else:
62+
mas_build = 0
5863
defines = [
5964
'-Dlibchromiumcontent_component={0}'.format(component),
6065
'-Dtarget_arch={0}'.format(target_arch),
6166
'-Dhost_arch={0}'.format(get_host_arch()),
6267
'-Dlibrary=static_library',
68+
'-Dmas_build={0}'.format(mas_build),
6369
]
6470
return subprocess.call([python, gyp, '-f', 'ninja', '--depth', '.',
6571
'atom.gyp', '-Icommon.gypi'] + defines, env=env)

0 commit comments

Comments
 (0)