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

Side by Side Diff: pylib/gyp/generator/analyzer.py

Issue 1088163002: Analyzer didn't match correctly targets that defined path to inputs with '.' (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Rebased to fresh master. Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/analyzer/gyptest-analyzer.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2014 Google Inc. All rights reserved. 1 # Copyright (c) 2014 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """ 5 """
6 This script is intended for use as a GYP_GENERATOR. It takes as input (by way of 6 This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
7 the generator flag config_path) the path of a json file that dictates the files 7 the generator flag config_path) the path of a json file that dictates the files
8 and targets to search for. The following keys are supported: 8 and targets to search for. The following keys are supported:
9 files: list of paths (relative) of the files to search for. 9 files: list of paths (relative) of the files to search for.
10 targets: list of targets to search for. The target names are unqualified. 10 targets: list of targets to search for. The target names are unqualified.
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 # If a build file (or any of its included files) is modified we assume all 331 # If a build file (or any of its included files) is modified we assume all
332 # targets in the file are modified. 332 # targets in the file are modified.
333 if build_file_in_files[build_file]: 333 if build_file_in_files[build_file]:
334 print 'matching target from modified build file', target_name 334 print 'matching target from modified build file', target_name
335 target.match_status = MATCH_STATUS_MATCHES 335 target.match_status = MATCH_STATUS_MATCHES
336 matching_targets.append(target) 336 matching_targets.append(target)
337 else: 337 else:
338 sources = _ExtractSources(target_name, target_dicts[target_name], 338 sources = _ExtractSources(target_name, target_dicts[target_name],
339 toplevel_dir) 339 toplevel_dir)
340 for source in sources: 340 for source in sources:
341 if source in files: 341 if os.path.normpath(source) in files:
342 print 'target', target_name, 'matches', source 342 print 'target', target_name, 'matches', source
343 target.match_status = MATCH_STATUS_MATCHES 343 target.match_status = MATCH_STATUS_MATCHES
344 matching_targets.append(target) 344 matching_targets.append(target)
345 break 345 break
346 346
347 # Add dependencies to visit as well as updating back pointers for deps. 347 # Add dependencies to visit as well as updating back pointers for deps.
348 for dep in target_dicts[target_name].get('dependencies', []): 348 for dep in target_dicts[target_name].get('dependencies', []):
349 targets_to_visit.append(dep) 349 targets_to_visit.append(dep)
350 350
351 created_dep_target, dep_target = _GetOrCreateTargetByName(targets, dep) 351 created_dep_target, dep_target = _GetOrCreateTargetByName(targets, dep)
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 result_dict = { 'targets': matched_search_targets, 599 result_dict = { 'targets': matched_search_targets,
600 'status': found_dependency_string if matching_targets else 600 'status': found_dependency_string if matching_targets else
601 no_dependency_string, 601 no_dependency_string,
602 'build_targets': build_targets} 602 'build_targets': build_targets}
603 if invalid_targets: 603 if invalid_targets:
604 result_dict['invalid_targets'] = invalid_targets 604 result_dict['invalid_targets'] = invalid_targets
605 _WriteOutput(params, **result_dict) 605 _WriteOutput(params, **result_dict)
606 606
607 except Exception as e: 607 except Exception as e:
608 _WriteOutput(params, error=str(e)) 608 _WriteOutput(params, error=str(e))
OLDNEW
« no previous file with comments | « no previous file | test/analyzer/gyptest-analyzer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698