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

Unified Diff: tools/gn/commands.cc

Issue 1827103005: [GN] Add support for generating Xcode projects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment about "assert(product_type != "")" Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/commands.h ('k') | tools/gn/create_bundle_target_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/commands.cc
diff --git a/tools/gn/commands.cc b/tools/gn/commands.cc
index ed7a009d6af2c6f7a866d7d82e753b701d07760e..8682d920dfbb7b5deef8114d5525f4f4ba9c4c36 100644
--- a/tools/gn/commands.cc
+++ b/tools/gn/commands.cc
@@ -5,6 +5,7 @@
#include "tools/gn/commands.h"
#include "base/command_line.h"
+#include "base/strings/string_split.h"
#include "tools/gn/builder.h"
#include "tools/gn/filesystem_utils.h"
#include "tools/gn/item.h"
@@ -468,6 +469,27 @@ void FilterTargetsByPatterns(const std::vector<const Target*>& input,
}
}
+bool FilterPatternsFromString(const BuildSettings* build_settings,
+ const std::string& label_list_string,
+ std::vector<LabelPattern>* filters,
+ Err* err) {
+ std::vector<std::string> tokens = base::SplitString(
+ label_list_string, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
+ SourceDir root_dir =
+ SourceDirForCurrentDirectory(build_settings->root_path());
+
+ filters->reserve(tokens.size());
+ for (const std::string& token : tokens) {
+ LabelPattern pattern =
+ LabelPattern::GetPattern(root_dir, Value(nullptr, token), err);
+ if (err->has_error())
+ return false;
+ filters->push_back(pattern);
+ }
+
+ return true;
+}
+
void FilterAndPrintTargets(bool indent, std::vector<const Target*>* targets) {
if (targets->empty())
return;
« no previous file with comments | « tools/gn/commands.h ('k') | tools/gn/create_bundle_target_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698