From 175606c88d7e22a7135439bf5a745f891374aec4 Mon Sep 17 00:00:00 2001 From: Rintaro Kuroiwa Date: Thu, 14 Jan 2016 15:40:46 -0800 Subject: [PATCH] gyp_packager should repsect output_dir - Check if 'output_dir=' is already defined in GYP_GENERATOR_FLAGS before appending the one generated in the script. - Reusing out/ with different GYP_DEFINES causes everything to rebuild. - This change allows the user to use different directories for different GYP_DEFINES; it can make sanity checking faster for different GYP_DEFINES. Change-Id: Iffa6880381dabdd80a3aa7777a1d20cc3900f3e3 --- .gitignore | 2 +- gyp_packager.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8eb4781ea1..dd51cf6320 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ .pydevproject .repo .settings -/out/ +/out* /packager/base/ /packager/build/ /packager/buildtools/ diff --git a/gyp_packager.py b/gyp_packager.py index 077cdc0288..316b02b2e6 100755 --- a/gyp_packager.py +++ b/gyp_packager.py @@ -91,12 +91,14 @@ if __name__ == '__main__': if ['--depth' in arg for arg in args].count(True) == 0: args.append('--depth=packager') - output_dir = os.path.join(checkout_dir, 'out') - gyp_generator_flags = 'output_dir="' + output_dir + '"' - if os.environ.get('GYP_GENERATOR_FLAGS'): - os.environ['GYP_GENERATOR_FLAGS'] += ' ' + gyp_generator_flags - else: - os.environ['GYP_GENERATOR_FLAGS'] = gyp_generator_flags + if (not os.environ.get('GYP_GENERATOR_FLAGS') or + ('output_dir=' not in os.environ.get('GYP_GENERATOR_FLAGS'))): + output_dir = os.path.join(checkout_dir, 'out') + gyp_generator_flags = 'output_dir="' + output_dir + '"' + if os.environ.get('GYP_GENERATOR_FLAGS'): + os.environ['GYP_GENERATOR_FLAGS'] += ' ' + gyp_generator_flags + else: + os.environ['GYP_GENERATOR_FLAGS'] = gyp_generator_flags print 'Updating projects from gyp files...' sys.stdout.flush()