| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/bundle_data.h" | 5 #include "tools/gn/bundle_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "tools/gn/output_file.h" | 8 #include "tools/gn/output_file.h" |
| 9 #include "tools/gn/settings.h" | 9 #include "tools/gn/settings.h" |
| 10 #include "tools/gn/target.h" | 10 #include "tools/gn/target.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } else { | 53 } else { |
| 54 file_rule_sources.push_back(source_file); | 54 file_rule_sources.push_back(source_file); |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 if (!file_rule_sources.empty()) { | 58 if (!file_rule_sources.empty()) { |
| 59 DCHECK_EQ(target->action_values().outputs().list().size(), 1u); | 59 DCHECK_EQ(target->action_values().outputs().list().size(), 1u); |
| 60 file_rules_.push_back(BundleFileRule( | 60 file_rules_.push_back(BundleFileRule( |
| 61 file_rule_sources, target->action_values().outputs().list()[0])); | 61 file_rule_sources, target->action_values().outputs().list()[0])); |
| 62 } | 62 } |
| 63 |
| 64 deps_.push_back(LabelTargetPair(target)); |
| 63 } | 65 } |
| 64 | 66 |
| 65 void BundleData::GetSourceFiles(std::vector<SourceFile>* sources) const { | 67 void BundleData::GetSourceFiles(std::vector<SourceFile>* sources) const { |
| 66 for (const BundleFileRule& file_rule : file_rules_) { | 68 for (const BundleFileRule& file_rule : file_rules_) { |
| 67 sources->insert(sources->end(), file_rule.sources().begin(), | 69 sources->insert(sources->end(), file_rule.sources().begin(), |
| 68 file_rule.sources().end()); | 70 file_rule.sources().end()); |
| 69 } | 71 } |
| 70 sources->insert(sources->end(), asset_catalog_sources_.begin(), | 72 sources->insert(sources->end(), asset_catalog_sources_.begin(), |
| 71 asset_catalog_sources_.end()); | 73 asset_catalog_sources_.end()); |
| 72 } | 74 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 91 | 93 |
| 92 if (!asset_catalog_sources_.empty()) | 94 if (!asset_catalog_sources_.empty()) |
| 93 outputs_as_source->push_back(GetCompiledAssetCatalogPath()); | 95 outputs_as_source->push_back(GetCompiledAssetCatalogPath()); |
| 94 } | 96 } |
| 95 | 97 |
| 96 SourceFile BundleData::GetCompiledAssetCatalogPath() const { | 98 SourceFile BundleData::GetCompiledAssetCatalogPath() const { |
| 97 DCHECK(!asset_catalog_sources_.empty()); | 99 DCHECK(!asset_catalog_sources_.empty()); |
| 98 std::string assets_car_path = resources_dir_ + "/Assets.car"; | 100 std::string assets_car_path = resources_dir_ + "/Assets.car"; |
| 99 return SourceFile(SourceFile::SWAP_IN, &assets_car_path); | 101 return SourceFile(SourceFile::SWAP_IN, &assets_car_path); |
| 100 } | 102 } |
| OLD | NEW |