| 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 <iostream> | 5 #include <iostream> |
| 6 #include <map> | 6 #include <map> |
| 7 #include <utility> | 7 #include <utility> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 // Match up the debug and release version of each target by label. | 226 // Match up the debug and release version of each target by label. |
| 227 CorrelatedTargetsMap correlated; | 227 CorrelatedTargetsMap correlated; |
| 228 CorrelateTargets(debug_targets, release_targets, &correlated); | 228 CorrelateTargets(debug_targets, release_targets, &correlated); |
| 229 | 229 |
| 230 GypHelper helper; | 230 GypHelper helper; |
| 231 GroupedTargetsMap grouped_targets; | 231 GroupedTargetsMap grouped_targets; |
| 232 int target_count = 0; | 232 int target_count = 0; |
| 233 for (CorrelatedTargetsMap::iterator i = correlated.begin(); | 233 for (CorrelatedTargetsMap::iterator i = correlated.begin(); |
| 234 i != correlated.end(); ++i) { | 234 i != correlated.end(); ++i) { |
| 235 const TargetGroup& group = i->second; | 235 const TargetGroup& group = i->second; |
| 236 if (!EnsureTargetsMatch(group, err)) | |
| 237 return std::make_pair(0, 0); | |
| 238 | |
| 239 if (!group.debug->item_node()->should_generate()) | 236 if (!group.debug->item_node()->should_generate()) |
| 240 continue; // Skip non-generated ones. | 237 continue; // Skip non-generated ones. |
| 241 if (group.debug->external()) | 238 if (group.debug->external()) |
| 242 continue; // Skip external ones. | 239 continue; // Skip external ones. |
| 243 if (group.debug->gyp_file().is_null()) | 240 if (group.debug->gyp_file().is_null()) |
| 244 continue; // Skip ones without GYP files. | 241 continue; // Skip ones without GYP files. |
| 245 | 242 |
| 243 if (!EnsureTargetsMatch(group, err)) |
| 244 return std::make_pair(0, 0); |
| 245 |
| 246 target_count++; | 246 target_count++; |
| 247 grouped_targets[helper.GetGypFileForTarget(group.debug, err)].push_back( | 247 grouped_targets[helper.GetGypFileForTarget(group.debug, err)].push_back( |
| 248 group); | 248 group); |
| 249 if (err->has_error()) | 249 if (err->has_error()) |
| 250 return std::make_pair(0, 0); | 250 return std::make_pair(0, 0); |
| 251 } | 251 } |
| 252 | 252 |
| 253 // Write each GYP file. | 253 // Write each GYP file. |
| 254 for (GroupedTargetsMap::iterator i = grouped_targets.begin(); | 254 for (GroupedTargetsMap::iterator i = grouped_targets.begin(); |
| 255 i != grouped_targets.end(); ++i) { | 255 i != grouped_targets.end(); ++i) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 + " GN files in " + | 379 + " GN files in " + |
| 380 base::IntToString((end_time - begin_time).InMilliseconds()) + "ms\n"; | 380 base::IntToString((end_time - begin_time).InMilliseconds()) + "ms\n"; |
| 381 | 381 |
| 382 OutputString(stats); | 382 OutputString(stats); |
| 383 } | 383 } |
| 384 | 384 |
| 385 return 0; | 385 return 0; |
| 386 } | 386 } |
| 387 | 387 |
| 388 } // namespace commands | 388 } // namespace commands |
| OLD | NEW |