Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ permissions:

jobs:
rust-ci:
uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@d135b05bfc647d0c0fbfedc7e80f37ea50f49236
uses: hyperpolymath/standards/.github/workflows/rust-ci-reusable.yml@81dbf2dd854b1444fd6236fa2352474383b2c2b9
permissions:
actions: read
contents: read
Expand Down
30 changes: 22 additions & 8 deletions src/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ pub fn generate_all(manifest: &Manifest, output_dir: &str) -> Result<ScaffoldRes

/// Validate, scaffold, and write the -iser repository only, without its
/// boj-server cartridge.
///
/// Writes to `<output_dir>/<iser_name>/`, where `iser_name` is derived from
/// `manifest.language.name`. Existing generated files are overwritten.
/// Returns [`ScaffoldResult::Success`] containing the repository's root path
/// and generated file contents.
///
/// # Errors
///
/// Returns an error if semantic validation fails or output directories cannot
/// be created or files written. A write failure may leave partial output.
pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result<ScaffoldResult> {
// Step 1: Deep validation
let report = parser::validate_or_bail(manifest)?;
Expand All @@ -93,10 +103,7 @@ pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result<Scaff
);
}
_ => {
anyhow::bail!(
"{}",
result.error_message().unwrap_or("unknown error")
);
anyhow::bail!("{}", result.error_message().unwrap_or("unknown error"));
}
}

Expand All @@ -110,7 +117,17 @@ pub fn generate_repo_only(manifest: &Manifest, output_dir: &str) -> Result<Scaff
/// `cartridges/domains/<domain>/`; the cartridge vendors the ADR-0006
/// invoke-shim at `ffi/cartridge_shim.zig` and so builds wherever it sits.
///
/// Here, `iser_name` is derived from `manifest.language.name`. Existing
/// generated files are overwritten. Returns
/// [`cartridge::CartridgeScaffoldResult::Success`] containing the cartridge's
/// root path and generated file contents.
///
/// See `cartridge` module docs and standards#89 Phase 2b for context.
///
/// # Errors
///
/// Returns an error if semantic validation fails or output directories cannot
/// be created or files written. A write failure may leave partial output.
pub fn generate_cartridge(
manifest: &Manifest,
output_dir: &str,
Expand All @@ -132,10 +149,7 @@ pub fn generate_cartridge(
);
}
_ => {
anyhow::bail!(
"{}",
result.error_message().unwrap_or("unknown error")
);
anyhow::bail!("{}", result.error_message().unwrap_or("unknown error"));
}
}

Expand Down
Loading