2019-12-01 10:50:13 +01:00
|
|
|
module main
|
|
|
|
|
2020-04-26 08:32:05 +02:00
|
|
|
import os
|
|
|
|
import testing
|
2020-05-30 10:06:16 +02:00
|
|
|
import v.util
|
2019-12-01 10:50:13 +01:00
|
|
|
|
2020-12-01 16:43:34 +01:00
|
|
|
fn p(s string) string {
|
|
|
|
println(s)
|
|
|
|
return s
|
|
|
|
}
|
|
|
|
|
2019-12-01 10:50:13 +01:00
|
|
|
fn main() {
|
|
|
|
args := os.args
|
|
|
|
args_string := args[1..].join(' ')
|
2020-07-08 13:29:55 +02:00
|
|
|
skips := []string{}
|
2020-12-01 16:43:34 +01:00
|
|
|
vexe := os.getenv('VEXE')
|
|
|
|
vroot := os.dir(vexe)
|
2020-05-30 10:06:16 +02:00
|
|
|
util.ensure_modules_for_all_tools_are_installed('-v' in args)
|
2020-12-01 16:43:34 +01:00
|
|
|
folder := 'cmd/tools'
|
|
|
|
main_label := 'Building $folder ...'
|
|
|
|
finish_label := 'building $folder'
|
|
|
|
mut session := testing.prepare_test_session(args_string.all_before('build-tools'), folder, skips, main_label)
|
|
|
|
session.rm_binaries = false
|
|
|
|
session.test()
|
|
|
|
eprintln(session.benchmark.total_message(finish_label))
|
|
|
|
if session.failed {
|
2019-12-01 10:50:13 +01:00
|
|
|
exit(1)
|
|
|
|
}
|
2020-12-01 16:43:34 +01:00
|
|
|
//
|
|
|
|
mut executables := os.ls(session.vtmp_dir)?
|
|
|
|
executables.sort()
|
|
|
|
executables = executables.filter(it !in ['gen1m', 'gen_vc', 'fast', 'wyhash'])
|
|
|
|
for exe in executables {
|
|
|
|
os.mv_by_cp(os.join_path(session.vtmp_dir, exe), os.join_path(vroot, 'cmd', 'tools', exe))
|
|
|
|
}
|
2019-12-01 10:50:13 +01:00
|
|
|
}
|