• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "gn/action_values.h"
6 
7 #include "gn/settings.h"
8 #include "gn/substitution_writer.h"
9 #include "gn/target.h"
10 
11 ActionValues::ActionValues() = default;
12 
13 ActionValues::~ActionValues() = default;
14 
GetOutputsAsSourceFiles(const Target * target,std::vector<SourceFile> * result) const15 void ActionValues::GetOutputsAsSourceFiles(
16     const Target* target,
17     std::vector<SourceFile>* result) const {
18   if (target->output_type() == Target::BUNDLE_DATA) {
19     // The bundle_data target has no output, the real output will be generated
20     // by the create_bundle target.
21   } else if (target->output_type() == Target::COPY_FILES ||
22              target->output_type() == Target::ACTION_FOREACH) {
23     // Copy and foreach applies the outputs to the sources.
24     SubstitutionWriter::ApplyListToSources(target, target->settings(), outputs_,
25                                            target->sources(), result);
26   } else {
27     // Actions (and anything else that happens to specify an output) just use
28     // the output list with no substitution.
29     SubstitutionWriter::GetListAsSourceFiles(outputs_, result);
30   }
31 }
32