blob: 848d09b5f00db620de1b391d5c6c3d03880ee29a (
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
|
package planr
type RunnerBuilder struct {
adapters [] Adapter
dirs DirConfig
}
func ConfigureRunner() RunnerBuilder {
return RunnerBuilder {}
}
func RegisterAdapter(b RunnerBuilder, a Adapter) RunnerBuilder {
b.adapters = append(b.adapters, a)
return b
}
func SetConfigDirFromTree(b RunnerBuilder, childPath string) RunnerBuilder {
b.dirs.SetConfigFromTree(childPath)
return b
}
func SetConfigDir(b RunnerBuilder, dir string) RunnerBuilder {
b.dirs.SetConfig(dir)
return b
}
func SetBuildDir(b RunnerBuilder, dir string) RunnerBuilder {
b.dirs.SetBuild(dir)
return b
}
func SetSrcDir(b RunnerBuilder, dir string) RunnerBuilder {
b.dirs.SetSrc(dir)
return b
}
func (b RunnerBuilder) New() Runner {
return Runner {
dirs: b.dirs,
adapters: b.adapters,
}
}
|