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

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

Issue 2101923006: Fix BundleData::GetBundleRootDirOutput() for non-default toolchain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@create-bundle-deps
Patch Set: Rebase. Created 4 years, 5 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 | tools/gn/function_rebase_path_unittest.cc » ('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/output_file.h" 9 #include "tools/gn/output_file.h"
10 #include "tools/gn/settings.h" 10 #include "tools/gn/settings.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 outputs_as_source->push_back(GetBundleRootDirOutput(settings)); 141 outputs_as_source->push_back(GetBundleRootDirOutput(settings));
142 } 142 }
143 143
144 SourceFile BundleData::GetCompiledAssetCatalogPath() const { 144 SourceFile BundleData::GetCompiledAssetCatalogPath() const {
145 DCHECK(!assets_catalog_sources_.empty()); 145 DCHECK(!assets_catalog_sources_.empty());
146 std::string assets_car_path = resources_dir_.value() + "/Assets.car"; 146 std::string assets_car_path = resources_dir_.value() + "/Assets.car";
147 return SourceFile(SourceFile::SWAP_IN, &assets_car_path); 147 return SourceFile(SourceFile::SWAP_IN, &assets_car_path);
148 } 148 }
149 149
150 SourceFile BundleData::GetBundleRootDirOutput(const Settings* settings) const { 150 SourceFile BundleData::GetBundleRootDirOutput(const Settings* settings) const {
151 const SourceDir& build_dir = settings->build_settings()->build_dir(); 151 const SourceDir& build_dir = settings->toolchain_output_dir();
152 std::string bundle_root_relative = RebasePath(root_dir().value(), build_dir); 152 std::string bundle_root_relative = RebasePath(root_dir().value(), build_dir);
153 153
154 size_t first_component = bundle_root_relative.find('/'); 154 size_t first_component = bundle_root_relative.find('/');
155 if (first_component != std::string::npos) { 155 if (first_component != std::string::npos) {
156 base::StringPiece outermost_bundle_dir = 156 base::StringPiece outermost_bundle_dir =
157 base::StringPiece(bundle_root_relative).substr(0, first_component); 157 base::StringPiece(bundle_root_relative).substr(0, first_component);
158 std::string return_value(build_dir.value()); 158 std::string return_value(build_dir.value());
159 outermost_bundle_dir.AppendToString(&return_value); 159 outermost_bundle_dir.AppendToString(&return_value);
160 return SourceFile(SourceFile::SWAP_IN, &return_value); 160 return SourceFile(SourceFile::SWAP_IN, &return_value);
161 } 161 }
162 return SourceFile(root_dir().value()); 162 return SourceFile(root_dir().value());
163 } 163 }
164 164
165 SourceDir BundleData::GetBundleRootDirOutputAsDir( 165 SourceDir BundleData::GetBundleRootDirOutputAsDir(
166 const Settings* settings) const { 166 const Settings* settings) const {
167 return SourceDir(GetBundleRootDirOutput(settings).value()); 167 return SourceDir(GetBundleRootDirOutput(settings).value());
168 } 168 }
OLDNEW
« no previous file with comments | « no previous file | tools/gn/function_rebase_path_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698