Adds an environment variable that makes generate_buildfiles.py a no-op

R=whesse@google.com

Review URL: https://codereview.chromium.org/2507483002 .
This commit is contained in:
Zachary Anderson 2016-11-15 12:54:49 -08:00
parent fb467ef68a
commit c172f60bd4

View file

@ -12,12 +12,17 @@ import utils
SCRIPT_DIR = os.path.dirname(sys.argv[0])
DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..'))
DART_USE_GN = "DART_USE_GN"
DART_DISABLE_BUILDFILES = "DART_DISABLE_BUILDFILES"
def use_gn():
return DART_USE_GN in os.environ
def disable_buildfiles():
return DART_DISABLE_BUILDFILES in os.environ
def execute(args):
process = subprocess.Popen(args, cwd=DART_ROOT)
process.wait()
@ -68,6 +73,9 @@ def parse_args(args):
def main(argv):
# Check the environment and become a no-op if directed.
if disable_buildfiles():
return 0
options = parse_args(argv)
if options.gn:
return run_gn()