Filter out all non-source files before feeding to javac.

This commit is contained in:
Olivia Brooks
2026-01-26 21:31:35 -05:00
parent a0b75edab3
commit f6a6d54992
2 changed files with 7 additions and 3 deletions

View File

@@ -43,6 +43,4 @@ raven run main.Main
will be implemented should there arise a need.
- [ ] Wrap errors properly, instead of hap-hazardly using `anyhow`
- [ ] Maybe proper logging?
- [ ] Make `fs::expand_files()` skip over non-`.java` files or properly handle
that.
- [ ] Fix using hashes to avoid unnesscesary recompilation.

View File

@@ -185,7 +185,13 @@ fn new(project_name: String) -> anyhow::Result<()> {
}
fn build() -> anyhow::Result<()> {
let mut targets = crate::fs::expand_files(DIR_SRC.as_path())?;
let mut targets: Vec<PathBuf> = crate::fs::expand_files(DIR_SRC.as_path())?
.into_iter()
.filter(|f| {
f.extension()
.is_some_and(|ext| ext.to_str().is_some_and(|ext| ext == JAVA_EXT_SOURCE))
})
.collect();
let mut nest_lock = NestLock::load().unwrap_or_default();
nest_lock.update();