| OLD | NEW |
| 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/ninja_create_bundle_target_writer.h" | 5 #include "tools/gn/ninja_create_bundle_target_writer.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "tools/gn/filesystem_utils.h" | 9 #include "tools/gn/filesystem_utils.h" |
| 10 #include "tools/gn/ninja_utils.h" | 10 #include "tools/gn/ninja_utils.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 OutputFile | 169 OutputFile |
| 170 NinjaCreateBundleTargetWriter::WriteCompileAssetsCatalogInputDepsStamp( | 170 NinjaCreateBundleTargetWriter::WriteCompileAssetsCatalogInputDepsStamp( |
| 171 const std::vector<const Target*>& dependencies) { | 171 const std::vector<const Target*>& dependencies) { |
| 172 DCHECK(!dependencies.empty()); | 172 DCHECK(!dependencies.empty()); |
| 173 if (dependencies.size() == 1) | 173 if (dependencies.size() == 1) |
| 174 return dependencies[0]->dependency_output_file(); | 174 return dependencies[0]->dependency_output_file(); |
| 175 | 175 |
| 176 OutputFile xcassets_input_stamp_file = | 176 OutputFile xcassets_input_stamp_file = |
| 177 OutputFile(RebasePath(GetTargetOutputDir(target_).value(), | 177 GetBuildDirForTargetAsOutputFile(target_, BuildDirType::OBJ); |
| 178 settings_->build_settings()->build_dir(), | |
| 179 settings_->build_settings()->root_path_utf8())); | |
| 180 xcassets_input_stamp_file.value().append(target_->label().name()); | 178 xcassets_input_stamp_file.value().append(target_->label().name()); |
| 181 xcassets_input_stamp_file.value().append(".xcassets.inputdeps.stamp"); | 179 xcassets_input_stamp_file.value().append(".xcassets.inputdeps.stamp"); |
| 182 | 180 |
| 183 out_ << "build "; | 181 out_ << "build "; |
| 184 path_output_.WriteFile(out_, xcassets_input_stamp_file); | 182 path_output_.WriteFile(out_, xcassets_input_stamp_file); |
| 185 out_ << ": " << GetNinjaRulePrefixForToolchain(settings_) | 183 out_ << ": " << GetNinjaRulePrefixForToolchain(settings_) |
| 186 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 184 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
| 187 | 185 |
| 188 for (const Target* target : dependencies) { | 186 for (const Target* target : dependencies) { |
| 189 out_ << " "; | 187 out_ << " "; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 // Remove possible duplicates (if a target is listed in both deps and | 252 // Remove possible duplicates (if a target is listed in both deps and |
| 255 // public_deps. | 253 // public_deps. |
| 256 std::sort(dependencies.begin(), dependencies.end(), | 254 std::sort(dependencies.begin(), dependencies.end(), |
| 257 [](const Target* lhs, const Target* rhs) -> bool { | 255 [](const Target* lhs, const Target* rhs) -> bool { |
| 258 return lhs->label() < rhs->label(); | 256 return lhs->label() < rhs->label(); |
| 259 }); | 257 }); |
| 260 dependencies.erase(std::unique(dependencies.begin(), dependencies.end()), | 258 dependencies.erase(std::unique(dependencies.begin(), dependencies.end()), |
| 261 dependencies.end()); | 259 dependencies.end()); |
| 262 | 260 |
| 263 OutputFile code_signing_input_stamp_file = | 261 OutputFile code_signing_input_stamp_file = |
| 264 OutputFile(RebasePath(GetTargetOutputDir(target_).value(), | 262 GetBuildDirForTargetAsOutputFile(target_, BuildDirType::OBJ); |
| 265 settings_->build_settings()->build_dir(), | |
| 266 settings_->build_settings()->root_path_utf8())); | |
| 267 code_signing_input_stamp_file.value().append(target_->label().name()); | 263 code_signing_input_stamp_file.value().append(target_->label().name()); |
| 268 code_signing_input_stamp_file.value().append(".codesigning.inputdeps.stamp"); | 264 code_signing_input_stamp_file.value().append(".codesigning.inputdeps.stamp"); |
| 269 | 265 |
| 270 out_ << "build "; | 266 out_ << "build "; |
| 271 path_output_.WriteFile(out_, code_signing_input_stamp_file); | 267 path_output_.WriteFile(out_, code_signing_input_stamp_file); |
| 272 out_ << ": " << GetNinjaRulePrefixForToolchain(settings_) | 268 out_ << ": " << GetNinjaRulePrefixForToolchain(settings_) |
| 273 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 269 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
| 274 | 270 |
| 275 for (const SourceFile& source : code_signing_input_files) { | 271 for (const SourceFile& source : code_signing_input_files) { |
| 276 out_ << " "; | 272 out_ << " "; |
| 277 path_output_.WriteFile(out_, source); | 273 path_output_.WriteFile(out_, source); |
| 278 } | 274 } |
| 279 for (const Target* target : dependencies) { | 275 for (const Target* target : dependencies) { |
| 280 out_ << " "; | 276 out_ << " "; |
| 281 path_output_.WriteFile(out_, target->dependency_output_file()); | 277 path_output_.WriteFile(out_, target->dependency_output_file()); |
| 282 } | 278 } |
| 283 out_ << std::endl; | 279 out_ << std::endl; |
| 284 return code_signing_input_stamp_file; | 280 return code_signing_input_stamp_file; |
| 285 } | 281 } |
| OLD | NEW |