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

Side by Side Diff: tools/gn/visual_studio_writer.cc

Issue 1667553003: Make sure VS projects order is always the same in solution (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/visual_studio_writer.h" 5 #include "tools/gn/visual_studio_writer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 return false; 229 return false;
230 230
231 processed_targets.insert(target_path); 231 processed_targets.insert(target_path);
232 } 232 }
233 233
234 if (writer.projects_.empty()) { 234 if (writer.projects_.empty()) {
235 *err = Err(Location(), "No Visual Studio projects generated."); 235 *err = Err(Location(), "No Visual Studio projects generated.");
236 return false; 236 return false;
237 } 237 }
238 238
239 // Sort projects so they appear always in the same order in solution file.
240 // Otherwise solution file is rewritten and reloaded by Visual Studio.
241 std::sort(writer.projects_.begin(), writer.projects_.end(),
242 [](const SolutionEntry* a, const SolutionEntry* b) {
243 return a->path < b->path;
244 });
245
239 writer.ResolveSolutionFolders(); 246 writer.ResolveSolutionFolders();
240 return writer.WriteSolutionFile(err); 247 return writer.WriteSolutionFile(err);
241 } 248 }
242 249
243 bool VisualStudioWriter::WriteProjectFiles(const Target* target, Err* err) { 250 bool VisualStudioWriter::WriteProjectFiles(const Target* target, Err* err) {
244 SourceFile target_file = GetTargetOutputDir(target).ResolveRelativeFile( 251 SourceFile target_file = GetTargetOutputDir(target).ResolveRelativeFile(
245 Value(nullptr, target->label().name() + ".vcxproj"), err); 252 Value(nullptr, target->label().name() + ".vcxproj"), err);
246 if (target_file.is_null()) 253 if (target_file.is_null())
247 return false; 254 return false;
248 255
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 base::CompareCase::SENSITIVE)) { 752 base::CompareCase::SENSITIVE)) {
746 folder->parent_folder = parents.back(); 753 folder->parent_folder = parents.back();
747 break; 754 break;
748 } else { 755 } else {
749 parents.pop_back(); 756 parents.pop_back();
750 } 757 }
751 } 758 }
752 parents.push_back(folder); 759 parents.push_back(folder);
753 } 760 }
754 } 761 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698