1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/cmd/tools/vbuild-tools.v

38 lines
913 B
V
Raw Normal View History

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