Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compile contracts before generating docs #7369

Merged
merged 3 commits into from
Mar 12, 2024
Merged
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
4 changes: 4 additions & 0 deletions crates/forge/bin/cmd/doc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use forge_doc::{
ContractInheritance, Deployments, DocBuilder, GitSource, InferInlineHyperlinks, Inheritdoc,
};
use foundry_cli::opts::GH_REPO_PREFIX_REGEX;
use foundry_common::compile::ProjectCompiler;
use foundry_config::{find_project_root_path, load_config_with_root};
use std::{path::PathBuf, process::Command};

Expand Down Expand Up @@ -64,6 +65,9 @@ impl DocArgs {
pub fn run(self) -> Result<()> {
let root = self.root.clone().unwrap_or(find_project_root_path(None)?);
let config = load_config_with_root(Some(root.clone()));
let project = config.project()?;
let compiler = ProjectCompiler::new().quiet(true);
let _output = compiler.compile(&project)?;

let mut doc_config = config.doc.clone();
if let Some(out) = self.out {
Expand Down
Loading