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

Side by Side Diff: tools/gn/bundle_data.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/bundle_data.h ('k') | tools/gn/create_bundle_target_generator.h » ('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/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/filesystem_utils.h" 8 #include "tools/gn/filesystem_utils.h"
9 #include "tools/gn/label_pattern.h"
9 #include "tools/gn/output_file.h" 10 #include "tools/gn/output_file.h"
10 #include "tools/gn/settings.h" 11 #include "tools/gn/settings.h"
11 #include "tools/gn/substitution_writer.h" 12 #include "tools/gn/substitution_writer.h"
12 #include "tools/gn/target.h" 13 #include "tools/gn/target.h"
13 14
14 namespace { 15 namespace {
15 16
16 // Return directory of |path| without the trailing directory separator. 17 // Return directory of |path| without the trailing directory separator.
17 base::StringPiece FindDirNoTrailingSeparator(base::StringPiece path) { 18 base::StringPiece FindDirNoTrailingSeparator(base::StringPiece path) {
18 base::StringPiece::size_type pos = path.find_last_of("/\\"); 19 base::StringPiece::size_type pos = path.find_last_of("/\\");
(...skipping 26 matching lines...) Expand all
45 } 46 }
46 47
47 } // namespace 48 } // namespace
48 49
49 BundleData::BundleData() {} 50 BundleData::BundleData() {}
50 51
51 BundleData::~BundleData() {} 52 BundleData::~BundleData() {}
52 53
53 void BundleData::AddBundleData(const Target* target) { 54 void BundleData::AddBundleData(const Target* target) {
54 DCHECK_EQ(target->output_type(), Target::BUNDLE_DATA); 55 DCHECK_EQ(target->output_type(), Target::BUNDLE_DATA);
56 for (const auto& pattern : bundle_deps_filter_) {
57 if (pattern.Matches(target->label()))
58 return;
59 }
55 bundle_deps_.push_back(target); 60 bundle_deps_.push_back(target);
56 } 61 }
57 62
58 void BundleData::OnTargetResolved(Target* owning_target) { 63 void BundleData::OnTargetResolved(Target* owning_target) {
59 // Only initialize file_rules_ and assets_catalog_sources for "create_bundle" 64 // Only initialize file_rules_ and assets_catalog_sources for "create_bundle"
60 // target (properties are only used by those targets). 65 // target (properties are only used by those targets).
61 if (owning_target->output_type() != Target::CREATE_BUNDLE) 66 if (owning_target->output_type() != Target::CREATE_BUNDLE)
62 return; 67 return;
63 68
64 UniqueVector<const Target*> assets_catalog_deps; 69 UniqueVector<const Target*> assets_catalog_deps;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 outermost_bundle_dir.AppendToString(&return_value); 164 outermost_bundle_dir.AppendToString(&return_value);
160 return SourceFile(SourceFile::SWAP_IN, &return_value); 165 return SourceFile(SourceFile::SWAP_IN, &return_value);
161 } 166 }
162 return SourceFile(root_dir().value()); 167 return SourceFile(root_dir().value());
163 } 168 }
164 169
165 SourceDir BundleData::GetBundleRootDirOutputAsDir( 170 SourceDir BundleData::GetBundleRootDirOutputAsDir(
166 const Settings* settings) const { 171 const Settings* settings) const {
167 return SourceDir(GetBundleRootDirOutput(settings).value()); 172 return SourceDir(GetBundleRootDirOutput(settings).value());
168 } 173 }
OLDNEW
« no previous file with comments | « tools/gn/bundle_data.h ('k') | tools/gn/create_bundle_target_generator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698