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

34 lines
809 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
2019-12-01 12:50:13 +03:00
const vroot = @VMODROOT
// build as a project folder
const efolders = [
'examples/viewer',
'examples/vweb_orm_jwt',
]
2019-12-01 12:50:13 +03:00
fn main() {
2020-12-20 20:01:02 +03:00
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)).replace('\\',
'/'))
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 {
2019-12-05 00:14:23 +03:00
exit(1)
}
if testing.v_build_failing_skipped(params + '-live', os.join_path_single('examples',
'hot_reload'), skip_prefixes, fn (mut session testing.TestSession) {})
{
2019-12-01 12:50:13 +03:00
exit(1)
}
}