| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. 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 #include "tools/gn/target_generator.h" | 5 #include "tools/gn/target_generator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "tools/gn/action_target_generator.h" | 9 #include "tools/gn/action_target_generator.h" |
| 10 #include "tools/gn/binary_target_generator.h" | 10 #include "tools/gn/binary_target_generator.h" |
| 11 #include "tools/gn/build_settings.h" | 11 #include "tools/gn/build_settings.h" |
| 12 #include "tools/gn/bundle_data_target_generator.h" | 12 #include "tools/gn/bundle_data_target_generator.h" |
| 13 #include "tools/gn/config.h" | 13 #include "tools/gn/config.h" |
| 14 #include "tools/gn/copy_target_generator.h" | 14 #include "tools/gn/copy_target_generator.h" |
| 15 #include "tools/gn/create_bundle_target_generator.h" |
| 15 #include "tools/gn/err.h" | 16 #include "tools/gn/err.h" |
| 16 #include "tools/gn/filesystem_utils.h" | 17 #include "tools/gn/filesystem_utils.h" |
| 17 #include "tools/gn/functions.h" | 18 #include "tools/gn/functions.h" |
| 18 #include "tools/gn/group_target_generator.h" | 19 #include "tools/gn/group_target_generator.h" |
| 19 #include "tools/gn/parse_tree.h" | 20 #include "tools/gn/parse_tree.h" |
| 20 #include "tools/gn/scheduler.h" | 21 #include "tools/gn/scheduler.h" |
| 21 #include "tools/gn/scope.h" | 22 #include "tools/gn/scope.h" |
| 22 #include "tools/gn/token.h" | 23 #include "tools/gn/token.h" |
| 23 #include "tools/gn/value.h" | 24 #include "tools/gn/value.h" |
| 24 #include "tools/gn/value_extractors.h" | 25 #include "tools/gn/value_extractors.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); | 86 g_scheduler->Log("Defining target", label.GetUserVisibleName(true)); |
| 86 | 87 |
| 87 scoped_ptr<Target> target(new Target(scope->settings(), label)); | 88 scoped_ptr<Target> target(new Target(scope->settings(), label)); |
| 88 target->set_defined_from(function_call); | 89 target->set_defined_from(function_call); |
| 89 | 90 |
| 90 // Create and call out to the proper generator. | 91 // Create and call out to the proper generator. |
| 91 if (output_type == functions::kBundleData) { | 92 if (output_type == functions::kBundleData) { |
| 92 BundleDataTargetGenerator generator( | 93 BundleDataTargetGenerator generator( |
| 93 target.get(), scope, function_call, err); | 94 target.get(), scope, function_call, err); |
| 94 generator.Run(); | 95 generator.Run(); |
| 96 } else if (output_type == functions::kCreateBundle) { |
| 97 CreateBundleTargetGenerator generator(target.get(), scope, function_call, |
| 98 err); |
| 99 generator.Run(); |
| 95 } else if (output_type == functions::kCopy) { | 100 } else if (output_type == functions::kCopy) { |
| 96 CopyTargetGenerator generator(target.get(), scope, function_call, err); | 101 CopyTargetGenerator generator(target.get(), scope, function_call, err); |
| 97 generator.Run(); | 102 generator.Run(); |
| 98 } else if (output_type == functions::kAction) { | 103 } else if (output_type == functions::kAction) { |
| 99 ActionTargetGenerator generator(target.get(), scope, function_call, | 104 ActionTargetGenerator generator(target.get(), scope, function_call, |
| 100 Target::ACTION, err); | 105 Target::ACTION, err); |
| 101 generator.Run(); | 106 generator.Run(); |
| 102 } else if (output_type == functions::kActionForEach) { | 107 } else if (output_type == functions::kActionForEach) { |
| 103 ActionTargetGenerator generator(target.get(), scope, function_call, | 108 ActionTargetGenerator generator(target.get(), scope, function_call, |
| 104 Target::ACTION_FOREACH, err); | 109 Target::ACTION_FOREACH, err); |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 376 |
| 372 bool TargetGenerator::FillGenericDeps(const char* var_name, | 377 bool TargetGenerator::FillGenericDeps(const char* var_name, |
| 373 LabelTargetVector* dest) { | 378 LabelTargetVector* dest) { |
| 374 const Value* value = scope_->GetValue(var_name, true); | 379 const Value* value = scope_->GetValue(var_name, true); |
| 375 if (value) { | 380 if (value) { |
| 376 ExtractListOfLabels(*value, scope_->GetSourceDir(), | 381 ExtractListOfLabels(*value, scope_->GetSourceDir(), |
| 377 ToolchainLabelForScope(scope_), dest, err_); | 382 ToolchainLabelForScope(scope_), dest, err_); |
| 378 } | 383 } |
| 379 return !err_->has_error(); | 384 return !err_->has_error(); |
| 380 } | 385 } |
| OLD | NEW |