blob: 994011e824e614e5bdb5660d1a501fe2af7d5c64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// 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.
#include "tools/gn/copy_target_generator.h"
#include "tools/gn/build_settings.h"
#include "tools/gn/filesystem_utils.h"
#include "tools/gn/parse_tree.h"
#include "tools/gn/scope.h"
#include "tools/gn/value.h"
CopyTargetGenerator::CopyTargetGenerator(Target* target,
Scope* scope,
const FunctionCallNode* function_call,
Err* err)
: TargetGenerator(target, scope, function_call, err) {
}
CopyTargetGenerator::~CopyTargetGenerator() {
}
void CopyTargetGenerator::DoRun() {
target_->set_output_type(Target::COPY_FILES);
if (!FillSources())
return;
if (!FillOutputs(true))
return;
if (target_->sources().empty()) {
*err_ = Err(function_call_, "Empty sources for copy command.",
"You have to specify at least one file to copy in the \"sources\".");
return;
}
if (target_->action_values().outputs().list().size() != 1) {
*err_ = Err(function_call_, "Copy command must have exactly one output.",
"You must specify exactly one value in the \"outputs\" array for the "
"destination of the copy\n(see \"gn help copy\"). If there are "
"multiple sources to copy, use source expansion\n(see \"gn help "
"source_expansion\").");
return;
}
}
|