2015-02-08 08:48:35 +03:00
|
|
|
#filter substitution
|
2015-01-21 02:17:58 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2015-06-20 08:16:05 +03:00
|
|
|
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
|
|
|
|
2015-01-21 02:17:58 +03:00
|
|
|
this.EXPORTED_SYMBOLS = ["AppConstants"];
|
|
|
|
|
|
|
|
// Immutable for export.
|
2015-04-03 04:29:38 +03:00
|
|
|
this.AppConstants = Object.freeze({
|
2015-01-21 02:17:58 +03:00
|
|
|
// See this wiki page for more details about channel specific build
|
|
|
|
// defines: https://wiki.mozilla.org/Platform/Channel-specific_build_defines
|
|
|
|
NIGHTLY_BUILD:
|
|
|
|
#ifdef NIGHTLY_BUILD
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
RELEASE_BUILD:
|
|
|
|
#ifdef RELEASE_BUILD
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
ACCESSIBILITY:
|
2015-02-18 22:45:48 +03:00
|
|
|
#ifdef ACCESSIBILITY
|
2015-01-21 02:17:58 +03:00
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// Official corresponds, roughly, to whether this build is performed
|
|
|
|
// on Mozilla's continuous integration infrastructure. You should
|
|
|
|
// disable developer-only functionality when this flag is set.
|
|
|
|
MOZILLA_OFFICIAL:
|
|
|
|
#ifdef MOZILLA_OFFICIAL
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
MOZ_OFFICIAL_BRANDING:
|
|
|
|
#ifdef MOZ_OFFICIAL_BRANDING
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
MOZ_SERVICES_HEALTHREPORT:
|
|
|
|
#ifdef MOZ_SERVICES_HEALTHREPORT
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
|
|
|
MOZ_DEVICES:
|
|
|
|
#ifdef MOZ_DEVICES
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-08-05 02:54:00 +03:00
|
|
|
MOZ_ANDROID_NATIVE_ACCOUNT_UI:
|
|
|
|
#ifdef MOZ_ANDROID_NATIVE_ACCOUNT_UI
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-01-21 02:17:58 +03:00
|
|
|
MOZ_SAFE_BROWSING:
|
|
|
|
#ifdef MOZ_SAFE_BROWSING
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-04-07 11:09:49 +03:00
|
|
|
MOZ_SANDBOX:
|
|
|
|
#ifdef MOZ_SANDBOX
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-01-21 02:17:58 +03:00
|
|
|
MOZ_TELEMETRY_REPORTING:
|
|
|
|
#ifdef MOZ_TELEMETRY_REPORTING
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-04-07 11:09:49 +03:00
|
|
|
MOZ_UPDATER:
|
|
|
|
#ifdef MOZ_UPDATER
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-01-21 02:17:58 +03:00
|
|
|
MOZ_WEBRTC:
|
|
|
|
#ifdef MOZ_WEBRTC
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-08-07 22:22:30 +03:00
|
|
|
# MOZ_B2G covers both device and desktop b2g
|
|
|
|
MOZ_B2G:
|
|
|
|
#ifdef MOZ_B2G
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-04-07 11:40:12 +03:00
|
|
|
# NOTE! XP_LINUX has to go after MOZ_WIDGET_ANDROID otherwise Android
|
|
|
|
# builds will be misidentified as linux.
|
2015-03-12 18:25:32 +03:00
|
|
|
platform:
|
|
|
|
#ifdef MOZ_WIDGET_GTK
|
|
|
|
"linux",
|
|
|
|
#elif MOZ_WIDGET_QT
|
|
|
|
"linux",
|
|
|
|
#elif XP_WIN
|
|
|
|
"win",
|
|
|
|
#elif XP_MACOSX
|
|
|
|
"macosx",
|
|
|
|
#elif MOZ_WIDGET_ANDROID
|
|
|
|
"android",
|
|
|
|
#elif MOZ_WIDGET_GONK
|
|
|
|
"gonk",
|
2015-04-07 11:09:49 +03:00
|
|
|
#elif XP_LINUX
|
|
|
|
"linux",
|
2015-03-12 18:25:32 +03:00
|
|
|
#else
|
|
|
|
"other",
|
|
|
|
#endif
|
|
|
|
|
2015-06-20 08:16:05 +03:00
|
|
|
isPlatformAndVersionAtLeast(platform, version) {
|
|
|
|
let platformVersion = Services.sysinfo.getProperty("version");
|
|
|
|
return platform == this.platform &&
|
|
|
|
Services.vc.compare(platformVersion, version) >= 0;
|
|
|
|
},
|
|
|
|
|
2015-03-12 18:25:32 +03:00
|
|
|
MOZ_CRASHREPORTER:
|
|
|
|
#ifdef MOZ_CRASHREPORTER
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-08-20 20:05:05 +03:00
|
|
|
MOZ_VERIFY_MAR_SIGNATURE:
|
|
|
|
#ifdef MOZ_VERIFY_MAR_SIGNATURE
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-04-03 04:29:38 +03:00
|
|
|
MOZ_MAINTENANCE_SERVICE:
|
|
|
|
#ifdef MOZ_MAINTENANCE_SERVICE
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-03-13 19:50:40 +03:00
|
|
|
E10S_TESTING_ONLY:
|
|
|
|
#ifdef E10S_TESTING_ONLY
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-04-18 01:21:02 +03:00
|
|
|
DEBUG:
|
|
|
|
#ifdef DEBUG
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
|
|
|
|
2015-05-21 19:42:07 +03:00
|
|
|
DLL_PREFIX: "@DLL_PREFIX@",
|
|
|
|
DLL_SUFFIX: "@DLL_SUFFIX@",
|
|
|
|
|
2015-04-07 11:09:49 +03:00
|
|
|
MOZ_APP_NAME: "@MOZ_APP_NAME@",
|
2015-01-21 02:17:58 +03:00
|
|
|
MOZ_APP_VERSION: "@MOZ_APP_VERSION@",
|
2015-07-12 04:37:54 +03:00
|
|
|
MOZ_APP_VERSION_DISPLAY: "@MOZ_APP_VERSION_DISPLAY@",
|
2015-04-07 11:09:49 +03:00
|
|
|
MOZ_BUILD_APP: "@MOZ_BUILD_APP@",
|
|
|
|
MOZ_UPDATE_CHANNEL: "@MOZ_UPDATE_CHANNEL@",
|
|
|
|
MOZ_WIDGET_TOOLKIT: "@MOZ_WIDGET_TOOLKIT@",
|
2015-01-21 02:17:58 +03:00
|
|
|
ANDROID_PACKAGE_NAME: "@ANDROID_PACKAGE_NAME@",
|
2015-08-06 13:59:00 +03:00
|
|
|
MOZ_ANDROID_APZ:
|
|
|
|
#ifdef MOZ_ANDROID_APZ
|
|
|
|
true,
|
|
|
|
#else
|
|
|
|
false,
|
|
|
|
#endif
|
2015-08-06 10:27:39 +03:00
|
|
|
DEBUG_JS_MODULES: "@DEBUG_JS_MODULES@"
|
2015-01-21 02:17:58 +03:00
|
|
|
});
|