-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTARGETS
61 lines (57 loc) · 1.59 KB
/
TARGETS
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{
// Generic target 'simple_greeter'
// - produces file 'out.txt'
simple_greeter: {
type: 'generic',
cmds: 'printf "Hello World\n" > out.txt',
outs: 'out.txt',
},
// Generic target 'file_greeter'
// - produces file 'out.txt'
// - depends on local file 'name.txt'
file_greeter: {
type: 'generic',
// Field 'cmds' expects a list of strings or a newline-separated string.
// -> Jsonnet multi-line string generates a newline-separated string.
cmds: |||
printf "Hello " > out.txt
cat name.txt >> out.txt
|||,
outs: 'out.txt',
deps: ['name.txt'],
},
// Generic target 'input_greeter'
// - produces file 'out.txt'
// - depends on target 'input.txt'
input_greeter: {
type: 'generic',
cmds: |||
printf "Hello " > out.txt
cat input.txt >> out.txt
|||,
outs: 'out.txt',
// Dependency 'input.txt' is a target (see below), not a file!
deps: ['input.txt'],
},
// File-gen target 'input.txt'
// - produces file 'input.txt'
// - containing file from field 'data'
'input.txt': {
type: 'file_gen',
// We want to read variable 'INPUT_STRING'.
arguments_config: 'INPUT_STRING',
name: 'input.txt',
// Use content of variable 'INPUT_STRING' if set, or else use 'Universe\n'
data: var('INPUT_STRING', default='Universe\n'),
},
// Install target 'ALL'
// - stages outputs from greeters to specified file paths
ALL: {
type: 'install',
files: {
'out/simple.txt': 'simple_greeter',
'out/file.txt': 'file_greeter',
'out/input.txt': 'input_greeter',
},
},
}