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

31 lines
733 B
V

module main
import os
import testing
const vroot = @VMODROOT
const efolders = [
'examples/viewer',
]
fn main() {
args_string := os.args[1..].join(' ')
params := args_string.all_before('build-examples')
skip_prefixes := efolders.map(os.real_path(os.join_path_single(vroot, it)))
res := testing.v_build_failing_skipped(params, 'examples', skip_prefixes, fn (mut session testing.TestSession) {
for x in efolders {
pathsegments := x.split_any('/')
session.add(os.real_path(os.join_path(vroot, ...pathsegments)))
}
})
if res {
exit(1)
}
if testing.v_build_failing_skipped(params + '-live', os.join_path_single('examples',
'hot_reload'), skip_prefixes, fn (mut session testing.TestSession) {})
{
exit(1)
}
}