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

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

Issue 2205693005: Add bundle_deps_filter to create_bundle targets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix value of kBundleDepsFilter. Created 4 years, 4 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 | « tools/gn/create_bundle_target_generator.h ('k') | tools/gn/docs/reference.md » ('j') | 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/create_bundle_target_generator.h" 5 #include "tools/gn/create_bundle_target_generator.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "tools/gn/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
9 #include "tools/gn/label_pattern.h"
9 #include "tools/gn/parse_tree.h" 10 #include "tools/gn/parse_tree.h"
10 #include "tools/gn/scope.h" 11 #include "tools/gn/scope.h"
11 #include "tools/gn/substitution_type.h" 12 #include "tools/gn/substitution_type.h"
12 #include "tools/gn/target.h" 13 #include "tools/gn/target.h"
13 #include "tools/gn/value.h" 14 #include "tools/gn/value.h"
14 #include "tools/gn/value_extractors.h" 15 #include "tools/gn/value_extractors.h"
15 #include "tools/gn/variables.h" 16 #include "tools/gn/variables.h"
16 17
17 CreateBundleTargetGenerator::CreateBundleTargetGenerator( 18 CreateBundleTargetGenerator::CreateBundleTargetGenerator(
18 Target* target, 19 Target* target,
(...skipping 28 matching lines...) Expand all
47 return; 48 return;
48 49
49 if (!FillCodeSigningSources()) 50 if (!FillCodeSigningSources())
50 return; 51 return;
51 52
52 if (!FillCodeSigningOutputs()) 53 if (!FillCodeSigningOutputs())
53 return; 54 return;
54 55
55 if (!FillCodeSigningArgs()) 56 if (!FillCodeSigningArgs())
56 return; 57 return;
58
59 if (!FillBundleDepsFilter())
60 return;
57 } 61 }
58 62
59 bool CreateBundleTargetGenerator::FillBundleDir( 63 bool CreateBundleTargetGenerator::FillBundleDir(
60 const SourceDir& bundle_root_dir, 64 const SourceDir& bundle_root_dir,
61 const base::StringPiece& name, 65 const base::StringPiece& name,
62 SourceDir* bundle_dir) { 66 SourceDir* bundle_dir) {
63 const Value* value = scope_->GetValue(name, true); 67 const Value* value = scope_->GetValue(name, true);
64 if (!value) 68 if (!value)
65 return true; 69 return true;
66 if (!value->VerifyTypeIs(Value::STRING, err_)) 70 if (!value->VerifyTypeIs(Value::STRING, err_))
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 "No code signing script." 190 "No code signing script."
187 "You must define code_signing_script if you use code_signing_args."); 191 "You must define code_signing_script if you use code_signing_args.");
188 return false; 192 return false;
189 } 193 }
190 194
191 if (!value->VerifyTypeIs(Value::LIST, err_)) 195 if (!value->VerifyTypeIs(Value::LIST, err_))
192 return false; 196 return false;
193 197
194 return target_->bundle_data().code_signing_args().Parse(*value, err_); 198 return target_->bundle_data().code_signing_args().Parse(*value, err_);
195 } 199 }
200
201 bool CreateBundleTargetGenerator::FillBundleDepsFilter() {
202 const Value* value = scope_->GetValue(variables::kBundleDepsFilter, true);
203 if (!value)
204 return true;
205
206 if (!value->VerifyTypeIs(Value::LIST, err_))
207 return false;
208
209 const SourceDir& current_dir = scope_->GetSourceDir();
210 std::vector<LabelPattern>& bundle_deps_filter =
211 target_->bundle_data().bundle_deps_filter();
212 for (const auto& item : value->list_value()) {
213 bundle_deps_filter.push_back(
214 LabelPattern::GetPattern(current_dir, item, err_));
215 if (err_->has_error())
216 return false;
217 }
218
219 return true;
220 }
OLDNEW
« no previous file with comments | « tools/gn/create_bundle_target_generator.h ('k') | tools/gn/docs/reference.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698