Walk `programs/` and record every `.hll` keyed by its forward-slash, repo-relative path. These back WASM-safe relative-import resolution where the filesystem is unavailable.
(dir: &Path, manifest_dir: &Path, out: &mut Vec<SourceFile>)
| 84 | files.push(path); |
| 85 | } |
| 86 | } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | fn module_name_for(path: &Path) -> String { |
| 91 | path.with_extension("") |
| 92 | .components() |
| 93 | .map(|component| component.as_os_str().to_string_lossy()) |
| 94 | .collect::<Vec<_>>() |
| 95 | .join("_") |
| 96 | .chars() |
| 97 | .map(|ch| if ch.is_ascii_alphanumeric() { ch } else { '_' }) |
| 98 | .collect() |
| 99 | } |
| 100 | |
| 101 | fn generate_userspace(manifest_dir: &Path, out_dir: &Path) { |
| 102 | let user_dir = manifest_dir.join("programs/user"); |
| 103 | println!("cargo:rerun-if-changed={}", user_dir.display()); |
| 104 | |
| 105 | let mut build_files = Vec::new(); |
| 106 | collect_build_files(&user_dir, &mut build_files); |
| 107 | build_files.sort(); |
no test coverage detected