11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/scripts/go/build.rb', line 11
def run
command("go", "get", "github.com/mitchellh/gox")
build_command = ["gox"]
build_command = add_option("ldflags", build_command)
parallel = env_fetch("GO_BUILD_PARALLEL", "2")
build_command.push("-parallel")
build_command.push(parallel)
build_command = add_option("osarch", build_command)
build_command = add_option("output", build_command)
if gox_args = env_fetch("GO_BUILD_ARGS")
build_command.concat(gox_args.split)
end
command(*build_command)
end
|