// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef TOOLS_GN_SCRIPT_VALUES_H_ #define TOOLS_GN_SCRIPT_VALUES_H_ #include #include #include "base/basictypes.h" #include "tools/gn/source_file.h" // Holds the values (outputs, args, script name, etc.) for a script-based // target. class ScriptValues { public: ScriptValues(); ~ScriptValues(); // Filename of the script to execute. const SourceFile& script() const { return script_; } void set_script(const SourceFile& s) { script_ = s; } // Arguments to the script. std::vector& args() { return args_; } const std::vector& args() const { return args_; } void swap_in_args(std::vector* a) { args_.swap(*a); } // Files created by the script. std::vector& outputs() { return outputs_; } const std::vector& outputs() const { return outputs_; } void swap_in_outputs(std::vector* op) { outputs_.swap(*op); } // Depfile generated by the script. const SourceFile& depfile() const { return depfile_; } bool has_depfile() const { return !depfile_.is_null(); } void set_depfile(const SourceFile& depfile) { depfile_ = depfile; } private: SourceFile script_; std::vector args_; std::vector outputs_; SourceFile depfile_; DISALLOW_COPY_AND_ASSIGN(ScriptValues); }; #endif // TOOLS_GN_SCRIPT_VALUES_H_