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

src folder for package can have subfolders

Adding to src folder, subfolders that contain v files. That allows a better organization of v files inside a packages inside src folder.
This commit is contained in:
R cqls 2023-03-29 11:01:07 +02:00 committed by GitHub
parent 6756d28595
commit 77e14f6e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -346,6 +346,12 @@ pub fn (b Builder) v_files_from_dir(dir string) []string {
println('v_files_from_dir ("${src_path}") (/src/)') println('v_files_from_dir ("${src_path}") (/src/)')
} }
files = os.ls(src_path) or { panic(err) } files = os.ls(src_path) or { panic(err) }
src_path_offset := src_path.split('/').len
for file in os.walk_ext(src_path, '.v').map(it.split('/')#[src_path_offset..].join('/')) {
if !files.contains(file) {
files << file
}
}
return b.pref.should_compile_filtered_files(src_path, files) return b.pref.should_compile_filtered_files(src_path, files)
} }
} }