This PR changes the way we are reading values from `.env` to allow absent keys to pass `undefined` forward, and being ignored when generating gn args, as opposed to have our build commands providing a default in the absence of the key. This change will allow defaults to be stored in `.gn` files, rather than always being overwritten by our build command. Improper default overwritting is what caused the crash relating to these two PRs: https://github.com/brave/brave-core/pull/28463 https://github.com/brave/brave-core/pull/29891
20 lines
654 B
Plaintext
20 lines
654 B
Plaintext
# Copyright (c) 2025 The Brave Authors. All rights reserved.
|
|
# 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 https://mozilla.org/MPL/2.0/.
|
|
|
|
import("//build/buildflag_header.gni")
|
|
|
|
declare_args() {
|
|
brave_google_api_key = "AIzaSyAREPLACEWITHYOUROWNGOOGLEAPIKEY2Q"
|
|
brave_google_api_endpoint =
|
|
"https://www.googleapis.com/geolocation/v1/geolocate?key="
|
|
}
|
|
|
|
buildflag_header("geolocation") {
|
|
header = "brave_geolocation_buildflags.h"
|
|
|
|
flags =
|
|
[ "GOOGLEAPIS_URL=\"$brave_google_api_endpoint$brave_google_api_key\"" ]
|
|
}
|