Skip to content
Snippets Groups Projects
Unverified Commit eb3e96de authored by Lennard Gäher's avatar Lennard Gäher
Browse files

fix dune-project generation

parent be34e3ad
No related branches found
No related tags found
1 merge request!40Fix dune-project
......@@ -678,25 +678,27 @@ impl<'tcx, 'rcx> VerificationCtxt<'tcx, 'rcx> {
// write the dune-project file, if required
if rrconfig::generate_dune_project() {
base_dir_path.pop();
base_dir_path.push("dune-project");
let mut dune_project_file =
io::BufWriter::new(fs::File::create(base_dir_path.as_path()).unwrap());
let mut dune_project_path = rrconfig::absolute_work_dir();
dune_project_path.push("dune-project");
let (project_name, dune_project_package) = if let Some(ref dune_package) = self.dune_package {
(dune_package.to_string(), format!("(package (name {dune_package}))\n"))
} else {
(stem.to_string(), format!(""))
};
write!(
dune_project_file,
"\
; Generated by [refinedrust], do not edit.\n\
(lang dune 3.8)\n\
(using coq 0.8)\n\
(name {project_name})\n{dune_project_package}",
)
.unwrap();
if !dune_project_path.exists() {
let mut dune_project_file =
io::BufWriter::new(fs::File::create(dune_project_path.as_path()).unwrap());
let (project_name, dune_project_package) = if let Some(ref dune_package) = self.dune_package {
(dune_package.to_string(), format!("(package (name {dune_package}))\n"))
} else {
(stem.to_string(), format!(""))
};
write!(
dune_project_file,
"\
(lang dune 3.8)\n\
(using coq 0.8)\n\
(name {project_name})\n{dune_project_package}",
)
.unwrap();
}
}
// write generated (subdirectory "generated")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment