Bug 977448 - add build support for a 'MOZ_MOZILLA_API_KEY'. r=khuey

This commit is contained in:
Doug Turner 2014-02-25 16:06:51 -08:00
Родитель 26813fb129
Коммит 457a3f72e5
3 изменённых файлов: 17 добавлений и 3 удалений

Просмотреть файл

@ -4050,6 +4050,16 @@ fi
AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
AC_SUBST(MOZ_UPDATE_CHANNEL)
# Allow to specify a Mozilla API key file that contains the secret key to be
# used for various Mozilla API requests.
MOZ_ARG_WITH_STRING(mozilla-api-keyfile,
[ --with-mozilla-api-keyfile=file Use the secret key contained in the given keyfile for Mozilla API requests],
MOZ_MOZILLA_API_KEY=`cat $withval`)
if test -z "$MOZ_MOZILLA_API_KEY"; then
MOZ_MOZILLA_API_KEY=no-mozilla-api-key
fi
AC_SUBST(MOZ_MOZILLA_API_KEY)
# Allow to specify a Google API key file that contains the secret key to be
# used for various Google API requests.
MOZ_ARG_WITH_STRING(google-api-keyfile,

Просмотреть файл

@ -3,13 +3,16 @@
# 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/.
export:: google_api_key
export:: mozilla_api_key google_api_key
EXTRA_PP_COMPONENTS_FLAGS = -I google_api_key
EXTRA_PP_COMPONENTS_FLAGS = -I mozilla_api_key -I google_api_key
include $(topsrcdir)/config/rules.mk
mozilla_api_key:
@echo '#define MOZ_MOZILLA_API_KEY $(MOZ_MOZILLA_API_KEY)' > $@
google_api_key:
@echo '#define MOZ_GOOGLE_API_KEY $(MOZ_GOOGLE_API_KEY)' > $@
GARBAGE += google_api_key
GARBAGE += google_api_key moz_google_api_key

Просмотреть файл

@ -103,6 +103,7 @@ nsURLFormatterService.prototype = {
BUILD_TARGET: function() this.appInfo.OS + "_" + this.ABI,
OS_VERSION: function() this.OSVersion,
CHANNEL: function() UpdateChannel.get(),
MOZILLA_API_KEY: function() "@MOZ_MOZILLA_API_KEY@",
GOOGLE_API_KEY: function() "@MOZ_GOOGLE_API_KEY@",
DISTRIBUTION: function() this.distribution.id,
DISTRIBUTION_VERSION: function() this.distribution.version