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/ninja_group_target_writer.h"
7 #include "base/strings/string_util.h"
8 #include "tools/gn/output_file.h"
9 #include "tools/gn/string_utils.h"
10 #include "tools/gn/target.h"
12 NinjaGroupTargetWriter::NinjaGroupTargetWriter(const Target
* target
,
14 : NinjaTargetWriter(target
, out
) {
17 NinjaGroupTargetWriter::~NinjaGroupTargetWriter() {
20 void NinjaGroupTargetWriter::Run() {
21 // A group rule just generates a stamp file with dependencies on each of
22 // the deps and datadeps in the group.
23 std::vector
<OutputFile
> output_files
;
24 const LabelTargetVector
& deps
= target_
->deps();
25 for (size_t i
= 0; i
< deps
.size(); i
++)
26 output_files
.push_back(deps
[i
].ptr
->dependency_output_file());
28 std::vector
<OutputFile
> data_output_files
;
29 const LabelTargetVector
& datadeps
= target_
->datadeps();
30 for (size_t i
= 0; i
< datadeps
.size(); i
++)
31 data_output_files
.push_back(deps
[i
].ptr
->dependency_output_file());
33 WriteStampForTarget(output_files
, data_output_files
);