Skip to content

Commit

Permalink
add note on 'include/' build files
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Feb 22, 2025
1 parent 65cb383 commit e463685
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion compiler-cli/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ pub fn private_files_excluding_gitignore(dir: &Utf8Path) -> impl Iterator<Item =
.map(|pb| Utf8PathBuf::from_path_buf(pb).expect("Non Utf-8 Path"))
}

pub fn erlang_files(dir: &Utf8Path) -> Result<impl Iterator<Item = Utf8PathBuf> + '_> {
pub fn toplevel_erlang_files(dir: &Utf8Path) -> Result<impl Iterator<Item = Utf8PathBuf> + '_> {
Ok(read_dir(dir)?
.flat_map(Result::ok)
.map(|e| e.into_path())
Expand Down
7 changes: 6 additions & 1 deletion compiler-cli/src/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,12 @@ fn generated_erlang_files(

// Erlang headers
if include.is_dir() {
for file in fs::erlang_files(&include)? {
// Note that the include subdirectory of 'build/prod/.../package' is
// auto-generated on Erlang codegen based on exposed record types, and
// is always flat, so we can check only for top-level Erlang files.
// Precisely because it is auto-generated, we also don't check for
// '.gitignore' since it would typically always ignore 'build/' anyway.
for file in fs::toplevel_erlang_files(&include)? {
let name = file.file_name().expect("generated_files include file name");
files.push((tar_include.join(name), fs::read(file)?));
}
Expand Down

0 comments on commit e463685

Please sign in to comment.