Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / gn / action_values.cc
blobede802079bbdae777c740762d6dac727bad4e17a
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "tools/gn/action_values.h"
7 #include "tools/gn/settings.h"
8 #include "tools/gn/substitution_writer.h"
9 #include "tools/gn/target.h"
11 ActionValues::ActionValues() {
14 ActionValues::~ActionValues() {
17 void ActionValues::GetOutputsAsSourceFiles(
18 const Target* target,
19 std::vector<SourceFile>* result) const {
20 if (target->output_type() == Target::COPY_FILES ||
21 target->output_type() == Target::ACTION_FOREACH) {
22 // Copy and foreach applies the outputs to the sources.
23 SubstitutionWriter::ApplyListToSources(
24 target->settings(), outputs_, target->sources(), result);
25 } else {
26 // Actions (and anything else that happens to specify an output) just use
27 // the output list with no substitution.
28 SubstitutionWriter::GetListAsSourceFiles(outputs_, result);