OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import gyp | 7 import gyp |
8 import gyp.common | 8 import gyp.common |
9 import gyp.SCons as SCons | 9 import gyp.SCons as SCons |
10 import os.path | 10 import os.path |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 # always returns the last element, whether a file or dir. Without this, | 523 # always returns the last element, whether a file or dir. Without this, |
524 # only the contents, not the directory itself, are copied (and nothing | 524 # only the contents, not the directory itself, are copied (and nothing |
525 # might be copied if dest already exists, since scons thinks nothing needs | 525 # might be copied if dest already exists, since scons thinks nothing needs |
526 # to be done). | 526 # to be done). |
527 dest = os.path.join(destdir, os.path.basename(f.rstrip(os.sep))) | 527 dest = os.path.join(destdir, os.path.basename(f.rstrip(os.sep))) |
528 f = FixPath(f, src_subdir_) | 528 f = FixPath(f, src_subdir_) |
529 dest = FixPath(dest, src_subdir_) | 529 dest = FixPath(dest, src_subdir_) |
530 fp.write(fmt % (repr(dest), repr(f))) | 530 fp.write(fmt % (repr(dest), repr(f))) |
531 fp.write('target_files.extend(_outputs)\n') | 531 fp.write('target_files.extend(_outputs)\n') |
532 | 532 |
533 if spec.get('run_as') or int(spec.get('test', 0)): | 533 run_as = spec.get('run_as') |
534 run_as = spec.get('run_as', { | 534 if run_as: |
535 'action' : ['$TARGET_NAME', '--gtest_print_time'], | |
536 }) | |
537 action = run_as.get('action', []) | 535 action = run_as.get('action', []) |
538 working_directory = run_as.get('working_directory') | 536 working_directory = run_as.get('working_directory') |
539 if not working_directory: | 537 if not working_directory: |
540 working_directory = gyp_dir | 538 working_directory = gyp_dir |
541 else: | 539 else: |
542 if not os.path.isabs(working_directory): | 540 if not os.path.isabs(working_directory): |
543 working_directory = os.path.normpath(os.path.join(gyp_dir, | 541 working_directory = os.path.normpath(os.path.join(gyp_dir, |
544 working_directory)) | 542 working_directory)) |
545 if run_as.get('environment'): | 543 if run_as.get('environment'): |
546 for (key, val) in run_as.get('environment').iteritems(): | 544 for (key, val) in run_as.get('environment').iteritems(): |
(...skipping 10 matching lines...) Expand all Loading... |
557 dependencies = spec.get('scons_dependencies', []) | 555 dependencies = spec.get('scons_dependencies', []) |
558 if dependencies: | 556 if dependencies: |
559 WriteList(fp, dependencies, preamble='dependencies = [\n ', | 557 WriteList(fp, dependencies, preamble='dependencies = [\n ', |
560 postamble='\n]\n') | 558 postamble='\n]\n') |
561 fp.write('env.Requires(target_files, dependencies)\n') | 559 fp.write('env.Requires(target_files, dependencies)\n') |
562 fp.write('env.Requires(gyp_target, dependencies)\n') | 560 fp.write('env.Requires(gyp_target, dependencies)\n') |
563 fp.write('for prerequisite in prerequisites:\n') | 561 fp.write('for prerequisite in prerequisites:\n') |
564 fp.write(' env.Requires(prerequisite, dependencies)\n') | 562 fp.write(' env.Requires(prerequisite, dependencies)\n') |
565 fp.write('env.Requires(gyp_target, prerequisites)\n') | 563 fp.write('env.Requires(gyp_target, prerequisites)\n') |
566 | 564 |
567 if spec.get('run_as', 0) or int(spec.get('test', 0)): | 565 if run_as: |
568 fp.write(_run_as_template_suffix % { | 566 fp.write(_run_as_template_suffix % { |
569 'target_name': target_name, | 567 'target_name': target_name, |
570 }) | 568 }) |
571 | 569 |
572 fp.write('Return("gyp_target")\n') | 570 fp.write('Return("gyp_target")\n') |
573 | 571 |
574 fp.close() | 572 fp.close() |
575 | 573 |
576 | 574 |
577 ############################################################################# | 575 ############################################################################# |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 bf, target = gyp.common.ParseQualifiedTarget(t)[:2] | 1036 bf, target = gyp.common.ParseQualifiedTarget(t)[:2] |
1039 target_filename = TargetFilename(target, bf, options.suffix) | 1037 target_filename = TargetFilename(target, bf, options.suffix) |
1040 tpath = gyp.common.RelativePath(target_filename, output_dir) | 1038 tpath = gyp.common.RelativePath(target_filename, output_dir) |
1041 sconscript_files[target] = tpath | 1039 sconscript_files[target] = tpath |
1042 | 1040 |
1043 output_filename = output_path(output_filename) | 1041 output_filename = output_path(output_filename) |
1044 if sconscript_files: | 1042 if sconscript_files: |
1045 GenerateSConscriptWrapper(build_file, data[build_file], basename, | 1043 GenerateSConscriptWrapper(build_file, data[build_file], basename, |
1046 output_filename, sconscript_files, | 1044 output_filename, sconscript_files, |
1047 default_configuration) | 1045 default_configuration) |
OLD | NEW |