Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3030)

Unified Diff: build/landmines.py

Issue 2198583002: Revert of Simplify landmines code a bit now that all branches of all platforms are on ninja (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/landmine_utils.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/landmines.py
diff --git a/build/landmines.py b/build/landmines.py
index 1b2f1cdbb08965adbdf0be2ad7e1bbb16b83b99a..031c309c33a96132ab43198f15e31b8c6443eb10 100755
--- a/build/landmines.py
+++ b/build/landmines.py
@@ -27,28 +27,35 @@
import landmine_utils
-def get_build_dir(src_dir):
+def get_build_dir(build_tool, src_dir, is_iphone=False):
"""
Returns output directory absolute path dependent on build and targets.
Examples:
r'c:\b\build\slave\win\build\src\out'
'/mnt/data/b/build/slave/linux/build/src/out'
- '/b/build/slave/ios_rel_device/build/src/out'
+ '/b/build/slave/ios_rel_device/build/src/xcodebuild'
Keep this function in sync with tools/build/scripts/slave/compile.py
"""
- if 'CHROMIUM_OUT_DIR' in os.environ:
- output_dir = os.environ.get('CHROMIUM_OUT_DIR').strip()
- if not output_dir:
- raise Error('CHROMIUM_OUT_DIR environment variable is set but blank!')
+ ret = None
+ if build_tool == 'xcode':
+ ret = os.path.join(src_dir, 'xcodebuild')
+ elif build_tool in ['make', 'ninja', 'ninja-ios']: # TODO: Remove ninja-ios.
+ if 'CHROMIUM_OUT_DIR' in os.environ:
+ output_dir = os.environ.get('CHROMIUM_OUT_DIR').strip()
+ if not output_dir:
+ raise Error('CHROMIUM_OUT_DIR environment variable is set but blank!')
+ else:
+ output_dir = landmine_utils.gyp_generator_flags().get('output_dir', 'out')
+ ret = os.path.join(src_dir, output_dir)
else:
- output_dir = landmine_utils.gyp_generator_flags().get('output_dir', 'out')
- return os.path.abspath(os.path.join(src_dir, output_dir))
+ raise NotImplementedError('Unexpected GYP_GENERATORS (%s)' % build_tool)
+ return os.path.abspath(ret)
def clobber_if_necessary(new_landmines, src_dir):
"""Does the work of setting, planting, and triggering landmines."""
- out_dir = get_build_dir(src_dir)
+ out_dir = get_build_dir(landmine_utils.builder(), src_dir)
landmines_path = os.path.normpath(os.path.join(src_dir, '.landmines'))
try:
os.makedirs(out_dir)
@@ -122,6 +129,9 @@
def main():
options = process_options()
+ if landmine_utils.builder() in ('dump_dependency_json', 'eclipse'):
+ return 0
+
gyp_environment.SetEnvironment()
landmines = []
« no previous file with comments | « build/landmine_utils.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698