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 #ifndef TOOLS_GN_ACTION_VALUES_H_
6 #define TOOLS_GN_ACTION_VALUES_H_
11 #include "base/basictypes.h"
12 #include "tools/gn/source_file.h"
13 #include "tools/gn/substitution_list.h"
15 // Holds the values (outputs, args, script name, etc.) for either an action or
16 // an action_foreach target.
22 // Filename of the script to execute.
23 const SourceFile& script() const { return script_; }
24 void set_script(const SourceFile& s) { script_ = s; }
26 // Arguments to the script.
27 SubstitutionList& args() { return args_; }
28 const SubstitutionList& args() const { return args_; }
30 // Files created by the script. These are strings rather than SourceFiles
31 // since they will often contain {{source expansions}}.
32 SubstitutionList& outputs() { return outputs_; }
33 const SubstitutionList& outputs() const { return outputs_; }
35 // Depfile generated by the script.
36 const SubstitutionPattern& depfile() const { return depfile_; }
37 bool has_depfile() const { return !depfile_.ranges().empty(); }
38 void set_depfile(const SubstitutionPattern& depfile) { depfile_ = depfile; }
42 SubstitutionList args_;
43 SubstitutionList outputs_;
44 SubstitutionPattern depfile_;
46 DISALLOW_COPY_AND_ASSIGN(ActionValues);
49 #endif // TOOLS_GN_ACTION_VALUES_H_